Skip to content

Repository files navigation

Turso + SQLAlchemy

Turso + SQLAlchemy

The package currently only supports Linux and macOS.

SQLite for Production. Powered by libSQL.

Turso · Quickstart · Examples · Docs · Discord · Blog & Tutorials

PyPIdiscord activity


Examples

Embedded Replica

importosfromsqlalchemyimportcreate_engineengine=create_engine(
"sqlite+libsql:///embedded.db",
connect_args={
"auth_token": os.getenv("TURSO_AUTH_TOKEN"),
"sync_url": f"{os.getenv("TURSO_DATABASE_URL")}",
},
)

Remote Database

importosfromsqlalchemyimportcreate_engineengine=create_engine(
f"sqlite+libsql://{os.getenv("TURSO_DATABASE_URL")}?secure=true",
connect_args={
"auth_token": os.getenv("TURSO_AUTH_TOKEN"),
},
)

In-Memory Database

fromsqlalchemyimportcreate_engineengine=create_engine("sqlite+libsql://")

Local Database

fromsqlalchemyimportcreate_engineengine=create_engine("sqlite+libsql:///local.db")

Documentation

  1. Turso Quickstart — Learn how create and connect your first database.
  2. SDK Quickstart — Learn how to install and execute queries using the libSQL client.
  3. SDK Reference — Dive deeper with the libSQL SDK reference and examples.

What is Turso?

Turso is a SQLite-compatible database built on libSQL, the Open Contribution fork of SQLite. It enables scaling to hundreds of thousands of databases per organization and supports replication to any location, including your own servers, for microsecond-latency access.

Learn more about what you can do with Turso:

About

SQLAlchemy dialect for libSQL

Topics

Resources

Stars

23 stars

Watchers

3 watching

Forks

Releases

Packages

Used by

Contributors

Languages