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.0.1.tar.gz
(3.5 kB
view details)
Built Distribution
File details
Details for the file pep249-1.0.1.tar.gz
.
File metadata
- Download URL: pep249-1.0.1.tar.gz
- Upload date:
- Size: 3.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.9.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | cebb8940b3752d5bb790028f2550e00e3a4e8c61c1bdb08bd5df03e27720efa9 |
|
MD5 | f6ad24371d2e21d4a0fa6bdf0c80c7c0 |
|
BLAKE2b-256 | a6d1b2f58fea218675a571f8d089ea715c50225df0fc281da53b068710bc648a |
File details
Details for the file pep249-1.0.1-py3-none-any.whl
.
File metadata
- Download URL: pep249-1.0.1-py3-none-any.whl
- Upload date:
- Size: 3.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.9.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b7485207322bd38d9e8d1ee9d924a0d2e238cc28102ae00c763a6196a358d645 |
|
MD5 | 51baa6242706cd18f6fa9549553bab0d |
|
BLAKE2b-256 | 019ef780da15e84ebdee0f7ad4af35b098e95aaaf1e6d368642b466cf5e6aad8 |