Skip to content

Commit eeedb5d

Browse files
committed
update README files
1 parent 590aae9 commit eeedb5d

File tree

2 files changed

+33
-36
lines changed

2 files changed

+33
-36
lines changed

README.asyncpg.md

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,6 @@ The connection URL is of the form:
44

55
cockroachdb+asyncpg://root@localhost:26257/defaultdb
66

7-
There is a customized version of the FastAPI SQL database tutorial for
8-
`cockroachdb+asyncpg` available at
9-
10-
https://github.com/gordthompson/fastapi-tutorial-cockroachdb-async
11-
127
### Testing
138

149
Assuming that you have an entry in test.cfg that looks something like

README.md

Lines changed: 33 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,31 @@
11
# CockroachDB dialect for SQLAlchemy
22

3-
## Prerequisites
3+
## Setup
4+
5+
### Version of SQLAlchemy to be used
6+
7+
This version of the dialect requires SQLAlchemy 2.1.x. To work with
8+
SQLAlchemy 2.0.x you'll need to install the corresponding version of this
9+
dialect.
10+
11+
```
12+
pip install "sqlalchemy-cockroachdb~=2.0"
13+
```
14+
15+
### Using async
16+
17+
If you will be running async code you'll need to install the additional
18+
support components for SQLAlchemy:
19+
20+
```
21+
pip install "sqlalchemy[asyncio]"
22+
```
23+
24+
### Database driver
425

526
A database driver (DBAPI layer) is required to work with this dialect.
627

7-
### psycopg2
28+
#### <u>psycopg2 (sync only)</u>
829

930
For psycopg2 support you must install either:
1031

@@ -17,44 +38,25 @@ For psycopg2 support you must install either:
1738
(The binary package is a practical choice for development and testing but in
1839
production it is advised to use the package built from sources.)
1940

20-
### asyncpg
21-
22-
For asyncpg support you must install
23-
24-
* [asyncpg](https://pypi.org/project/asyncpg/)
41+
#### <u>asyncpg (async only)</u>
2542

26-
For more details on working with asyncpg, see
27-
[README.asyncpg.md](README.asyncpg.md)
43+
For asyncpg support you must install [asyncpg](https://pypi.org/project/asyncpg/). For more details on working with asyncpg, see
44+
[README.asyncpg.md](README.asyncpg.md).
2845

29-
### psycopg
46+
#### <u>psycopg (sync or async)</u>
3047

31-
For psycopg version 3 support, you'll need to install
32-
33-
* [psycopg](https://pypi.org/project/psycopg/)
34-
35-
As with psycopg2, psycopg can be installed as binary for development and testing purposes.
48+
For psycopg version 3 support, you'll need to install [psycopg](https://pypi.org/project/psycopg/). As with psycopg2, psycopg can
49+
be installed as binary for development and testing purposes.
3650
(Installing as binary avoids the need for the libpq-dev package to be installed first.)
3751

38-
`pip install psycopg[binary]`
52+
```
53+
pip install "psycopg[binary]"
54+
```
3955

4056
For more details on working with psycopg, see
4157
[README.psycopg.md](README.psycopg.md)
4258

43-
## Install and usage
44-
45-
Use `pip` to install the latest release of this dialect.
46-
47-
```
48-
pip install sqlalchemy-cockroachdb
49-
```
50-
51-
NOTE: This version of the dialect requires SQLAlchemy 2.0.x. To work with
52-
earlier versions of SQLAlchemy you'll need to install an earlier version of this
53-
dialect.
54-
55-
```
56-
pip install "sqlalchemy-cockroachdb<2.0"
57-
```
59+
## Usage
5860

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

0 commit comments

Comments
 (0)