pub struct AliasOptions {
pub prefix: Option<String>,
pub depth: Option<usize>,
}Expand description
<db>(alias(prefix = "__mine", depth = 16)) — one database’s answer about the names its
nested scopes mint, in the two states each half has.
§Per DATABASE, because the emitted table already is
ALIASES rides one SqlQuery<Db> impl, so a record stored in two databases already carries two
of them; letting the two differ cost nothing that was not already there. And the user story is
per database too: one deployment’s schema holds legacy tables inside the default namespace and
the others do not, so the override belongs on that database and nowhere else.
§DECLARED-or-not is kept, and the FENCE is what needs it
prefix_in resolves to the MODEL’s own
EmissionPrefix where nothing was written, which is what the
emission spends. What the fence needs is the other question — whether anything was written at
all — because it refuses the union of every DECLARED prefix plus the default wherever a database
still defaults. A record that overrode every one of its databases has handed __ig* back to its
author, and a model that had already collapsed the absent case into the default could not tell.
§The fallback is the MODEL’s namespace and not this crate’s constant
Two seats, one answer: <db>(alias(prefix = …)) is what a DECLARATION moves, and
RecordModel::prefix is what a FRAMEWORK building the model moves. The declaration’s word
wins where it is written, and where it is not the answer is the framework’s own mark — so a
model mediagraph-codegen built defaults to __mg here, rather than to ingraph’s __ig
through a constant that has never heard of it.
Fields§
§prefix: Option<String>prefix = "…", or None where this database took the default.
depth: Option<usize>depth = N, or None where this database took the default.
Implementations§
Source§impl AliasOptions
impl AliasOptions
Sourcepub fn prefix_in<'a>(&'a self, prefix: &'a EmissionPrefix) -> &'a str
pub fn prefix_in<'a>(&'a self, prefix: &'a EmissionPrefix) -> &'a str
The namespace this database’s names are minted in — its own, or the framework’s.
prefix is the model’s, so an absent prefix = "…" resolves to whichever framework built
this declaration rather than to a constant. Every name minted FOR one database goes through
here: the row aliases, and the companion column beside them.