Skip to content

Commit 9c7c689

Browse files
committed
wrong psygopg note, replaced by correct config
1 parent 5dd81fa commit 9c7c689

File tree

3 files changed

+25
-9
lines changed

3 files changed

+25
-9
lines changed

docs/examples/usage/test_configuration_28.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
"""Test configuration example: Best practice - Tune pool sizes."""
22

3+
34
def test_disable_security_checks_best_practice() -> None:
45
"""Test disabling security checks when necessary."""
56

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,20 @@
1-
import pytest
2-
3-
4-
@pytest.mark.skip(reason="PsycopgConfig does not exist in the codebase.")
51
def test_psycopg_config_setup() -> None:
6-
pass
2+
from sqlspec.adapters.psycopg import PsycopgAsyncConfig
3+
4+
# Async version
5+
config = PsycopgAsyncConfig(
6+
pool_config={
7+
"conninfo": "postgresql://user:pass@localhost/db",
8+
# Or keyword arguments:
9+
"host": "localhost",
10+
"port": 5432,
11+
"dbname": "mydb",
12+
"user": "myuser",
13+
"password": "mypassword",
14+
# Pool settings
15+
"min_size": 5,
16+
"max_size": 10,
17+
"timeout": 30.0,
18+
}
19+
)
20+
assert config.pool_config is not None

docs/usage/configuration.rst

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,11 @@ PostgreSQL Configuration (asyncpg)
5858
PostgreSQL Configuration (psycopg)
5959
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
6060

61-
.. note::
62-
63-
The `PsycopgConfig` class referenced here is for documentation purposes only and may not be present in the codebase. Future releases may include this feature if demand warrants.
64-
61+
.. literalinclude:: /examples/usage/test_configuration_5.py
62+
:language: python
63+
:caption: `psycopg async configuration`
64+
:lines: 2-19
65+
:dedent: 2
6566

6667
MySQL Configuration (asyncmy)
6768
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

0 commit comments

Comments
 (0)