CockroachDB dialect for SQLAlchemy
Project description
CockroachDB dialect for SQLAlchemy
Prerequisites
For psycopg2 support you must install either:
-
psycopg2, which has some prerequisites of its own.
(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
NOTE: This version of the dialect requires SQLAlchemy 2.0 or later. To work with earlier versions of SQLAlchemy you'll need to install an earlier version of this dialect.
pip install sqlalchemy-cockroachdb<2.0.0
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')
or
from sqlalchemy import create_engine
engine = create_engine('cockroachdb+psycopg2://root@localhost:26257/defaultdb?sslmode=disable')
To connect using asyncpg (⚠️ experimental 🏗):
from sqlalchemy import create_async_engine
engine = create_async_engine('cockroachdb+asyncpg://root@localhost:26257/defaultdb')
Changelog
See CHANGES.md
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
Built Distribution
Hashes for sqlalchemy-cockroachdb-2.0.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | ddb46e2da53d812bf7b8ef21c3cafb918004747f815a283f374796bf57a9497a |
|
MD5 | c1a43c22f465fbc1e58cecea6d18828b |
|
BLAKE2b-256 | 72747157d36dee9175864f803fdbc931913dac17b0d4eee24727dbdac1244543 |
Hashes for sqlalchemy_cockroachdb-2.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b7b9de727cb662d63c654be04202e3b55c4e4cf18a642d16a783dc151a7152f8 |
|
MD5 | c5793a7aa51f5baf9657ad7814674c14 |
|
BLAKE2b-256 | 499bcfc652f756f37b1c23ed597bc88201d82b2b2c60e30b79983fecf5a96980 |