diff options
| author | 2021-10-16 13:40:43 -0400 | |
|---|---|---|
| committer | 2021-10-16 13:40:43 -0400 | |
| commit | af24722b2e0fbfcc10c4ff81801a409898362cc5 (patch) | |
| tree | fc4726ea78bb6fc4d5dffe3418e38c4cbb284389 /src/letsqlite.ml | |
| parent | add a boolean to the monad to be more flexible with error management (diff) | |
add check function
Diffstat (limited to 'src/letsqlite.ml')
| -rw-r--r-- | src/letsqlite.ml | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/letsqlite.ml b/src/letsqlite.ml index 83bf0c6..c34b9c5 100644 --- a/src/letsqlite.ml +++ b/src/letsqlite.ml @@ -125,6 +125,10 @@ let finalize = function Rc.check (S.finalize s); v ) +let check s = match s with +| Failed e -> raise (S.SqliteError (Rc.to_string e)) +| Norm (v,_) -> (v,s) + let exec db s = prepare db s () >>$ step let reexec db s = reprepare db s @>$ step let bsrc l = bind_values l @>$ step @>$ reset @>$ clear_bindings |
