Provide minimum implementation check and connection pool of PEP249.
Project description
pep249
Provide minimum implementation check and connection pool of PEP249.
Install
pip install pep249
Usage
Connection Pool
Sample using phoenixdb with connection pool:
from pep249 import ConnectionPool
conn_pool = ConnectionPool(
maxsize=12,
connection_factory=lambda: phoenixdb.connect(
"http://localhost:8765/", autocommit=True
),
)
with conn_pool.connect() as connection:
...
Note: The connection pool does not actively initialize the connection, it is initialized only when it is needed.
Minimum implementation check
from pep249 import Connection, Cursor
assert issubclass(YOUR_CONNECTION_CLASS, Connection)
assert isinstance(YOUR_CONNECTION, Connection)
assert issubclass(YOUR_CURSOR_CLASS, Cursor)
assert isinstance(YOUR_CURSOR, Cursor)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
pep249-1.1.0.tar.gz
(3.6 kB
view hashes)
Built Distribution
pep249-1.1.0-py3-none-any.whl
(3.7 kB
view hashes)