pub struct Schema { /* private fields */ }Expand description
The whole schema catalog: every object in sqlite_schema.
Implementations§
Source§impl Schema
impl Schema
Sourcepub fn read(pager: &dyn PageSource) -> Result<Schema>
pub fn read(pager: &dyn PageSource) -> Result<Schema>
Read and parse the entire sqlite_schema table from the database.
Sourcepub fn objects(&self) -> &[SchemaObject]
pub fn objects(&self) -> &[SchemaObject]
All objects, in sqlite_schema (rowid) order.
Sourcepub fn table(&self, name: &str) -> Option<&SchemaObject>
pub fn table(&self, name: &str) -> Option<&SchemaObject>
Find a table by name (case-sensitive for now; SQLite folds ASCII case — tracked for Phase 9).
Sourcepub fn index(&self, name: &str) -> Option<&SchemaObject>
pub fn index(&self, name: &str) -> Option<&SchemaObject>
Find an index by name.
Sourcepub fn indexes_on<'a>(
&'a self,
table: &'a str,
) -> impl Iterator<Item = &'a SchemaObject> + 'a
pub fn indexes_on<'a>( &'a self, table: &'a str, ) -> impl Iterator<Item = &'a SchemaObject> + 'a
All indexes attached to the named table.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Schema
impl RefUnwindSafe for Schema
impl Send for Schema
impl Sync for Schema
impl Unpin for Schema
impl UnsafeUnpin 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