package current

  1. Overview
  2. Docs
type t = Sqlite3.db
val v : t Lazy.t

An sqlite database stored in state_dir "db".

val exec : Sqlite3.stmt -> Sqlite3.Data.t list -> unit

exec stmt values executes stmt values. Raises an exception on error.

val query : Sqlite3.stmt -> Sqlite3.Data.t list -> Sqlite3.Data.t list list

query stmt values executes the SQL query stmt values and returns the resulting rows.

val query_one : Sqlite3.stmt -> Sqlite3.Data.t list -> Sqlite3.Data.t list

query_one stmt values executes the SQL query stmt values and returns the single resulting row. Raises an exception if there are no results or multiple results.

val query_some : Sqlite3.stmt -> Sqlite3.Data.t list -> Sqlite3.Data.t list option

query_some stmt values executes the SQL query stmt values and returns the single resulting row, or None if there are no results. Raises an exception if there are multiple results.

val exec_literal : t -> string -> unit

exec_literal t sql executes sql on t. Raises an exception on error.

val dump_row : Sqlite3.Data.t list Fmt.t

Useful for debugging.

OCaml

Innovation. Community. Security.