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

<!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> &mdash; <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 : ?&#8288;fatal:bool <span class="keyword">&#8209;&gt;</span> Sqlite3.db <span class="keyword">&#8209;&gt;</span> log:string <span class="keyword">&#8209;&gt;</span> Sqlite3.Rc.t <span class="keyword">&#8209;&gt;</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">&#8209;&gt;</span> log:string <span class="keyword">&#8209;&gt;</span> stmt:string <span class="keyword">&#8209;&gt;</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">&#8209;&gt;</span> log:string <span class="keyword">&#8209;&gt;</span> Sqlite3.stmt <span class="keyword">&#8209;&gt;</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 : ?&#8288;finalize:bool <span class="keyword">&#8209;&gt;</span> Sqlite3.db <span class="keyword">&#8209;&gt;</span> log:string <span class="keyword">&#8209;&gt;</span> Sqlite3.stmt <span class="keyword">&#8209;&gt;</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 : ?&#8288;finalize:bool <span class="keyword">&#8209;&gt;</span> Sqlite3.db <span class="keyword">&#8209;&gt;</span> log:string <span class="keyword">&#8209;&gt;</span> Sqlite3.stmt <span class="keyword">&#8209;&gt;</span> Sqlite3.Data.t option</code></div><div class="doc"><p>Same