pub struct Schema {
pub version: Option<u32>,
pub tables: Vec<TableDef>,
pub policies: Vec<RlsPolicy>,
pub indexes: Vec<IndexDef>,
}Expand description
Schema containing all table definitions
Fields§
§version: Option<u32>Schema format version (extracted from -- qail: version=N directive)
tables: Vec<TableDef>§policies: Vec<RlsPolicy>RLS policies declared in the schema
indexes: Vec<IndexDef>Indexes declared in the schema
Implementations§
Source§impl Schema
impl Schema
Sourcepub fn find_table(&self, name: &str) -> Option<&TableDef>
pub fn find_table(&self, name: &str) -> Option<&TableDef>
Find a table by name
Sourcepub fn to_sql(&self) -> String
pub fn to_sql(&self) -> String
Generate complete SQL for this schema: tables + RLS + policies + indexes.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Schema
impl<'de> Deserialize<'de> for Schema
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for Schema
impl RefUnwindSafe for Schema
impl Send for Schema
impl Sync for Schema
impl Unpin for Schema
impl UnwindSafe for Schema
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