pub enum TableReference<'a> {
    Bare {
        table: Cow<'a, str>,
    },
    Partial {
        schema: Cow<'a, str>,
        table: Cow<'a, str>,
    },
    Full {
        catalog: Cow<'a, str>,
        schema: Cow<'a, str>,
        table: Cow<'a, str>,
    },
}
Expand description

Represents a path to a table that may require further resolution

Variants§

§

Bare

Fields

§table: Cow<'a, str>

The table name

An unqualified table reference, e.g. “table”

§

Partial

Fields

§schema: Cow<'a, str>

The schema containing the table

§table: Cow<'a, str>

The table name

A partially resolved table reference, e.g. “schema.table”

§

Full

Fields

§catalog: Cow<'a, str>

The catalog (aka database) containing the table

§schema: Cow<'a, str>

The schema containing the table

§table: Cow<'a, str>

The table name

A fully resolved table reference, e.g. “catalog.schema.table”

Implementations§

source§

impl<'a> TableReference<'a>

source

pub fn table(&self) -> &str

Retrieve the actual table name, regardless of qualification

source

pub fn resolve( self, default_catalog: &'a str, default_schema: &'a str ) -> ResolvedTableReference<'a>

Given a default catalog and schema, ensure this table reference is fully resolved

source

pub fn parse_str(s: &'a str) -> TableReference<'a>

Forms a TableReference by attempting to parse s as a multipart identifier, failing that then taking the entire unnormalized input as the identifier itself.

Will normalize (convert to lowercase) any unquoted identifiers.

e.g. Foo will be parsed as foo, and "Foo"".bar" will be parsed as Foo".bar (note the preserved case and requiring two double quotes to represent a single double quote in the identifier)

Trait Implementations§

source§

impl<'a> Clone for TableReference<'a>

source§

fn clone(&self) -> TableReference<'a>

Returns a copy of the value. Read more
1.0.0 · source§

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

Performs copy-assignment from source. Read more
source§

impl<'a> Debug for TableReference<'a>

source§

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

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

impl<'a> From<&'a OwnedTableReference> for TableReference<'a>

Convert OwnedTableReference into a TableReference. Somewhat awkward to use but ‘idiomatic’: (&table_ref).into()

source§

fn from(r: &'a OwnedTableReference) -> TableReference<'a>

Converts to this type from the input type.
source§

impl<'a> From<&'a str> for TableReference<'a>

Parse a string into a TableReference, normalizing where appropriate

See full details on TableReference::parse_str

source§

fn from(s: &'a str) -> TableReference<'a>

Converts to this type from the input type.
source§

impl<'a> From<ResolvedTableReference<'a>> for TableReference<'a>

source§

fn from(resolved: ResolvedTableReference<'a>) -> TableReference<'a>

Converts to this type from the input type.
source§

impl<'a> PartialEq<TableReference<'a>> for TableReference<'a>

source§

fn eq(&self, other: &TableReference<'a>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<'a> Eq for TableReference<'a>

source§

impl<'a> StructuralEq for TableReference<'a>

source§

impl<'a> StructuralPartialEq for TableReference<'a>

Auto Trait Implementations§

§

impl<'a> RefUnwindSafe for TableReference<'a>

§

impl<'a> Send for TableReference<'a>

§

impl<'a> Sync for TableReference<'a>

§

impl<'a> Unpin for TableReference<'a>

§

impl<'a> UnwindSafe for TableReference<'a>

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

const: unstable · source§

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

Mutably borrows from an owned value. Read more
§

impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

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

const: unstable · 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 Twhere T: Clone,

§

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, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

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

Performs the conversion.
source§

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

§

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

The type returned in the event of a conversion error.
const: unstable · source§

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

Performs the conversion.
§

impl<T> Allocation for Twhere T: RefUnwindSafe + Send + Sync,