glimr_sqlite/http/context/ctx

SQLite HTTP Context

Provides a context for managing SQLite connection pools in HTTP applications. Use ctx.sqlite.pool for the default pool and ctx.sqlite.pool_for("name") for named connections. The default pool is the one with is_default: True set.

Types

SQLite context containing the default pool and a function to access named connection pools. Use pool for the default connection and pool_for to access named connections.

pub type SqliteContext {
  SqliteContext(
    pool: pool.Pool,
    pool_for: fn(String) -> pool.Pool,
  )
}

Constructors

Values

pub fn load(
  connections: List(driver.Connection),
) -> SqliteContext

Loads SQLite pools from the given connections. Filters to only SQLite connections and starts a pool for each.

Use ctx.sqlite.pool to get the default pool (the one with is_default: True). Use ctx.sqlite.pool_for("name") to access other connections by name.

Search Document