You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
2 lines
6.2 KiB
2 lines
6.2 KiB
<!DOCTYPE html>
|
|
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>InferBase__SqliteUtils (InferBase.InferBase__SqliteUtils)</title><link rel="stylesheet" href="../../odoc.css"/><meta charset="utf-8"/><meta name="viewport" content="width=device-width,initial-scale=1.0"/><meta name="generator" content="doc-ock-html v1.0.0-1-g1fc9bf0"/></head><body><nav id="top"><a href="../index.html">Up</a> — <span class="package">package <a href="../index.html">InferBase</a></span></nav><header><h1><span class="keyword">Module</span> <span class="module-path">InferBase__SqliteUtils</span></h1></header><div class="spec exception" id="exception-Error"><a href="#exception-Error" class="anchor"></a><div class="def exception"><code><span class="keyword">exception </span></code><code><span class="exception">Error</span><span class="keyword"> of </span>string</code></div><div class="doc"><p>The functions in this module tend to raise more often than their counterparts in <code class="code">Sqlite3</code>. In particular, they may raise if the <code class="code">Sqlite3.Rc.t</code> result of certain operations is unexpected.</p></div></div><div class="spec val" id="val-check_sqlite_error"><a href="#val-check_sqlite_error" class="anchor"></a><div class="def val"><code><span class="keyword">val </span>check_sqlite_error : ?⁠fatal:bool <span class="keyword">‑></span> Sqlite3.db <span class="keyword">‑></span> log:string <span class="keyword">‑></span> Sqlite3.Rc.t <span class="keyword">‑></span> unit</code></div><div class="doc"><p>Assert that the result is either <code class="code">Sqlite3.Rc.OK</code>. If <code class="code">row_is_ok</code> then <code class="code">Sqlite3.Rc.ROW</code> is also accepted. If the result is not valid, then if <code class="code">fatal</code> is set raise <code class="code">Error</code>, otherwise log the error and proceed.</p></div></div><div class="spec val" id="val-exec"><a href="#val-exec" class="anchor"></a><div class="def val"><code><span class="keyword">val </span>exec : Sqlite3.db <span class="keyword">‑></span> log:string <span class="keyword">‑></span> stmt:string <span class="keyword">‑></span> unit</code></div><div class="doc"><p>Execute the given Sqlite <code class="code">stmt</code> and asserts that it resulted in <code class="code">Sqlite3.Rc.OK</code>. Otherwise, fail similarly to <code class="code">check_sqlite_error ~fatal:true</code>.</p></div></div><div class="spec val" id="val-finalize"><a href="#val-finalize" class="anchor"></a><div class="def val"><code><span class="keyword">val </span>finalize : Sqlite3.db <span class="keyword">‑></span> log:string <span class="keyword">‑></span> Sqlite3.stmt <span class="keyword">‑></span> unit</code></div><div class="doc"><p>Finalize the given <code class="code">stmt</code>. Raises <code class="code">Error</code> on failure.</p></div></div><div class="spec val" id="val-sqlite_result_rev_list_step"><a href="#val-sqlite_result_rev_list_step" class="anchor"></a><div class="def val"><code><span class="keyword">val </span>sqlite_result_rev_list_step : ?⁠finalize:bool <span class="keyword">‑></span> Sqlite3.db <span class="keyword">‑></span> log:string <span class="keyword">‑></span> Sqlite3.stmt <span class="keyword">‑></span> Sqlite3.Data.t option list</code></div><div class="doc"><p>Return a reversed list of results obtained by repeatedly stepping through <code class="code">stmt</code> and saving only column 0 of each returned row (all that's been needed so far).</p></div></div><div class="spec val" id="val-sqlite_result_step"><a href="#val-sqlite_result_step" class="anchor"></a><div class="def val"><code><span class="keyword">val </span>sqlite_result_step : ?⁠finalize:bool <span class="keyword">‑></span> Sqlite3.db <span class="keyword">‑></span> log:string <span class="keyword">‑></span> Sqlite3.stmt <span class="keyword">‑></span> Sqlite3.Data.t option</code></div><div class="doc"><p>Same as <code class="code">sqlite_result_rev_list_step</code> but asserts that at most one result is returned.</p></div></div><div class="spec val" id="val-sqlite_unit_step"><a href="#val-sqlite_unit_step" class="anchor"></a><div class="def val"><code><span class="keyword">val </span>sqlite_unit_step : ?⁠finalize:bool <span class="keyword">‑></span> Sqlite3.db <span class="keyword">‑></span> log:string <span class="keyword">‑></span> Sqlite3.stmt <span class="keyword">‑></span> unit</code></div><div class="doc"><p>Same as <code class="code">sqlite_result_rev_list_step</code> but asserts that no result is returned.</p></div></div><div class="spec val" id="val-db_close"><a href="#val-db_close" class="anchor"></a><div class="def val"><code><span class="keyword">val </span>db_close : Sqlite3.db <span class="keyword">‑></span> unit</code></div><div class="doc"><p>Close the given database and asserts that it was effective. Raises <code class="code">Error</code> if not.</p></div></div><div class="spec module-type" id="module-type-Data"><a href="#module-type-Data" class="anchor"></a><div class="def module-type"><code><span class="keyword">module type </span><a href="module-type-Data/index.html">Data</a> : <span class="keyword">sig</span> ... <span class="keyword">end</span></code></div><div class="doc"><p>An API commonly needed to store and retrieve objects from the database</p></div></div><div class="spec module" id="module-MarshalledData"><a href="#module-MarshalledData" class="anchor"></a><div class="def module"><code><span class="keyword">module </span><a href="MarshalledData/index.html">MarshalledData</a> : <span class="keyword">functor</span> (<a href="MarshalledData/argument-1-D/index.html">D</a> : <span class="keyword">sig</span> ... <span class="keyword">end</span>) -> <a href="index.html#module-type-Data">Data</a><span class="keyword"> with </span><span class="keyword">type </span><a href="MarshalledData/index.html#type-t">t</a><span class="keyword"> = </span><a href="MarshalledData/argument-1-D/index.html#type-t">D.t</a></code></div><div class="doc"><p>A default implementation of the Data API that encodes every objects as marshalled blobs</p></div></div></body></html> |