glitr/convert/cake

Functions

pub fn cake_decode(
  converter: Converter(a),
) -> fn(Dynamic) -> Result(a, List(DecodeError))

Decode a Dynamic value from a database row using the provided converter.

pub fn cake_insert(
  value: Insert(a),
  converter: Converter(a),
  values: List(a),
) -> Insert(a)

Sets the columns and values of the Insert using the converter and the provided values. If the converter isn’t an Object converter, the value is left unchanged. This is because we don’t have information about the fields/columns names otherwise.

pub fn cake_select_fields(
  value: Select,
  converter: Converter(a),
) -> Select

Sets the selected colums of the Select using the converter. If the converter isn’t an Object converter, the value is left unchanged. This is because we don’t have information about the fields/columns names otherwise.

pub fn cake_update(
  value: Update(a),
  converter: Converter(a),
  update: a,
) -> Update(a)

Sets the column sets of the Update using the converter and the provided value. If the converter isn’t an Object converter, the value is left unchanged. This is because we don’t have information about the fields/columns names otherwise.

Search Document