Build a Python app with SQLAlchemy + CockroachDB

Build a Python app with SQLAlchemy + CockroachDB

One of the great things about CockroachDB’s support for SQL is the ecosystem of frameworks, ORMs, and other tools for working with SQL data. SQLAlchemy is just one of the ORMs in that ecosystem, and one we use quite a bit for Python projects. You’ll find it referenced in some of our sample application docs, and our upcoming “CockroachDB for Python Developers” course has students use SQLAlchemy and Flask in projects. 

Given the prevalence of SQLAlchemy at Cockroach Labs and in the Python and Flask communities, we’re excited to announce a few updates that make our compatibility with SQLAlchemy even more seamless. Updates include new support for SAVEPOINT, and improved transaction retries (you can download the updated code and the sqlalchemy-cockroachdb Python package here).

Our docs team has written a start-from-scratch tutorial on how to build a `Hello World` app with SQLAlchemy and CockroachDB. So if you’re a Python developer looking to get started with an easy SQL database, check out the tutorial here. Or if videos are more your thing, you can preview many of the lessons from the upcoming “CockroachDB for Python Developers” course on our YouTube channel.

As always, if you have any comments or questions about CockroachDB and SQLAlchemy, stop by our community Slack. Happy querying!

Keep Reading

Building an application with CockroachDB and SQLAlchemy

CockroachDB’s support for SQLAlchemy is currently in beta, but we’re actively developing new …

Read more
Tutorial: How to build a low-latency Flask app that runs across multiple regions

If your company has a global customer base, you’ll likely be building an application for users in different …

Read more
How to use CockroachDB with your Django application on Ubuntu

Django is a high-level flexible framework for building Python applications quickly. Applications run on Django …

Read more