Expand description
Table and struct registry for compile-time validation.
derive(Table) #[hyperdb(register)] calls into this registry at macro
expansion time to record:
- The SQL
CREATE TABLEstatement for the table (for lazy seeding). - The struct’s field-name list (for the name-subset diff in
validate.rs).
Tables are seeded into the CompileTimeDb lazily: only when a query_as!
dry-run returns SQLSTATE 42P01 (undefined_table) do we seed the relevant
table and retry. This handles cross-file macro expansion ordering without
requiring a client-side SQL parser.
Structs§
- Registry
- The public
Registrytype — a thin newtype that provides the seeding interface against a liveCompileTimeDb. Created from a lock guard byvalidate_query_as. - Table
Entry - Information about a registered table derived from
#[derive(Table)].
Functions§
- contains
- Returns true if the SQL table name is known to the registry.
- get_
by_ struct - Look up a registered entry by Rust struct ident.
Returns
(table_name, entry)so callers have the SQL name for seeding. - get_
by_ table - Look up a registered entry by SQL table name.
- register
- Register a table and its associated struct field list.
- registered_
names - All registered table names (for diagnostics).