This repo has a simple CRUD Python application that uses the psycopg3
driver to talk to a CockroachDB cluster.
For details on creating a CockroachDB cluster and running the code, see this tutorial.
To run this example you must have:
- Python 3
pip
version 20.3 or greater
In a terminal run the following command:
pip install -r requirements.txt
In a terminal set a DATABASE_URL
environment variable to the connection URL for your CockroachDB cluster.
For example on Mac and Linux:
export DATABASE_URL='<connection URL>'
For detailed steps on creating a CockroachDB cluster, see the tutorial.
To run the example, in a terminal run the following command:
python3 example.py