Metadata-Version: 2.1
Name: sqlalchemy-cockroachdb
Version: 2.0.0
Summary: CockroachDB dialect for SQLAlchemy
Home-page: https://github.com/cockroachdb/sqlalchemy-cockroachdb
Author: Cockroach Labs
Author-email: cockroach-db@googlegroups.com
License: http://www.apache.org/licenses/LICENSE-2.0
Project-URL: Documentation, https://github.com/cockroachdb/sqlalchemy-cockroachdb/wiki
Project-URL: Source, https://github.com/cockroachdb/sqlalchemy-cockroachdb
Project-URL: Tracker, https://github.com/cockroachdb/sqlalchemy-cockroachdb/issues
Keywords: SQLAlchemy CockroachDB
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Description-Content-Type: text/markdown
License-File: LICENSE

# CockroachDB dialect for SQLAlchemy

## Prerequisites

For psycopg2 support you must install either:

* [psycopg2](https://pypi.org/project/psycopg2/), which has some
  [prerequisites](https://www.psycopg.org/docs/install.html#prerequisites) of
  its own.

* [psycopg2-binary](https://pypi.org/project/psycopg2-binary/)

(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

* [asyncpg](https://pypi.org/project/asyncpg/)
 
## 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](https://github.com/cockroachdb/sqlalchemy-cockroachdb/blob/master/CHANGES.md)
