pub struct TableChain<S> { /* private fields */ }Expand description
A table reference under construction: the table plus every decoration MySQL’s
table_factor allows.
tbl_name [PARTITION (partition_names)] [[AS] alias] [index_hint_list]
[LATERAL] table_subquery [AS] alias [(col_list)]Implementations§
Source§impl<S> TableChain<S>
impl<S> TableChain<S>
Sourcepub fn columns(
self,
columns: impl IntoIterator<Item = impl Into<Cow<'static, str>>>,
) -> TableChain<S>
pub fn columns( self, columns: impl IntoIterator<Item = impl Into<Cow<'static, str>>>, ) -> TableChain<S>
Column aliases: AS \t` (`a`, `b`), which MySQL 8.0.19 allows on a derived table. For an INSERTorREPLACE` this is the column list instead.
Sourcepub fn lateral(self) -> TableChain<S>
pub fn lateral(self) -> TableChain<S>
LATERAL — let a derived table refer to columns of the items before it
(MySQL 8.0.14).
Only grammatical in front of a derived table; on a bare table or CTE
name this records a build() error instead, because
FROM LATERAL `posts` is a syntax error with nothing to mean.
Sourcepub fn partition(
self,
partitions: impl IntoIterator<Item = impl Into<Cow<'static, str>>>,
) -> TableChain<S>
pub fn partition( self, partitions: impl IntoIterator<Item = impl Into<Cow<'static, str>>>, ) -> TableChain<S>
PARTITION (\p0`, `p1`)` — read only these partitions.
Sourcepub fn use_index(
self,
indexes: impl IntoIterator<Item = impl Into<Cow<'static, str>>>,
) -> TableChain<S>
pub fn use_index( self, indexes: impl IntoIterator<Item = impl Into<Cow<'static, str>>>, ) -> TableChain<S>
USE INDEX (…) — consider only these indexes. An empty list is meaningful:
USE INDEX () tells MySQL to use none.
Sourcepub fn ignore_index(
self,
indexes: impl IntoIterator<Item = impl Into<Cow<'static, str>>>,
) -> TableChain<S>
pub fn ignore_index( self, indexes: impl IntoIterator<Item = impl Into<Cow<'static, str>>>, ) -> TableChain<S>
IGNORE INDEX (…) — do not consider these indexes.
Sourcepub fn force_index(
self,
indexes: impl IntoIterator<Item = impl Into<Cow<'static, str>>>,
) -> TableChain<S>
pub fn force_index( self, indexes: impl IntoIterator<Item = impl Into<Cow<'static, str>>>, ) -> TableChain<S>
FORCE INDEX (…) — a table scan is not acceptable.
Sourcepub fn for_join(self) -> TableChain<S>
pub fn for_join(self) -> TableChain<S>
FOR JOIN on the hint just added.
Ignored if no hint has been added: a scope with nothing to scope means
nothing, and FOR JOIN is not a clause of its own.
Sourcepub fn for_order_by(self) -> TableChain<S>
pub fn for_order_by(self) -> TableChain<S>
FOR ORDER BY on the hint just added.
Sourcepub fn for_group_by(self) -> TableChain<S>
pub fn for_group_by(self) -> TableChain<S>
FOR GROUP BY on the hint just added.
Source§impl TableChain<ExtraSlot>
impl TableChain<ExtraSlot>
Sourcepub fn join(self, join: impl Into<Join>) -> TableChain<ExtraSlot>
pub fn join(self, join: impl Into<Join>) -> TableChain<ExtraSlot>
A join hanging off this comma-separated table reference rather than
off the leading one: FROM `a`, `b` INNER JOIN `c` ON ….
Grammatical because 15.2.15.2 JOIN Clause reads
table_references: escaped_table_reference [, escaped_table_reference] …
and each table_reference — not just the first — may be a
joined_table. The comma has lower precedence than the join keywords
(the manual says so under the same section), so b INNER JOIN c is one
list entry and the join’s left operand is this item alone. Takes
the same JoinChain/PlainJoinChain the standalone join mods are —
those reach the leading item through HasJoins, which is why the
extra items take theirs by method instead. Several calls chain several
joins onto this item.
Trait Implementations§
Source§impl<S: Clone> Clone for TableChain<S>
impl<S: Clone> Clone for TableChain<S>
Source§fn clone(&self) -> TableChain<S>
fn clone(&self) -> TableChain<S>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more