add prepare0

This commit is contained in:
Peter McGoron 2022-04-28 20:16:09 -04:00
parent af24722b2e
commit 82a184b745
2 changed files with 4 additions and 0 deletions

View File

@ -55,6 +55,7 @@ let prepare_keep keep db stmt v =
try Norm (v,(keep, S.prepare db stmt)) with
_ -> Failed Rc.ERROR
let prepare db s v = prepare_keep false db s v
let prepare0 db s = prepare db s ()
let reprepare db stmt (v,(b,s)) =
let x = if not b then S.finalize s
else Rc.OK

View File

@ -102,6 +102,9 @@ val prepare : Sqlite3.db -> string -> 'a -> 'a stmt_m
the statement in [s].
*)
val prepare0 : Sqlite3.db -> string -> unit stmt_m
(** [prepare0 db stmt] is equivalent to [prepare db stmt ()]. *)
val prepare_keep : bool -> Sqlite3.db -> string -> 'a -> 'a stmt_m
(** [prepare_keep b] is like [prepare], but [b] is the preserve-on-failure
file.