Enum datafusion_sql::TableReference
source · 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
An unqualified table reference, e.g. “table”
Partial
A partially resolved table reference, e.g. “schema.table”
Full
Fields
A fully resolved table reference, e.g. “catalog.schema.table”
Implementations§
source§impl<'a> TableReference<'a>
impl<'a> TableReference<'a>
sourcepub fn resolve(
self,
default_catalog: &'a str,
default_schema: &'a str
) -> ResolvedTableReference<'a>
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
sourcepub fn parse_str(s: &'a str) -> TableReference<'a>
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>
impl<'a> Clone for TableReference<'a>
source§fn clone(&self) -> TableReference<'a>
fn clone(&self) -> TableReference<'a>
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moresource§impl<'a> Debug for TableReference<'a>
impl<'a> Debug for TableReference<'a>
source§impl<'a> From<&'a OwnedTableReference> for TableReference<'a>
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>
fn from(r: &'a OwnedTableReference) -> TableReference<'a>
source§impl<'a> From<&'a str> for TableReference<'a>
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>
fn from(s: &'a str) -> TableReference<'a>
source§impl<'a> From<ResolvedTableReference<'a>> for TableReference<'a>
impl<'a> From<ResolvedTableReference<'a>> for TableReference<'a>
source§fn from(resolved: ResolvedTableReference<'a>) -> TableReference<'a>
fn from(resolved: ResolvedTableReference<'a>) -> TableReference<'a>
source§impl<'a> PartialEq<TableReference<'a>> for TableReference<'a>
impl<'a> PartialEq<TableReference<'a>> for TableReference<'a>
source§fn eq(&self, other: &TableReference<'a>) -> bool
fn eq(&self, other: &TableReference<'a>) -> bool
self and other values to be equal, and is used
by ==.