Resolve

Trait Resolve 

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§

fn table_for_model(&self, model: &ModelRoot) -> Option<&Table>

Returns the database table that stores the given model, if any.

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.

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.

Implementations on Foreign Types§

§

impl Resolve for ()

§

fn model(&self, _id: ModelId) -> Option<&Model>

§

fn table(&self, _id: TableId) -> Option<&Table>

§

fn table_for_model(&self, _model: &ModelRoot) -> Option<&Table>

Implementors§

§

impl Resolve for Schema

§

impl Resolve for Schema