<htmlxmlns="http://www.w3.org/1999/xhtml"><head><title>ResultsDatabase (infer.IBase.ResultsDatabase)</title><linkrel="stylesheet"href="../../../odoc.css"/><metacharset="utf-8"/><metaname="generator"content="odoc 1.5.2"/><metaname="viewport"content="width=device-width,initial-scale=1.0"/><scriptsrc="../../../highlight.pack.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body><divclass="content"><header><nav><ahref="../index.html">Up</a>–<ahref="../../index.html">infer</a>»<ahref="../index.html">IBase</a>» ResultsDatabase</nav><h1>Module <code>IBase.ResultsDatabase</code></h1></header><dl><dtclass="spec value"id="val-schema_hum"><ahref="#val-schema_hum"class="anchor"></a><code><spanclass="keyword">val</span> schema_hum : string</code></dt><dd><p>some human-readable string describing the tables</p></dd></dl><dl><dtclass="spec value"id="val-create_tables"><ahref="#val-create_tables"class="anchor"></a><code><spanclass="keyword">val</span> create_tables : <span>?⁠prefix:string</span><span>-></span> Sqlite3.db <span>-></span> unit</code></dt><dtclass="spec value"id="val-get_database"><ahref="#val-get_database"class="anchor"></a><code><spanclass="keyword">val</span> get_database : unit <span>-></span> Sqlite3.db</code></dt><dd><p>The results database. You should always use this function to access the database, as the connection to it may change during the execution (see <code>new_database_connection</code>).</p></dd></dl><dl><dtclass="spec value"id="val-new_database_connection"><ahref="#val-new_database_connection"class="anchor"></a><code><spanclass="keyword">val</span> new_database_connection : unit <span>-></span> unit</code></dt><dd><p>Closes the previous connection to the database (if any), and opens a new one. Needed after calls to fork(2).</p></dd></dl><dl><dtclass="spec value"id="val-db_close"><ahref="#val-db_close"class="anchor"></a><code><spanclass="keyword">val</span> db_close : unit <span>-></span> unit</code></dt><dd><p>close the current connection to the database</p></dd></dl><dl><dtclass="spec value"id="val-create_db"><ahref="#val-create_db"class="anchor"></a><code><spanclass="keyword">val</span> create_db : unit <span>-></span> unit</code></dt><dd><p>create the database file and initialize all the necessary tables</p></dd></dl><dl><dtclass="spec type"id="type-registered_stmt"><ahref="#type-registered_stmt"class="anchor"></a><code><spanclass="keyword">type</span> registered_stmt</code></dt></dl><dl><dtclass="spec value"id="val-register_statement"><ahref="#val-register_statement"class="anchor"></a><code><spanclass="keyword">val</span> register_statement : <span><span>(<spanclass="type-var">'a</span>,unit,string,<ahref="index.html#type-registered_stmt">registered_stmt</a>)</span> Base.format4</span><span>-></span><spanclass="type-var">'a</span></code></dt><dd><p>Return a function unit -> Sqlite3.stmt that can be called (once the DB has been initialized) to get the prepared statement corresponding to the current DB connection. Use this to prepare statements only once per DB connection.</p><p>In particular, clients of this need not worry about calling <code>Sqlite3.finalize</code> on the returned statement, or about generating new statements when the connection to the DB changes: this is all handled internally.</p></dd></dl><dl><dtclass="spec value"id="val-with_registered_statement"><ahref="#val-with_registered_statement"class="anchor"></a><code><spanclass="keyword">val</span> with_registered_statement : <ahref="index.html#type-registered_stmt">registered_stmt</a><span>-></span><span>f:<span>(Sqlite3.db <span>-></span> Sqlite3.stmt <span>-></span><spanclass="type-var">'a</span>)</span></span><span>-></span><spanclass="type-var">'a</span></code></dt></dl></div></body></html>