cake

Cake is an SQL query building library for RDBMS:

For examples see the tests.

Types

Wrapper type to be able to pass around read and write queries at the same time.

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

Constructors

  • CakeReadQuery(Query)
  • CakeWriteQuery(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: Query) -> 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 query_to_prepared_statement(
  query qry: Query,
  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