withDB : Has SqlError es => String -> (DB => App es a) -> App es a Open a connection to the given database and use it to
run the given effectful computation.
This comes with the guarantees that the connection is properly
closed at the end.
Totality: total
Visibility: exportwithStmt : Has SqlError es => DB => String -> (Stmt => App es a) -> App es a Prepare an SQL statement and use it to run the given effectful computation.
This comes with the guarantees that the statement is properly
finalized at the end.
Totality: total
Visibility: exportbindParams : Has SqlError es => DB => Stmt => List Parameter -> App es () Prepare an SQL statement and use it to run the given effectful computation.
This comes with the guarantees that the statement is properly
finalized at the end.
This works just like `withStmt` but it also bind the given arguments.
Totality: total
Visibility: exportwithBoundStmt : Has SqlError es => DB => ParamStmt -> (Stmt => App es a) -> App es a Prepare an SQL statement and use it to run the given effectful computation.
This comes with the guarantees that the statement is properly
finalized at the end.
This works just like `withStmt` but it also bind the given arguments.
Totality: total
Visibility: exportstep : Has SqlError es => Stmt => App es SqlResult Runs an SQL statement, returning the response from the database.
Totality: total
Visibility: exportcommit : Has SqlError es => DB => ParamStmt -> App es () Prepares, executes and finalizes the given SQL statement.
The statement may hold a list of parameters, which will be
bound prior to executing the statement.
Totality: total
Visibility: exportselectRows : Has SqlError es => DB => FromRow a => ParamStmt -> Nat -> App es (List a) Prepares and executes the given SQL query and extracts up to
`n` rows of results.
Totality: total
Visibility: exportselectRow : Has SqlError es => DB => FromRow a => ParamStmt -> App es a Prepares and executes the given SQL query and extracts the
first result.
Totality: total
Visibility: exportfindRow : Has SqlError es => DB => FromRow a => ParamStmt -> App es (Maybe a) Prepares and executes the given SQL query and extracts the
first result (if any).
Totality: total
Visibility: exportcmd : Has SqlError es => DB => Cmd t -> App es () Executes the given SQL command.
Totality: total
Visibility: exportcmds : Has SqlError es => DB => Cmds -> App es () Runs several commands in a single transaction.
If any of the commands fails, the whole transaction is rolled back.
Totality: total
Visibility: exportquery : Has SqlError es => DB => Query t -> Nat -> App es (List t) Runs the given query and accumulates at most `n` rows.
Totality: total
Visibility: exportqueryTable : Has SqlError es => DB => {auto tr : ToRow t} -> (q : Query t) -> {auto 0 _ : ToRowTypes t = FromRowTypes t} -> Nat -> App es (Table t) Runs the given query and accumulates at most `n` rows.
The result is stored in a `Table` with a proper header of
column names.
Totality: total
Visibility: export