pub struct Metadata { /* private fields */ }
Expand description
Metadata contains the catalog, schema, table, column, and index definitions for a data source.
┌────────────────────────┐
│ CATALOG (database) │
│ ┌───────────────────┐ │
│ │SCHEMA (namespace) │ │
│ │┌────────┬────────┐│ │
│ ││ TABLE │ TABLE ││ │
│ ││ row │ row ││ │
│ ││ row │ row ││ │
│ ││ row │ row ││ │
│ │└────────┴────────┘│ │
│ └───────────────────┘ │
│ ┌───────────────────┐ │
│ │SCHEMA (namespace) │ │
│ │┌────────┬────────┐│ │
│ ││ TABLE │ TABLE ││ │
│ ││ row │ row ││ │
│ ││ row │ row ││ │
│ ││ row │ row ││ │
│ │└────────┴────────┘│ │
│ └───────────────────┘ │
└────────────────────────┘
┌───────────────────────────────────┐
│ TABLE │
├───────────┬───────────┬───────────┤
│ Column A │ Column B │ Column C │
├───────────┼───────────┼───────────┤
│ Value A1 │ Value B1 │ Value C1 │ ← Row 1
│ Value A2 │ Value B2 │ Value C2 │ ← Row 2
│ Value A3 │ Value B3 │ Value C3 │ ← Row 3
│ ⋮ │ ⋮ │ ⋮ │
│ Value An │ Value Bn │ Value Cn │ ← Row n
└───────────┴───────────┴───────────┘
Implementations§
Source§impl Metadata
impl Metadata
Sourcepub fn with_dialect(dialect: Box<dyn Dialect>) -> Metadata
pub fn with_dialect(dialect: Box<dyn Dialect>) -> Metadata
Creates a new Metadata instance with the specified dialect.
Sourcepub fn get_mut<S>(&mut self, name: S) -> Option<&mut Catalog>
pub fn get_mut<S>(&mut self, name: S) -> Option<&mut Catalog>
Returns the mutable catalog with the specified name.
Sourcepub fn current_catalog(&self) -> Option<&Catalog>
pub fn current_catalog(&self) -> Option<&Catalog>
Returns the current catalog.
Sourcepub fn current_catalog_schema(&self) -> Option<&Schema>
pub fn current_catalog_schema(&self) -> Option<&Schema>
Returns the current schema of the current catalog
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Metadata
impl<'de> Deserialize<'de> for Metadata
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<Metadata, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Metadata, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Serialize for Metadata
impl Serialize for Metadata
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
Auto Trait Implementations§
impl Freeze for Metadata
impl RefUnwindSafe for Metadata
impl Send for Metadata
impl Sync for Metadata
impl Unpin for Metadata
impl UnwindSafe for Metadata
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more