cake/adapter/maria
🎂Cake 🦭MariaDB adapter which passes PreparedStatements
to the shork library for execution.
Values
pub fn execute_raw_sql(
sql_string sql_string: String,
db_connection on: shork.Connection,
) -> Result(shork.Returned(Nil), shork.QueryError)
pub fn read_query_to_prepared_statement(
query query: cake.ReadQuery,
) -> cake.PreparedStatement
Convert a Cake ReadQuery to a PreparedStatement.
pub fn run_query(
query query: cake.CakeQuery(a),
decoder decoder: decode.Decoder(a),
db_connection db_connection: shork.Connection,
) -> Result(List(a), shork.QueryError)
Run a Cake CakeQuery against an MariaDB database.
This function is a wrapper around run_read_query and run_write_query.
pub fn run_read_query(
query query: cake.ReadQuery,
decoder decoder: decode.Decoder(a),
db_connection on: shork.Connection,
) -> Result(List(a), shork.QueryError)
pub fn run_write_query(
query query: cake.WriteQuery(a),
decoder decoder: decode.Decoder(b),
db_connection on: shork.Connection,
) -> Result(List(b), shork.QueryError)
Run a Cake WriteQuery against an MariaDB database.
pub fn with_connection(
host host: String,
port port: Int,
username username: option.Option(String),
password password: String,
database database: String,
callback callback: fn(shork.Connection) -> a,
) -> a
Connection to a MariaDB database.
This is a thin wrapper around the shork library’s Connection type.
pub fn write_query_to_prepared_statement(
query query: cake.WriteQuery(a),
) -> cake.PreparedStatement
Convert a Cake WriteQuery to a PreparedStatement.