Skip to main content

JoinArg

Trait JoinArg 

Source
pub trait JoinArg<'a, FromTable, Via> {
    type JoinedTable;
    type OnSources;

    // Required method
    fn into_join_sql(self, join: Join) -> SQL<'a, PostgresValue<'a>>;
}
Expand description

Trait for arguments accepted by .join() and related join methods.

Via is inferred: which table’s foreign key a bare table joins on (JoinKey), or JoinExplicit for a condition.

Required Associated Types§

Source

type JoinedTable

Table added to the query scope by this join.

Source

type OnSources

Sources read by the ON condition (see drizzle_core::scope).

Required Methods§

Source

fn into_join_sql(self, join: Join) -> SQL<'a, PostgresValue<'a>>

Renders the join source and its ON condition.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl<'a, U, C, T> JoinArg<'a, T, JoinExplicit> for (U, C)
where U: JoinSource<'a>, C: ToSQL<'a, PostgresValue<'a>> + ExprSources,

Tuple (table, condition): explicit ON condition.

Source§

type JoinedTable = <U as JoinSource<'a>>::JoinedTable

Source§

type OnSources = <C as ExprSources>::Sources

Source§

fn into_join_sql(self, join: Join) -> SQL<'a, PostgresValue<'a>>

Implementors§

Source§

impl<'a, U, T, Via> JoinArg<'a, T, Via> for U
where U: PostgresTable<'a> + JoinKey<T, Via>, T: SQLTableInfo + Default,

Bare table: the ON condition matches the columns of the one foreign key between the two tables, whichever declares it.