### Local Database Example Source: https://github.com/tursodatabase/sqlalchemy-libsql/blob/main/README.md Provides an example of creating a SQLAlchemy engine for a local Turso database file named 'local.db'. ```python from sqlalchemy import create_engine engine = create_engine("sqlite+libsql:///local.db") ``` -------------------------------- ### In-Memory Database Example Source: https://github.com/tursodatabase/sqlalchemy-libsql/blob/main/README.md Illustrates how to create an in-memory SQLAlchemy engine for a Turso database. This is useful for temporary data or testing. ```python from sqlalchemy import create_engine engine = create_engine("sqlite+libsql://") ``` -------------------------------- ### Embedded Replica Example Source: https://github.com/tursodatabase/sqlalchemy-libsql/blob/main/README.md Demonstrates how to create a SQLAlchemy engine for an embedded replica of a Turso database. It requires TURSO_AUTH_TOKEN and TURSO_DATABASE_URL environment variables. ```python import os from sqlalchemy import create_engine engine = 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 Example Source: https://github.com/tursodatabase/sqlalchemy-libsql/blob/main/README.md Shows how to connect to a remote Turso database using SQLAlchemy. This requires the TURSO_DATABASE_URL and TURSO_AUTH_TOKEN environment variables to be set. ```python import os from sqlalchemy import create_engine engine = create_engine( f"sqlite+libsql://{os.getenv("TURSO_DATABASE_URL")}?secure=true", connect_args={ "auth_token": os.getenv("TURSO_AUTH_TOKEN"), }, ) ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.