pub struct LiveSchema {
pub tables: HashMap<String, HashSet<String>>,
pub indexes: HashSet<(String, String)>,
pub id_storage: HashMap<(String, String), IdStorage>,
pub uniques: Option<HashSet<(String, Vec<String>)>>,
}Expand description
What exists in the database, as reported by Adapter::introspect. Tables are named
as the schema names them (adapters undo their prefixes and renames); columns by their
stored names (TableDef::stored_name), which are the declared names unless a
ColumnNaming or rename says otherwise.
Fields§
§tables: HashMap<String, HashSet<String>>Table name to its column names.
indexes: HashSet<(String, String)>(table, column) pairs with a non-unique index named by index_name. Unique
columns are created with an inline constraint and aren’t listed here.
id_storage: HashMap<(String, String), IdStorage>(table, column) pairs whose live type is one an id column can have, and which
one: Postgres reports its uuid and text columns. Adapters that store ids the
same way under every strategy (SQLite, always text) leave it empty.
uniques: Option<HashSet<(String, Vec<String>)>>The column sets the database keeps unique, primary keys aside, as unique_key
builds them. None when the adapter doesn’t report them: the migrator then adds
unique constraints only with the tables and columns it creates, and can’t see one
that is missing from an existing table.