Module IBase.SqliteUtils
exceptionError of stringThe functions in this module tend to raise more often than their counterparts in
Sqlite3. In particular, they may raise if theSqlite3.Rc.tresult of certain operations is unexpected.
val check_result_code : Sqlite3.db -> log:string -> Sqlite3.Rc.t -> unitAssert that the result is either
Sqlite3.Rc.OKorSqlite3.Rc.ROW. If the result is not valid, raiseError.
val exec : Sqlite3.db -> log:string -> stmt:string -> unitExecute the given Sqlite
stmtand check the result withcheck_result_code.
val finalize : Sqlite3.db -> log:string -> Sqlite3.stmt -> unitFinalize the given
stmt. RaisesErroron failure.
val result_fold_rows : ?finalize:bool -> Sqlite3.db -> log:string -> Sqlite3.stmt -> init:'a -> f:('a -> Sqlite3.stmt -> 'a) -> 'aFold
fover each row of the result.fmust not access the database.
val result_fold_single_column_rows : ?finalize:bool -> Sqlite3.db -> log:string -> Sqlite3.stmt -> init:'b -> f:('b -> Sqlite3.Data.t -> 'b) -> 'bLike
result_fold_rowsbut pass column 0 of each row in the results tof.
val result_option : ?finalize:bool -> Sqlite3.db -> log:string -> read_row:(Sqlite3.stmt -> 'a) -> Sqlite3.stmt -> 'a optionSame as
result_fold_rowsbut asserts that at most one row is returned.
val result_single_column_option : ?finalize:bool -> Sqlite3.db -> log:string -> Sqlite3.stmt -> Sqlite3.Data.t optionSame as
result_fold_single_column_rowsbut asserts that at most one row is returned.
val result_unit : ?finalize:bool -> Sqlite3.db -> log:string -> Sqlite3.stmt -> unitSame as
result_fold_rowsbut asserts that no row is returned.
val db_close : Sqlite3.db -> unitClose the given database and asserts that it was effective. Raises
Errorif not.
module type Data = sig ... endAn API commonly needed to store and retrieve objects from the database
module MarshalledDataNOTForComparison : functor (D : sig ... end) -> Data with type t = D.tA default implementation of the Data API that encodes every objects as marshalled blobs
module MarshalledNullableDataNOTForComparison : functor (D : sig ... end) -> Data with type t = D.t optionA default implementation of the Data API that encodes None as a NULL SQLite value