Skip to main content

CockroachDB dialect for SQLAlchemy

Project description

CockroachDB dialect for SQLAlchemy


For psycopg2 support you must install either:

(The binary package is a practical choice for development and testing but in production it is advised to use the package built from sources.)

Or, for asyncpg support (experimental) you must install

Install and usage

Use pip to install the latest version.

pip install sqlalchemy-cockroachdb

Use a cockroachdb connection string when creating the Engine. For example, to connect to an insecure, local CockroachDB cluster using psycopg2:

from sqlalchemy import create_engine
engine = create_engine('cockroachdb://root@localhost:26257/defaultdb?sslmode=disable')


from sqlalchemy import create_engine
engine = create_engine('cockroachdb+psycopg2://root@localhost:26257/defaultdb?sslmode=disable')

To connect using asyncpg:

from sqlalchemy import create_async_engine
engine = create_async_engine('cockroachdb+asyncpg://root@localhost:26257/defaultdb')



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

sqlalchemy-cockroachdb-1.4.3.tar.gz (23.8 kB view hashes)

Uploaded source

Built Distribution

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page