Skip to main content

CatalogTable

Struct CatalogTable 

Source
pub struct CatalogTable { /* private fields */ }
Expand description

One table registered in a Catalog: a (catalog?, schema?, name) identity plus its column names.

name is mandatory; schema and catalog are optional — a bare table (e.g. from unqualified DDL) has neither, and engines without a catalog layer omit the catalog. An omitted segment matches any query value there (right-anchored, the same wildcard rule a query reference gets for its own omitted qualifiers), so a schema-less users matches both a bare users and a qualified public.users. Identifiers are stored verbatim; a present segment compares exactly (folding only under case-insensitive dialects — see the module docs). columns may be empty when the table is known but its columns aren’t.

Implementations§

Source§

impl CatalogTable

Source

pub fn new(schema: impl Into<String>, name: impl Into<String>) -> Self

A table identified by schema.name, with no columns yet and no catalog segment. Add columns with Self::columns and a catalog with Self::catalog.

Source

pub fn unqualified(name: impl Into<String>) -> Self

A table with no schema (e.g. from unqualified DDL). The omitted schema is a wildcard, so it matches a query by name alone — bare users and qualified public.users both match. Add columns with Self::columns.

Source

pub fn catalog(self, catalog: impl Into<String>) -> Self

Set the catalog segment (for engines with a catalog layer).

Source

pub fn columns<I, S>(self, columns: I) -> Self
where I: IntoIterator<Item = S>, S: Into<String>,

Set the column names. Replaces any previously set columns.

Trait Implementations§

Source§

impl Clone for CatalogTable

Source§

fn clone(&self) -> CatalogTable

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for CatalogTable

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for CatalogTable

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for CatalogTable

Source§

impl FromIterator<CatalogTable> for Catalog

Source§

fn from_iter<I: IntoIterator<Item = CatalogTable>>(iter: I) -> Self

Creates a value from an iterator. Read more
Source§

impl PartialEq for CatalogTable

Source§

fn eq(&self, other: &CatalogTable) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for CatalogTable

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.