Idris2Doc : FS.Sqlite3

FS.Sqlite3

(source)

Reexports

import public Sqlite3
import public FS

Definitions

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: export
withStmt : 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: export
bindParams : 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: export
openBoundStmt : 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: export
step : Has SqlError es => Stmt => Async e es SqlResult
  Runs an SQL statement, returning the response from the database.

Totality: total
Visibility: export
commit : 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: export
selectRows : 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: export
selectRow : 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: export
findRow : 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: export
rows : 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: export
cmds : 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: export
query : 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: export
query1 : 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: export
queryRows : Has SqlError es => ChunkSize => DB => Query t -> AsyncStream e es (List t)
  Streams the rows resulting from running the given query.

Totality: total
Visibility: export
queryTable : 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