Connecting to CockroachDB
Data Science & AI Workbench enables you to connect to a CockroachDB SQL database within your sessions, whether the database is running on-premises or on a cloud server.
To access CockroachDB, you’ll need to conda install the required driver using the following command:
Any packages you install from the command line are available during the current session only. If you want them to persist, add them to the project’s anaconda-project.yml
file. For more information, see Project configurations.
After you’ve installed the psycopg2
driver, you can then use code such as this to access CockroachDB from within a notebook session:
See Secrets for information about adding credentials to the platform, to make them available in your projects. Any secrets you add will be available across all sessions and deployments associated with your user account.
Was this page helpful?