ORMs
SQLAlchemy + Turso
Configure SQLAlchemy to work with your Turso database
Prerequisites
Before you start, make sure you:
1
Install the libSQL dialect for SQLAlchemy
2
Retrieve database credentials
Get the database URL:
Get the database authentication token:
Assign credentials to the environment variables inside .env
.
3
Create database models
models.py
4
Construct SQLAlchemy URL for Turso
app.py
5
Query
app.py
Was this page helpful?