Module schema
Available on crate feature
turso only.Expand description
Prefixed table names and forward schema migrations.
Migrations are tracked per prefix in a {prefix}schema_version table (not
PRAGMA user_version), so several finmqtt instances - or finmqtt and the
callerβs own tables - can share one database without clobbering each
otherβs version. migrate applies every pending migration in order, each
in its own transaction.
To evolve the schema, append a function to MIGRATIONS; never edit or
reorder existing entries. The index of an entry is the schema version it
produces (entry 0 produces version 1).
StructsΒ§
- Tables π
- The prefix-qualified table names. Small and reused across migrations, statement preparation, and queries.
ConstantsΒ§
- MIGRATIONS π
- Ordered, append-only schema migrations. Entry
iadvances the schema to versioni + 1.
FunctionsΒ§
- apply π
- Applies one migration and records its version atomically.
- apply_
inner π - current_
version π - Reads the recorded schema version, or
0if none has been recorded yet. - initial_
schema π - Migration v1: the live-state tables plus the per-filter subscription table.
- migrate π
- Applies every pending migration, bringing the schema up to the latest version. A no-op once the database is current.
- validate_
prefix π - Validates that
prefixis safe to splice into table identifiers.