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

  • CakeReadQuery(ReadQuery)
  • CakeWriteQuery(WriteQuery(a))
pub type Dialect =
  dialect.Dialect
pub type PreparedStatement =
  prepared_statement.PreparedStatement
pub type ReadQuery =
  read_query.ReadQuery
pub type WriteQuery(a) =
  write_query.WriteQuery(a)

Functions

pub fn cake_query_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 cake_read_query(query qry: ReadQuery) -> CakeQuery(a)

Create a Cake query from a read query.

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

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

Create a Cake query from a write query.

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

pub fn get_params(
  prepared_statement prp_stm: PreparedStatement,
) -> List(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 write_query_to_prepared_statement(
  query qry: WriteQuery(a),
  dialect dlct: Dialect,
) -> PreparedStatement

Create a prepared statement from a write query.

Search Document