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

Uploaded Source

Built Distribution

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

Uploaded Python 3

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

Hashes for pep249-1.0.1.tar.gz
Algorithm Hash digest
SHA256 cebb8940b3752d5bb790028f2550e00e3a4e8c61c1bdb08bd5df03e27720efa9
MD5 f6ad24371d2e21d4a0fa6bdf0c80c7c0
BLAKE2b-256 a6d1b2f58fea218675a571f8d089ea715c50225df0fc281da53b068710bc648a

See more details on using hashes here.

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

Hashes for pep249-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 b7485207322bd38d9e8d1ee9d924a0d2e238cc28102ae00c763a6196a358d645
MD5 51baa6242706cd18f6fa9549553bab0d
BLAKE2b-256 019ef780da15e84ebdee0f7ad4af35b098e95aaaf1e6d368642b466cf5e6aad8

See more details on using hashes here.

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