Skip to main content

Module schema

Module schema 

Source

Structs§

AtomicViewState
Atomic wrapper for #name
BTreeCharacteristics
BTreeTable
CheckConstraint
ColDef
Column
ColumnsMut
ForeignKey
FromClauseSubquery
A derived table from a FROM clause subquery.
FromClauseSubqueryCteMetadata
Index
IndexColumn
MakeFromBtreeState
State machine for async schema loading - passed by caller, not stored on Schema
PseudoCursorType
ResetOnClone
RAII wrapper that resets its inner value when cloned.
ResolvedFkRef
A single resolved foreign key where parent_table == target.
ResolvedType
Custom type definition, loaded from sqlite_turso_types A fully-resolved custom type: the chain of TypeDefs from the named type up to the ultimate primitive, plus the primitive name itself.
Schema
Sequence
Schema descriptor for a sequence. Pure data — the runtime state lives in the backing table __turso_internal_seq_<name> and is read from disk by Insn::SequenceComputeNext + surrounding cursor bytecode on every nextval/setval call. See core/translate/sequence.rs and the disk-only design notes above.
StructDef
Definition for a STRUCT composite type.
StructFieldDef
Field definition within a StructDef.
Trigger
Trigger structure
TypeDef
UnionDef
Definition for a UNION discriminated union type.
UnionVariantDef
Variant definition within a UnionDef.
UniqueSet
View
Simple view structure for non-materialized views

Enums§

ColumnLayout
Maps schema column indices to register offsets for DML operations.
GeneratedType
MakeFromBtreePhase
Phase tracking for async schema loading
SchemaObjectType
Type of schema object for conflict checking
Table
Type
TypeDefKind
The kind-specific payload of a custom type.
ViewState

Constants§

AUTOINCREMENT_SEQ_PREFIX
DBSP_TABLE_PREFIX
EXPR_INDEX_SENTINEL
The Position in Table for indexes which are arbitrary expressions (index.expr.is_some())
RESERVED_TABLE_PREFIXES
Internal table prefixes that should be protected from CREATE/DROP
ROWID_SENTINEL
Used to refer to the implicit rowid column in tables without an alias during UPDATE
SCHEMA_TABLE_NAME
SCHEMA_TABLE_NAME_ALT
SEQ_BACKING_TABLE_PREFIX
SQLITE_SEQUENCE_TABLE_NAME
TEMP_SCHEMA_TABLE_NAME
TEMP_SCHEMA_TABLE_NAME_ALT
TURSO_INTERNAL_PREFIX
TURSO_TYPES_TABLE_NAME

Functions§

_build_pseudo_table
allow_user_dml
autoincrement_sequence_name
Name of the hidden sequence owned by an AUTOINCREMENT table.
collect_column_dependencies_of_expr
Extract all column name references from an expression as a set. columns is used to resolve pre-resolved Expr::Column { SELF_TABLE } back to names.
create_table
is_system_table
Check if a table name refers to a system table that should be protected from direct writes
render_gencol_expr_sql_with_new_names
Re-render the SQL text of a generated-column expression using current column names. The input AST may have been previously resolved into Expr::Column { table: SELF_TABLE, column: idx, .. } nodes; we replace each such self-table reference with a fresh Expr::Id(<col-name>) before stringifying so the result round-trips through the parser, even if a referenced column was renamed since the original original_sql was captured.
resolve_gencol_expr_columns
Resolve Expr::Id / Expr::Qualified / Expr::DoublyQualified in a generated column or partial-index expression to Expr::Column { table: SELF_TABLE, column: idx }.
rewrite_value_to_column
Recursively rewrite Expr::Id("value") (case-insensitive) to Expr::Id(col_name).
sqlite_schema_table
translate_ident_to_string_literal
SQLite treats bare identifiers in DEFAULT clauses as string literals. E.g., DEFAULT hello becomes the string “hello”, not a column reference.

Type Aliases§

ViewsMap
Type alias for regular views collection