pub struct ModelIr {
pub logical_name: String,
pub db_name: String,
pub fields: Vec<FieldIr>,
pub primary_key: PrimaryKeyIr,
pub unique_constraints: Vec<UniqueConstraintIr>,
pub indexes: Vec<IndexIr>,
pub check_constraints: Vec<String>,
pub span: Span,
}Expand description
Validated model with fully resolved fields and metadata.
Fields§
§logical_name: StringThe logical name as defined in the schema (e.g., “User”).
db_name: StringThe physical database table name (from @@map or logical_name).
fields: Vec<FieldIr>All fields in the model.
primary_key: PrimaryKeyIrPrimary key metadata.
unique_constraints: Vec<UniqueConstraintIr>Unique constraints (from @unique and @@unique).
indexes: Vec<IndexIr>Indexes (from @@index).
check_constraints: Vec<String>Table-level CHECK constraint expressions (SQL strings).
span: SpanSpan of the model declaration.
Implementations§
Source§impl ModelIr
impl ModelIr
Sourcepub fn find_field(&self, name: &str) -> Option<&FieldIr>
pub fn find_field(&self, name: &str) -> Option<&FieldIr>
Finds a field by logical name.
Sourcepub fn scalar_fields(&self) -> impl Iterator<Item = &FieldIr>
pub fn scalar_fields(&self) -> impl Iterator<Item = &FieldIr>
Returns an iterator over scalar fields (non-relations).
Sourcepub fn relation_fields(&self) -> impl Iterator<Item = &FieldIr>
pub fn relation_fields(&self) -> impl Iterator<Item = &FieldIr>
Returns an iterator over relation fields.
Trait Implementations§
impl StructuralPartialEq for ModelIr
Auto Trait Implementations§
impl Freeze for ModelIr
impl RefUnwindSafe for ModelIr
impl Send for ModelIr
impl Sync for ModelIr
impl Unpin for ModelIr
impl UnsafeUnpin for ModelIr
impl UnwindSafe for ModelIr
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more