Sqlite3

`sig
exception InternalError of string
exception Error of string
exception RangeError of int * int
type db
type stmt
type header = string
type headers = Sqlite3.header array
type row = string option array
type row_not_null = string array
module Rc :
sig
type unknown
external int_of_unknown : Sqlite3.Rc.unknown -> int = "%identity"
type t =
OK
| ERROR
| INTERNAL
| PERM
| ABORT
| BUSY
| LOCKED
| NOMEM
| READONLY
| INTERRUPT
| IOERR
| CORRUPT
| NOTFOUND
| FULL
| CANTOPEN
| PROTOCOL
| EMPTY
| SCHEMA
| TOOBIG
| CONSTRAINT
| MISMATCH
| MISUSE
| NOFLS
| AUTH
| FORMAT
| RANGE
| NOTADB
| ROW
| DONE
| UNKNOWN of Sqlite3.Rc.unknown
val to_string : Sqlite3.Rc.t -> string
end
module Data :
sig
type t =
NONE
| NULL
| INT of int64
| FLOAT of float
| TEXT of string
| BLOB of string
val to_string : Sqlite3.Data.t -> string
val to_string_debug : Sqlite3.Data.t -> string
end
external db_open : string -> Sqlite3.db = "caml_sqlite3_open"
external db_close : Sqlite3.db -> bool = "caml_sqlite3_close"
external enable_load_extension : Sqlite3.db -> bool -> bool
= "caml_sqlite3_enable_load_extension" "noalloc"
external errcode : Sqlite3.db -> Sqlite3.Rc.t = "caml_sqlite3_errcode"
external errmsg : Sqlite3.db -> string = "caml_sqlite3_errmsg"
external last_insert_rowid : Sqlite3.db -> int64
= "caml_sqlite3_last_insert_rowid"
external exec :
Sqlite3.db ->
?cb:(Sqlite3.row -> Sqlite3.headers -> unit) -> string -> Sqlite3.Rc.t
= "caml_sqlite3_exec"
external exec_no_headers :
Sqlite3.db -> cb:(Sqlite3.row -> unit) -> string -> Sqlite3.Rc.t
= "caml_sqlite3_exec_no_headers"
external exec_not_null :
Sqlite3.db ->
cb:(Sqlite3.row_not_null -> Sqlite3.headers -> unit) ->
string -> Sqlite3.Rc.t = "caml_sqlite3_exec_not_null"
external exec_not_null_no_headers :
Sqlite3.db -> cb:(Sqlite3.row_not_null -> unit) -> string -> Sqlite3.Rc.t
= "caml_sqlite3_exec_not_null_no_headers"
external prepare : Sqlite3.db -> string -> Sqlite3.stmt
= "caml_sqlite3_prepare"
external prepare_tail : Sqlite3.stmt -> Sqlite3.stmt option
= "caml_sqlite3_prepare_tail"
external recompile : Sqlite3.stmt -> unit = "caml_sqlite3_recompile"
external step : Sqlite3.stmt -> Sqlite3.Rc.t = "caml_sqlite3_step"
external finalize : Sqlite3.stmt -> Sqlite3.Rc.t
= "caml_sqlite3_stmt_finalize"
external reset : Sqlite3.stmt -> Sqlite3.Rc.t = "caml_sqlite3_stmt_reset"
external expired : Sqlite3.stmt -> bool = "caml_sqlite3_expired"
external data_count : Sqlite3.stmt -> int = "caml_sqlite3_data_count"
external column_count : Sqlite3.stmt -> int = "caml_sqlite3_column_count"
external column : Sqlite3.stmt -> int -> Sqlite3.Data.t
= "caml_sqlite3_column"
external column_name : Sqlite3.stmt -> int -> Sqlite3.header
= "caml_sqlite3_column_name"
external column_decltype : Sqlite3.stmt -> int -> string option
= "caml_sqlite3_column_decltype"
external bind : Sqlite3.stmt -> int -> Sqlite3.Data.t -> Sqlite3.Rc.t
= "caml_sqlite3_bind"
external bind_parameter_count : Sqlite3.stmt -> int
= "caml_sqlite3_bind_parameter_count"
external bind_parameter_name : Sqlite3.stmt -> int -> string option
= "caml_sqlite3_bind_parameter_name"
external bind_parameter_index : Sqlite3.stmt -> string -> int
= "caml_sqlite3_bind_parameter_index"
external transfer_bindings : Sqlite3.stmt -> Sqlite3.stmt -> Sqlite3.Rc.t
= "caml_sqlite3_transfer_bindings"
val row_data : Sqlite3.stmt -> Sqlite3.Data.t array
val row_names : Sqlite3.stmt -> Sqlite3.headers
val row_decltypes : Sqlite3.stmt -> string option array
val create_funN :
Sqlite3.db -> string -> (Sqlite3.Data.t array -> Sqlite3.Data.t) -> unit
val create_fun0 : Sqlite3.db -> string -> (unit -> Sqlite3.Data.t) -> unit
val create_fun1 :
Sqlite3.db -> string -> (Sqlite3.Data.t -> Sqlite3.Data.t) -> unit
val create_fun2 :
Sqlite3.db ->
string -> (Sqlite3.Data.t -> Sqlite3.Data.t -> Sqlite3.Data.t) -> unit
val create_fun3 :
Sqlite3.db ->
string ->
(Sqlite3.Data.t -> Sqlite3.Data.t -> Sqlite3.Data.t -> Sqlite3.Data.t) ->
unit
external delete_function : Sqlite3.db -> string -> unit
= "caml_sqlite3_delete_function"
val busy_timeout : Sqlite3.db -> int -> unit
module Aggregate :
sig
val create_fun0 :
Sqlite3.db ->
string ->
init:'a -> step:('a -> 'a) -> final:('a -> Sqlite3.Data.t) -> unit
val create_fun1 :
Sqlite3.db ->
string ->
init:'a ->
step:('a -> Sqlite3.Data.t -> 'a) ->
final:('a -> Sqlite3.Data.t) -> unit
val create_fun2 :
Sqlite3.db ->
string ->
init:'a ->
step:('a -> Sqlite3.Data.t -> Sqlite3.Data.t -> 'a) ->
final:('a -> Sqlite3.Data.t) -> unit
val create_funN :
Sqlite3.db ->
string ->
init:'a ->
step:('a -> Sqlite3.Data.t array -> 'a) ->
final:('a -> Sqlite3.Data.t) -> unit
end
end`