Skip to main content

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


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 hashes)

Uploaded Source

Built Distribution

pep249-1.0.1-py3-none-any.whl (3.7 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page