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.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | bc3def9ea61c55ff7579cd9f75918a108af66db65981fcc2e638b6866fdaf0a7 |
|
MD5 | 13b8cac9cabe95ecc12177b7c8b01498 |
|
BLAKE2b-256 | fa3753778aa3b90323d86c5873321f7d7cb51cfbd56fd8a35053dc71d606c30d |
Hashes for sqlalchemy_cockroachdb-2.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 957ac4e22e9e8cd4d3f34ee878b76f439570e5d5ca61d2076f857a19a87ac4ca |
|
MD5 | 75f74a79f3734cd0953208dd1abe499b |
|
BLAKE2b-256 | 200db3d3b5830c6f05bd95d6cda76f281c0f74b94a998e99a355113066562dd4 |