cake/adapter/sqlite
🎂Cake 🪶SQLite adapter which passes PreparedStatements
to the sqlight library for execution.
Values
pub fn execute_raw_sql(
sql_string sql_string: String,
db_connection db_connection: sqlight.Connection,
) -> Result(Nil, sqlight.Error)
Execute a raw SQL query against an SQLite database.
pub fn read_query_to_prepared_statement(
query query: delete.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: sqlight.Connection,
) -> Result(List(a), sqlight.Error)
Run a Cake CakeQuery against an SQLite database.
This function is a wrapper around run_read_query and run_write_query.
pub fn run_read_query(
query query: delete.ReadQuery,
decoder decoder: decode.Decoder(a),
db_connection db_connection: sqlight.Connection,
) -> Result(List(a), sqlight.Error)
Run a Cake ReadQuery against an SQLite database.
pub fn run_write_query(
query query: delete.WriteQuery(a),
decoder decoder: decode.Decoder(b),
db_connection db_connection: sqlight.Connection,
) -> Result(List(b), sqlight.Error)
Run a Cake WriteQuery against an SQLite database.
pub fn with_connection(
filename filename: String,
callback callback: fn(sqlight.Connection) -> a,
) -> a
Connection to a SQLite database.
This is a thin wrapper around the sqlight library’s Connection type.
pub fn with_memory_connection(
callback callback: fn(sqlight.Connection) -> a,
) -> a
Connection to an in-memory SQLite database.
This is a thin wrapper around the sqlight library’s Connection type.
pub fn write_query_to_prepared_statement(
query query: delete.WriteQuery(t),
) -> cake.PreparedStatement
Convert a Cake WriteQuery to a PreparedStatement.