pub struct TableChain<S> { /* private fields */ }Expand description
A table-or-subquery — or a qualified-table-name — under construction.
[ schema. ] table-name [ AS alias ] [ INDEXED BY index-name | NOT INDEXED ]
[ schema. ] table-function ( expr [, ...] ) [ AS alias ]
( select-stmt ) [ AS alias ]That is the whole list of decorations SQLite allows on a from-item, and it is
shorter than PostgreSQL’s by everything: no ONLY, no LATERAL, no
WITH ORDINALITY, no TABLESAMPLE, and no column-alias list — t (a, b)
is PostgreSQL’s, and SQLite has only AS alias. A table-valued function needs
no mod of its own either, because a call is already an expression:
from(f("pragma_table_info", s("users"))).
Implementations§
Source§impl<S> TableChain<S>
impl<S> TableChain<S>
Sourcepub fn indexed_by(self, name: impl Into<Cow<'static, str>>) -> TableChain<S>
pub fn indexed_by(self, name: impl Into<Cow<'static, str>>) -> TableChain<S>
INDEXED BY "name" — refuse to plan this item any other way.
A tuning hint that SQLite treats as a hard constraint: it is an error if the named index cannot be used. Applies to a table name, not to a sub-query or a table-valued function.
Sourcepub fn not_indexed(self) -> TableChain<S>
pub fn not_indexed(self) -> TableChain<S>
NOT INDEXED — plan this item without any index the planner would otherwise
have chosen.
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 written after this comma-separated item rather than after the
leading one: FROM "a", "b" INNER JOIN "c" ON ….
Grammatical because the comma is one of SQLite’s join operators:
parse.y reads the whole FROM as one chain — seltablist ::= stl_prefix nm …, stl_prefix ::= seltablist joinop, and
joinop ::= COMMA|JOIN — so a JOIN may follow a comma item. One
honest caveat, and it is SQLite’s, not this method’s: the operators are
processed left to right with no precedence, so the join’s left operand
is everything before it in the list, not this item alone — unlike
PostgreSQL and MySQL, where the join binds tighter than the comma.
Takes the same JoinChain 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.
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