3 Star 0 Fork 0

cockroachdb/example-app-python-psycopg3

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
README.md 1.08 KB
一键复制 编辑 原始数据 按行查看 历史
ianjevans 提交于 2022-08-09 10:09 . Updated links to psycopg3 docs.

example-app-python-psycopg3

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.

Before you begin

To run this example you must have:

  • Python 3
  • pip version 20.3 or greater

Install the dependencies

In a terminal run the following command:

pip install -r requirements.txt

Set the CockroachDB connection URL

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.

Run the example

To run the example, in a terminal run the following command:

python3 example.py
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/mirrors_cockroachdb/example-app-python-psycopg3.git
git@gitee.com:mirrors_cockroachdb/example-app-python-psycopg3.git
mirrors_cockroachdb
example-app-python-psycopg3
example-app-python-psycopg3
main

搜索帮助

Cb406eda 1850385 E526c682 1850385