cake/join

Functions to build JOIN clauses of SQL queries.

Tables, views and sub-queries can be joined together.

Supported join kinds

You can also build following joins using the provided query builder functions:

Functions

pub fn cross(with wth: JoinTarget, alias als: String) -> Join

Creates a CROSS JOIN.

Also called cartesian product.

pub fn full(
  with wth: JoinTarget,
  on on: Where,
  alias als: String,
) -> Join

Creates a FULL JOIN.

Also called FULL OUTER JOIN.

Inclusive by default.

Set on to WHERE a.key IS NULL OR b.key IS NULL to make it exclusive.

pub fn inner(
  with wth: JoinTarget,
  on on: Where,
  alias als: String,
) -> Join

Create an INNER JOIN.

pub fn left(
  with wth: JoinTarget,
  on on: Where,
  alias als: String,
) -> Join

Creates a LEFT JOIN.

Also called LEFT OUTER JOIN.

Inclusive by default.

Set on to WHERE a.key IS NULL to make it exclusive.

pub fn right(
  with wth: JoinTarget,
  on on: Where,
  alias als: String,
) -> Join

Creates a RIGHT JOIN.

Also called RIGHT OUTER JOIN.

Inclusive by default.

Set on to WHERE b.key IS NULL to make it exclusive.

pub fn sub_query(sub_query sq: Query) -> JoinTarget

Create a JOIN target from a sub-query.

pub fn table(table_name tbl_nm: String) -> JoinTarget

Create a JOIN target from a table name.

Search Document