openSqlite : Has SqlError es => String -> Async e es DB- Totality: total
Visibility: export openStmt : Has SqlError es => DB => String -> Async e es Stmt- Totality: total
Visibility: export withDB : Has SqlError es => String -> (DB => Async e es a) -> Async e 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 => Async e es a) -> Async e 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 -> Async e 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.
Totality: total
Visibility: exportopenBoundStmt : Has SqlError es => DB => ParamStmt -> Async e es Stmt- Totality: total
Visibility: export withBoundStmt : Has SqlError es => DB => ParamStmt -> (Stmt => Async e es a) -> Async e 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 => Async e es SqlResult Runs an SQL statement, returning the response from the database.
Totality: total
Visibility: exportcommit : Has SqlError es => DB => ParamStmt -> Async e 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 -> Async e 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 -> Async e 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 -> Async e es (Maybe a) Prepares and executes the given SQL query and extracts the
first result (if any).
Totality: total
Visibility: exportrows : Has SqlError es => ChunkSize => DB => FromRow a => ParamStmt -> AsyncStream e es (List a)- Totality: total
Visibility: export cmd : Has SqlError es => DB => Cmd t -> Async e es () Executes the given SQL command.
Totality: total
Visibility: exportcmds : Has SqlError es => DB => Cmds -> Async e 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 -> Async e es (List t) Runs the given query and accumulates at most `n` rows.
Totality: total
Visibility: exportquery1 : Has SqlError es => DB => Query t -> Async e es (Maybe t) Runs the given query and returns the first result (if any).
Totality: total
Visibility: exportqueryRows : Has SqlError es => ChunkSize => DB => Query t -> AsyncStream e es (List t) Streams the rows resulting from running the given query.
Totality: total
Visibility: exportqueryTable : Has SqlError es => DB => {auto tr : ToRow t} -> (q : Query t) -> {auto 0 _ : ToRowTypes t = FromRowTypes t} -> Nat -> Async e 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