pub trait Resolve {
// Required methods
fn table_for_model(&self, model: &ModelRoot) -> Option<&Table>;
fn model(&self, id: ModelId) -> Option<&Model>;
fn table(&self, id: TableId) -> Option<&Table>;
}Expand description
Schema resolution trait used by ExprContext to look up models,
tables, and the model-to-table mapping.
Implemented for Schema, db::Schema,
and () (which resolves nothing).
Required Methods§
Sourcefn table_for_model(&self, model: &ModelRoot) -> Option<&Table>
fn table_for_model(&self, model: &ModelRoot) -> Option<&Table>
Returns the database table that stores the given model, if any.
Sourcefn model(&self, id: ModelId) -> Option<&Model>
fn model(&self, id: ModelId) -> Option<&Model>
Returns a reference to the application Model with the specified ID.
Used during high-level query building to access model metadata such as field definitions, relationships, and validation rules. Returns None if the model ID is not found in the application schema.
Sourcefn table(&self, id: TableId) -> Option<&Table>
fn table(&self, id: TableId) -> Option<&Table>
Returns a reference to the database Table with the specified ID.
Used during SQL generation and query execution to access table metadata including column definitions, constraints, and indexes. Returns None if the table ID is not found in the database schema.