Skip to main content

Module db

Module db 

Source
Expand description

The libSQL auth database: credentials and their grants, never packages. Queries stay plain SQL so that moving to remote Turso is only a --db-url change.

Constantsยง

MIGRATION_0001 ๐Ÿ”’
Idempotent (IF NOT EXISTS), so it runs on every start.

Functionsยง

local_path ๐Ÿ”’
file:./data/auth.db โ†’ ./data/auth.db; a query string is left in place, not stripped.
open
Opens db_url and applies the migrations.
tune_local ๐Ÿ”’
Waits up to 5 s for a lock and, outside :memory:, switches to WAL, since an admin token mint beside live traffic otherwise fails SQLITE_BUSY as a 500. Remote libSQL manages its own storage and is never tuned.