ormlette/query/query

The main Query module that provides a high-level API for building SQL queries It is built on top of the Cake library to provide a more ergonomic interface, but can easily be exported to standard cake-select queries.

Types

pub type Query {
  Query(table: create.Table, select: select.Select)
}

Constructors

  • Query(table: create.Table, select: select.Select)

Functions

pub fn equals(query: Query, column: String, value: a) -> Query
pub fn export(query: Query) -> Select
pub fn from_table(table: Table) -> Query
pub fn greater_than(
  query: Query,
  column: String,
  value: a,
) -> Query
pub fn inner_join(query: Query, target_table: Table) -> Query
pub fn join(
  query: Query,
  target_table: Table,
  join_type: fn(JoinTarget, Where, String) -> Join,
) -> Query
pub fn left_join(query: Query, target_table: Table) -> Query
pub fn less_than(query: Query, column: String, value: a) -> Query
pub fn order_by(
  query: Query,
  column: String,
  direction: Direction,
) -> Query
pub fn select(query: Query, columns: List(String)) -> Query
pub fn sql(query: Query) -> #(String, List(Param))
Search Document