pub struct SchemaRegistry { /* private fields */ }Expand description
Registry of attached databases for a connection.
The main and temp schemas are always present and cannot be detached.
Up to SQLITE_MAX_ATTACHED additional databases can be attached.
Implementations§
Source§impl SchemaRegistry
impl SchemaRegistry
Sourcepub fn attach(&mut self, schema: String, path: String) -> Result<()>
pub fn attach(&mut self, schema: String, path: String) -> Result<()>
Attach a database file with the given schema name.
§Errors
Returns error if the name is already in use, or if the maximum number of attached databases would be exceeded (invariant #8).
Sourcepub fn detach(&mut self, schema: &str) -> Result<()>
pub fn detach(&mut self, schema: &str) -> Result<()>
Detach a database by schema name.
§Errors
Returns error if the schema name is not found or is reserved.
Sourcepub fn find(&self, schema: &str) -> Option<&AttachedDb>
pub fn find(&self, schema: &str) -> Option<&AttachedDb>
Look up an attached database by schema name.
Returns None for main/temp (they are implicit) and for unknown names.
Sourcepub fn is_valid_schema(&self, schema: &str) -> bool
pub fn is_valid_schema(&self, schema: &str) -> bool
Resolve a schema-qualified name. Returns true if the schema is
main, temp, or a currently attached database.
Sourcepub fn all_schemas(&self) -> Vec<&str>
pub fn all_schemas(&self) -> Vec<&str>
List all schema names (including main and temp).
Trait Implementations§
Source§impl Debug for SchemaRegistry
impl Debug for SchemaRegistry
Auto Trait Implementations§
impl Freeze for SchemaRegistry
impl RefUnwindSafe for SchemaRegistry
impl Send for SchemaRegistry
impl Sync for SchemaRegistry
impl Unpin for SchemaRegistry
impl UnsafeUnpin for SchemaRegistry
impl UnwindSafe for SchemaRegistry
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, _span: NoopSpan) -> Self
fn instrument(self, _span: NoopSpan) -> Self
Instruments this future with a span (no-op when disabled).
Source§fn in_current_span(self) -> Self
fn in_current_span(self) -> Self
Instruments this future with the current span (no-op when disabled).