package sqlexpr

  1. Overview
  2. Docs
type 'a result
type (!'a, !'b) statement = {
  1. sql_statement : string;
  2. stmt_id : string option;
  3. directive : (st -> 'b) -> st -> 'a;
}
type (!'a, !'b, !'c) expression = {
  1. statement : ('a, 'c) statement;
  2. get_data : int * (Sqlite3.Data.t array -> 'b);
}
type db
exception Error of string * exn
exception Sqlite_error of string * Sqlite3.Rc.t
val open_db : ?init:(Sqlite3.db -> unit) -> string -> db
val close_db : db -> unit
val borrow_worker : db -> (db -> 'a result) -> 'a result
val steal_worker : db -> (db -> 'a result) -> 'a result
val execute : db -> ('a, unit result) statement -> 'a
val insert : db -> ('a, int64 result) statement -> 'a
val select : db -> ('c, 'a, 'a list result) expression -> 'c
val select_f : db -> ('a -> 'b result) -> ('c, 'a, 'b list result) expression -> 'c
val select_one : db -> ('c, 'a, 'a result) expression -> 'c
val select_one_maybe : db -> ('c, 'a, 'a option result) expression -> 'c
val select_one_f : db -> ('a -> 'b result) -> ('c, 'a, 'b result) expression -> 'c
val select_one_f_maybe : db -> ('a -> 'b result) -> ('c, 'a, 'b option result) expression -> 'c
val transaction : db -> ?kind:[ `DEFERRED | `EXCLUSIVE | `IMMEDIATE ] -> (db -> 'a result) -> 'a result
val fold : db -> ('a -> 'b -> 'a result) -> 'a -> ('c, 'b, 'a result) expression -> 'c
val iter : db -> ('a -> unit result) -> ('b, 'a, unit result) expression -> 'b
module Directives : sig ... end
module Conversion : sig ... end
OCaml

Innovation. Community. Security.