Skip to content

Latest commit

 

History

History
20 lines (13 loc) · 1006 Bytes

File metadata and controls

20 lines (13 loc) · 1006 Bytes

This repo contains the source code for a simple Hello World application, written in Python. The app uses the SQLAlchemy ORM framework to connect to an existing CockroachDB cluster.

To run the code:

  1. Start a local CockroachDB cluster, or use CockroachCloud.

  2. From the command line, execute the following:

    python3 main.py
    
  3. Enter the connection string for the cluster.

    Note: The connection string must begin with the prefix cockroachdb and must specify the database to which to connect.

    For example, for a local, demo cluster: cockroachdb://demo:<demo_password>@127.0.0.1:26257/defaultdb?sslmode=require

    For CockroachCloud: cockroachdb://<username>:<password>@<globalhost>:26257/<cluster_name>.defaultdb?sslmode=verify-full&sslrootcert=<certs_dir>/<ca.crt>