cake

Cake is an SQL query building library for RDBMS:

For examples see the tests.

Types

Base wrapper query type to be able to pass around read and write queries in the same way.

pub type CakeQuery(a) {
  CakeReadQuery(ReadQuery)
  CakeWriteQuery(WriteQuery(a))
}

Constructors

pub type Dialect =
  @internal Dialect
pub type PreparedStatement =
  @internal PreparedStatement
pub type ReadQuery =
  @internal ReadQuery
pub type WriteQuery(a) =
  @internal WriteQuery(a)

Values

pub fn get_params(
  prepared_statement prp_stm: PreparedStatement,
) -> List(param.Param)

Get the parameters of the prepared statement.

pub fn get_sql(
  prepared_statement prp_stm: PreparedStatement,
) -> String

Get the SQL of the prepared statement.

pub fn main() -> Nil

As a library Cake cannot be invoked directly in a meaningful way.

pub fn read_query_to_prepared_statement(
  query qry: ReadQuery,
  dialect dlct: Dialect,
) -> PreparedStatement

Create a prepared statement from a read query.

pub fn to_prepared_statement(
  query qry: CakeQuery(a),
  dialect dlct: Dialect,
) -> PreparedStatement

Create a prepared statement from a Cake query.

Also see cake/dialect/* for dialect specific implementations of this.

pub fn to_read_query(query qry: ReadQuery) -> CakeQuery(a)

Create a Cake read query from a read query.

Also see cake/dialect/* for dialect specific implementations of this.

pub fn to_write_query(query qry: WriteQuery(a)) -> CakeQuery(a)

Create a Cake write query from a write query.

Also see cake/dialect/* for dialect specific implementations of this.

pub fn write_query_to_prepared_statement(
  query qry: WriteQuery(a),
  dialect dlct: Dialect,
) -> PreparedStatement

Create a prepared statement from a write query.

Search Document