Sophie

Sophie

distrib > Fedora > 14 > i386 > by-pkgid > a82b7e43adebc43f1a9ed0a9aa1cb335 > files > 15

ocaml-sqlite-devel-1.5.6-3.fc13.i686.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<link rel="stylesheet" href="style.css" type="text/css">
<meta content="text/html; charset=iso-8859-1" http-equiv="Content-Type">
<link rel="Start" href="index.html">
<link rel="Up" href="index.html">
<link title="Index of types" rel=Appendix href="index_types.html">
<link title="Index of exceptions" rel=Appendix href="index_exceptions.html">
<link title="Index of values" rel=Appendix href="index_values.html">
<link title="Index of modules" rel=Appendix href="index_modules.html">
<link title="Sqlite3" rel="Chapter" href="Sqlite3.html"><link title="Exceptions" rel="Section" href="#2_Exceptions">
<link title="Types" rel="Section" href="#2_Types">
<link title="Return codes" rel="Section" href="#2_Returncodes">
<link title="Column data types" rel="Section" href="#2_Columndatatypes">
<link title="General database operations" rel="Section" href="#2_Generaldatabaseoperations">
<link title="Fine grained query operations" rel="Section" href="#2_Finegrainedqueryoperations">
<link title="Data query" rel="Section" href="#2_Dataquery">
<link title="Binding data to the query" rel="Section" href="#2_Bindingdatatothequery">
<link title="Stepwise query convenience functions" rel="Section" href="#2_Stepwisequeryconveniencefunctions">
<link title="User-defined functions" rel="Section" href="#2_Userdefinedfunctions">
<title>Sqlite3</title>
</head>
<body>
<div class="navbar">&nbsp;<a href="index.html">Up</a>
&nbsp;</div>
<center><h1>Module <a href="type_Sqlite3.html">Sqlite3</a></h1></center>
<br>
<pre><span class="keyword">module</span> Sqlite3: <code class="code">sig</code> <a href="Sqlite3.html">..</a> <code class="code">end</code></pre>API for Sqlite 3.* databases<br>
<hr width="100%">
<br>
<a name="2_Exceptions"></a>
<h2>Exceptions</h2><br>
<pre><span class="keyword">exception</span> <a name="EXCEPTIONInternalError"></a>InternalError <span class="keyword">of</span> <code class="type">string</code></pre>
<div class="info">
<code class="code">InternalError reason</code> is raised when the bindings detect an
    unknown/unsupported situation.<br>
</div>
<pre><span class="keyword">exception</span> <a name="EXCEPTIONError"></a>Error <span class="keyword">of</span> <code class="type">string</code></pre>
<div class="info">
<code class="code">Error reason</code> is raised when some SQL operation is called on a
    nonexistent handle and the functions does not return a return code,
    or if there is no error code corresponding to this error.
    Functions returning return codes communicate errors by returning
    the specific error code.<br>
</div>
<pre><span class="keyword">exception</span> <a name="EXCEPTIONRangeError"></a>RangeError <span class="keyword">of</span> <code class="type">int * int</code></pre>
<div class="info">
<code class="code">RangeError (index, maximum)</code> is raised if some column or bind
    operation refers to a nonexistent column or binding. The first
    entry of the returned tuple is the specified index, the second is
    the limit which was violated.<br>
</div>
<br>
<a name="2_Types"></a>
<h2>Types</h2><br>
<pre><span class="keyword">type</span> <a name="TYPEdb"></a><code class="type"></code>db </pre>
<div class="info">
Database handle. Used to store information regarding open
    databases and the error code from the last operation if the function
    implementing that operation takes a database handle as a parameter.
<p>

    NOTE: DO NOT USE THIS HANDLE WITHIN THREADS OTHER THAN THE ONE THAT
    CREATED IT!!!
<p>

    NOTE: database handles are closed (see <a href="Sqlite3.html#VALdb_close"><code class="code">Sqlite3.db_close</code></a>) automatically
    when they are reclaimed by the GC unless they have already been
    closed earlier by the user. It is good practice to manually close
    database handles to free resources as quickly as possible.<br>
</div>

<pre><span class="keyword">type</span> <a name="TYPEstmt"></a><code class="type"></code>stmt </pre>
<div class="info">
Compiled statement handle. Stores information about compiled
    statements created by the <code class="code">prepare</code> or <code class="code">prepare_tail</code> functions.
<p>

    NOTE: DO NOT USE THIS HANDLE WITHIN THREADS OTHER THAN THE ONE THAT
    CREATED IT!!!<br>
</div>

<pre><span class="keyword">type</span> <a name="TYPEheader"></a><code class="type"></code>header = <code class="type">string</code> </pre>
<div class="info">
Type of name of a column returned by queries.<br>
</div>

<pre><span class="keyword">type</span> <a name="TYPEheaders"></a><code class="type"></code>headers = <code class="type"><a href="Sqlite3.html#TYPEheader">header</a> array</code> </pre>
<div class="info">
Type of names of columns returned by queries.<br>
</div>

<pre><span class="keyword">type</span> <a name="TYPErow"></a><code class="type"></code>row = <code class="type">string option array</code> </pre>
<div class="info">
Type of row data (with potential NULL-values)<br>
</div>

<pre><span class="keyword">type</span> <a name="TYPErow_not_null"></a><code class="type"></code>row_not_null = <code class="type">string array</code> </pre>
<div class="info">
Type of row data (without NULL-values)<br>
</div>

<br>
<a name="2_Returncodes"></a>
<h2>Return codes</h2><br>
<pre><span class="keyword">module</span> <a href="Sqlite3.Rc.html">Rc</a>: <code class="code">sig</code> <a href="Sqlite3.Rc.html">..</a> <code class="code">end</code></pre><br>
<a name="2_Columndatatypes"></a>
<h2>Column data types</h2><br>
<pre><span class="keyword">module</span> <a href="Sqlite3.Data.html">Data</a>: <code class="code">sig</code> <a href="Sqlite3.Data.html">..</a> <code class="code">end</code></pre><br>
<a name="2_Generaldatabaseoperations"></a>
<h2>General database operations</h2><br>
<pre><span class="keyword">val</span> <a name="VALdb_open"></a>db_open : <code class="type">string -> <a href="Sqlite3.html#TYPEdb">db</a></code></pre><div class="info">
<code class="code">db_open filename</code> opens the database file <code class="code">filename</code>, and returns
    a database handle.<br>
</div>
<pre><span class="keyword">val</span> <a name="VALdb_close"></a>db_close : <code class="type"><a href="Sqlite3.html#TYPEdb">db</a> -> bool</code></pre><div class="info">
<code class="code">db_close db</code> closes database <code class="code">db</code> and invalidates the handle.<br>
<b>Raises</b> <code>SqliteError</code> if an invalid database handle is passed.<br>
<b>Returns</b> <code class="code">false</code> if database was busy (database not closed in this
    case!), <code class="code">true</code> otherwise.<br>
</div>
<pre><span class="keyword">val</span> <a name="VALenable_load_extension"></a>enable_load_extension : <code class="type"><a href="Sqlite3.html#TYPEdb">db</a> -> bool -> bool</code></pre><div class="info">
<code class="code">enable_load_extension db onoff</code> enable/disable the sqlite3 load
    extension.<br>
<b>Returns</b> <code class="code">false</code> if the operation fails, <code class="code">true</code>
    otherwise.<br>
</div>
<pre><span class="keyword">val</span> <a name="VALerrcode"></a>errcode : <code class="type"><a href="Sqlite3.html#TYPEdb">db</a> -> <a href="Sqlite3.Rc.html#TYPEt">Rc.t</a></code></pre><div class="info">
<code class="code">errcode db</code><br>
<b>Raises</b> <code>SqliteError</code> if an invalid database handle is passed.<br>
<b>Returns</b> the error code of the last operation on database
    <code class="code">db</code>.<br>
</div>
<pre><span class="keyword">val</span> <a name="VALerrmsg"></a>errmsg : <code class="type"><a href="Sqlite3.html#TYPEdb">db</a> -> string</code></pre><div class="info">
<code class="code">errmsg db</code><br>
<b>Raises</b> <code>SqliteError</code> if an invalid database handle is passed.<br>
<b>Returns</b> the error message of the last operation on
    database <code class="code">db</code>.<br>
</div>
<pre><span class="keyword">val</span> <a name="VALlast_insert_rowid"></a>last_insert_rowid : <code class="type"><a href="Sqlite3.html#TYPEdb">db</a> -> int64</code></pre><div class="info">
<code class="code">last_insert_rowid db</code><br>
<b>Raises</b> <code>SqliteError</code> if an invalid database handle is passed.<br>
<b>Returns</b> the index of the row inserted by
    the last operation on database <code class="code">db</code>.<br>
</div>
<pre><span class="keyword">val</span> <a name="VALexec"></a>exec : <code class="type"><a href="Sqlite3.html#TYPEdb">db</a> -><br>       ?cb:(<a href="Sqlite3.html#TYPErow">row</a> -> <a href="Sqlite3.html#TYPEheaders">headers</a> -> unit) -> string -> <a href="Sqlite3.Rc.html#TYPEt">Rc.t</a></code></pre><div class="info">
<code class="code">exec db ?cb sql</code> performs SQL-operation <code class="code">sql</code> on database <code class="code">db</code>.
    If the operation contains query statements, then the callback function
    <code class="code">cb</code> will be called for each matching row. The first parameter of
    the callback is the contents of the row, the second paramater are the
    headers of the columns associated with the row. Exceptions raised
    within the callback will abort the execution and escape <a href="Sqlite3.html#VALexec"><code class="code">Sqlite3.exec</code></a>.<br>
<b>Raises</b> <code>SqliteError</code> if an invalid database handle is passed.<br>
<b>Returns</b> the return code of the operation.<br>
</div>
<div class="param_info"><code class="code">cb</code> : default = no callback</div>
<pre><span class="keyword">val</span> <a name="VALexec_no_headers"></a>exec_no_headers : <code class="type"><a href="Sqlite3.html#TYPEdb">db</a> -> cb:(<a href="Sqlite3.html#TYPErow">row</a> -> unit) -> string -> <a href="Sqlite3.Rc.html#TYPEt">Rc.t</a></code></pre><div class="info">
<code class="code">exec_no_headers db ?cb sql</code> performs SQL-operation <code class="code">sql</code> on database
    <code class="code">db</code>. If the operation contains query statements, then the callback
    function <code class="code">cb</code> will be called for each matching row. The parameter
    of the callback is the contents of the row. Exceptions raised within
    the callback will abort the execution and escape <a href="Sqlite3.html#VALexec_no_headers"><code class="code">Sqlite3.exec_no_headers</code></a>.<br>
<b>Raises</b> <code>SqliteError</code> if an invalid database handle is passed.<br>
<b>Returns</b> the return code of the operation.<br>
</div>
<pre><span class="keyword">val</span> <a name="VALexec_not_null"></a>exec_not_null : <code class="type"><a href="Sqlite3.html#TYPEdb">db</a> -><br>       cb:(<a href="Sqlite3.html#TYPErow_not_null">row_not_null</a> -> <a href="Sqlite3.html#TYPEheaders">headers</a> -> unit) -><br>       string -> <a href="Sqlite3.Rc.html#TYPEt">Rc.t</a></code></pre><div class="info">
<code class="code">exec_not_null db ~cb sql</code> performs SQL-operation <code class="code">sql</code> on database
    <code class="code">db</code>. If the operation contains query statements, then the callback
    function <code class="code">cb</code> will be called for each matching row. The first
    parameter of the callback is the contents of the row, which must
    not contain NULL-values, the second paramater are the headers of
    the columns associated with the row. Exceptions raised within the
    callback will abort the execution and escape <a href="Sqlite3.html#VALexec_not_null"><code class="code">Sqlite3.exec_not_null</code></a>.<br>
<b>Raises</b><ul><li><code>SqliteError</code> if an invalid database handle is passed.</li>
<li><code>SqliteError</code> if a row contains NULL.</li>
</ul>
<b>Returns</b> the return code of the operation.<br>
</div>
<pre><span class="keyword">val</span> <a name="VALexec_not_null_no_headers"></a>exec_not_null_no_headers : <code class="type"><a href="Sqlite3.html#TYPEdb">db</a> -> cb:(<a href="Sqlite3.html#TYPErow_not_null">row_not_null</a> -> unit) -> string -> <a href="Sqlite3.Rc.html#TYPEt">Rc.t</a></code></pre><div class="info">
<code class="code">exec_not_null_no_headers db ~cb sql</code> performs SQL-operation <code class="code">sql</code>
    on database <code class="code">db</code>. If the operation contains query statements, then
    the callback function <code class="code">cb</code> will be called for each matching row.
    The parameter of the callback is the contents of the row, which must
    not contain NULL-values. Exceptions raised within the callback will
    abort the execution and escape <a href="Sqlite3.html#VALexec_not_null_no_headers"><code class="code">Sqlite3.exec_not_null_no_headers</code></a>.<br>
<b>Raises</b><ul><li><code>SqliteError</code> if an invalid database handle is passed.</li>
<li><code>SqliteError</code> if a row contains NULL.</li>
</ul>
<b>Returns</b> the return code of the operation.<br>
</div>
<pre><span class="keyword">val</span> <a name="VALchanges"></a>changes : <code class="type"><a href="Sqlite3.html#TYPEdb">db</a> -> int</code></pre><div class="info">
<code class="code">changes db</code><br>
<b>Returns</b> the number of rows that were changed
    or inserted or deleted by the most recently completed SQL statement
    on database <code class="code">db</code>.<br>
</div>
<br>
<a name="2_Finegrainedqueryoperations"></a>
<h2>Fine grained query operations</h2><br>
<pre><span class="keyword">val</span> <a name="VALprepare"></a>prepare : <code class="type"><a href="Sqlite3.html#TYPEdb">db</a> -> string -> <a href="Sqlite3.html#TYPEstmt">stmt</a></code></pre><div class="info">
<code class="code">prepare db sql</code> compile SQL-statement <code class="code">sql</code> for database <code class="code">db</code>
    into bytecode. The statement may be only partially compiled.
    In this case <a href="Sqlite3.html#VALprepare_tail"><code class="code">Sqlite3.prepare_tail</code></a> can be called on the returned statement
    to compile the remaining part of the SQL-statement.
<p>

    NOTE: this really uses the C-function <code class="code">sqlite3_prepare_v2</code>,
    i.e. avoids the older, deprecated <code class="code">sqlite3_prepare</code>-function.<br>
<b>Raises</b><ul><li><code>SqliteError</code> if an invalid database handle is passed.</li>
<li><code>SqliteError</code> if the statement could not be prepared.</li>
</ul>
</div>
<pre><span class="keyword">val</span> <a name="VALprepare_tail"></a>prepare_tail : <code class="type"><a href="Sqlite3.html#TYPEstmt">stmt</a> -> <a href="Sqlite3.html#TYPEstmt">stmt</a> option</code></pre><div class="info">
<code class="code">prepare_tail stmt</code> compile the remaining part of the SQL-statement
    <code class="code">stmt</code> to bytecode.<br>
<b>Raises</b> <code>SqliteError</code> if the statement could not be prepared.<br>
<b>Returns</b> <code class="code">None</code> if there was no remaining part,
    or <code class="code">Some remaining_part</code> otherwise.
<p>

    NOTE: this really uses the C-function <code class="code">sqlite3_prepare_v2</code>,
    i.e. avoids the older, deprecated <code class="code">sqlite3_prepare</code>-function.<br>
</div>
<pre><span class="keyword">val</span> <a name="VALrecompile"></a>recompile : <code class="type"><a href="Sqlite3.html#TYPEstmt">stmt</a> -> unit</code></pre><div class="info">
<code class="code">recompile stmt</code> recompiles the SQL-statement associated with <code class="code">stmt</code>
    to bytecode. The statement may be only partially compiled. In this
    case <a href="Sqlite3.html#VALprepare_tail"><code class="code">Sqlite3.prepare_tail</code></a> can be called on the statement to compile the
    remaining part of the SQL-statement. Call this function if the
    statement expires due to some schema change.<br>
<b>Raises</b> <code>SqliteError</code> if the statement could not be recompiled.<br>
</div>
<pre><span class="keyword">val</span> <a name="VALstep"></a>step : <code class="type"><a href="Sqlite3.html#TYPEstmt">stmt</a> -> <a href="Sqlite3.Rc.html#TYPEt">Rc.t</a></code></pre><div class="info">
<code class="code">step stmt</code> performs one step of the query associated with
    SQL-statement <code class="code">stmt</code>.<br>
<b>Raises</b> <code>SqliteError</code> if the step could not be executed.<br>
<b>Returns</b> the return code of this operation.<br>
</div>
<pre><span class="keyword">val</span> <a name="VALfinalize"></a>finalize : <code class="type"><a href="Sqlite3.html#TYPEstmt">stmt</a> -> <a href="Sqlite3.Rc.html#TYPEt">Rc.t</a></code></pre><div class="info">
<code class="code">finalize stmt</code> finalizes the statement <code class="code">stmt</code>. After finalization,
    the only valid usage of the statement is to use it in <a href="Sqlite3.html#VALprepare_tail"><code class="code">Sqlite3.prepare_tail</code></a>,
    or to <a href="Sqlite3.html#VALrecompile"><code class="code">Sqlite3.recompile</code></a> it.<br>
<b>Raises</b> <code>SqliteError</code> if the statement could not be finalized.<br>
<b>Returns</b> the return code of this operation.<br>
</div>
<pre><span class="keyword">val</span> <a name="VALreset"></a>reset : <code class="type"><a href="Sqlite3.html#TYPEstmt">stmt</a> -> <a href="Sqlite3.Rc.html#TYPEt">Rc.t</a></code></pre><div class="info">
<code class="code">reset stmt</code> resets the statement <code class="code">stmt</code>, e.g. to restart the query,
    perhaps with different bindings.<br>
<b>Raises</b> <code>SqliteError</code> if the statement could not be reset.<br>
<b>Returns</b> the return code of this operation.<br>
</div>
<br>
<a name="2_Dataquery"></a>
<h2>Data query</h2><br>
<pre><span class="keyword">val</span> <a name="VALdata_count"></a>data_count : <code class="type"><a href="Sqlite3.html#TYPEstmt">stmt</a> -> int</code></pre><div class="info">
<code class="code">data_count stmt</code><br>
<b>Raises</b> <code>SqliteError</code> if the statement is invalid.<br>
<b>Returns</b> the number of columns in the result of
    the last step of statement <code class="code">stmt</code>.<br>
</div>
<pre><span class="keyword">val</span> <a name="VALcolumn_count"></a>column_count : <code class="type"><a href="Sqlite3.html#TYPEstmt">stmt</a> -> int</code></pre><div class="info">
<code class="code">column_count stmt</code><br>
<b>Raises</b> <code>SqliteError</code> if the statement is invalid.<br>
<b>Returns</b> the number of columns that would be
    returned by executing statement <code class="code">stmt</code>.<br>
</div>
<pre><span class="keyword">val</span> <a name="VALcolumn"></a>column : <code class="type"><a href="Sqlite3.html#TYPEstmt">stmt</a> -> int -> <a href="Sqlite3.Data.html#TYPEt">Data.t</a></code></pre><div class="info">
<code class="code">column stmt n</code><br>
<b>Raises</b><ul><li><code>RangeError</code> if <code class="code">n</code> is out of range.</li>
<li><code>SqliteError</code> if the statement is invalid.</li>
</ul>
<b>Returns</b> the data in column <code class="code">n</code> of the
    result of the last step of statement <code class="code">stmt</code>.<br>
</div>
<pre><span class="keyword">val</span> <a name="VALcolumn_name"></a>column_name : <code class="type"><a href="Sqlite3.html#TYPEstmt">stmt</a> -> int -> <a href="Sqlite3.html#TYPEheader">header</a></code></pre><div class="info">
<code class="code">column_name stmt n</code><br>
<b>Raises</b><ul><li><code>RangeError</code> if <code class="code">n</code> is out of range.</li>
<li><code>SqliteError</code> if the statement is invalid.</li>
</ul>
<b>Returns</b> the header of column <code class="code">n</code> in the
    result set of statement <code class="code">stmt</code>.<br>
</div>
<pre><span class="keyword">val</span> <a name="VALcolumn_decltype"></a>column_decltype : <code class="type"><a href="Sqlite3.html#TYPEstmt">stmt</a> -> int -> string option</code></pre><div class="info">
<code class="code">column_decltype stmt n</code><br>
<b>Raises</b><ul><li><code>RangeError</code> if <code class="code">n</code> is out of range.</li>
<li><code>SqliteError</code> if the statement is invalid.</li>
</ul>
<b>Returns</b> the declared type of the specified
    column in the result set of statement <code class="code">stmt</code>.<br>
</div>
<br>
<a name="2_Bindingdatatothequery"></a>
<h2>Binding data to the query</h2><br>
<pre><span class="keyword">val</span> <a name="VALbind"></a>bind : <code class="type"><a href="Sqlite3.html#TYPEstmt">stmt</a> -> int -> <a href="Sqlite3.Data.html#TYPEt">Data.t</a> -> <a href="Sqlite3.Rc.html#TYPEt">Rc.t</a></code></pre><div class="info">
<code class="code">bind stmt n data</code> binds the value <code class="code">data</code> to the free variable at
    position <code class="code">n</code> of statement <code class="code">stmt</code>. NOTE: the first variable has
    index <code class="code">1</code>!<br>
<b>Raises</b><ul><li><code>RangeError</code> if <code class="code">n</code> is out of range.</li>
<li><code>SqliteError</code> if the statement is invalid.</li>
</ul>
<b>Returns</b> the return code of this operation.<br>
</div>
<pre><span class="keyword">val</span> <a name="VALbind_parameter_count"></a>bind_parameter_count : <code class="type"><a href="Sqlite3.html#TYPEstmt">stmt</a> -> int</code></pre><div class="info">
<code class="code">bind_parameter_count stmt</code><br>
<b>Raises</b> <code>SqliteError</code> if the statement is invalid.<br>
<b>Returns</b> the number of free variables in
    statement <code class="code">stmt</code>.<br>
</div>
<pre><span class="keyword">val</span> <a name="VALbind_parameter_name"></a>bind_parameter_name : <code class="type"><a href="Sqlite3.html#TYPEstmt">stmt</a> -> int -> string option</code></pre><div class="info">
<code class="code">bind_parameter_name stmt n</code><br>
<b>Raises</b><ul><li><code>RangeError</code> if <code class="code">n</code> is out of range.</li>
<li><code>SqliteError</code> if the statement is invalid.</li>
</ul>
<b>Returns</b> <code class="code">Some parameter_name</code> of the free
    variable at position <code class="code">n</code> of statement <code class="code">stmt</code>, or <code class="code">None</code> if it is
    ordinary ("?").<br>
</div>
<pre><span class="keyword">val</span> <a name="VALbind_parameter_index"></a>bind_parameter_index : <code class="type"><a href="Sqlite3.html#TYPEstmt">stmt</a> -> string -> int</code></pre><div class="info">
<code class="code">bind_parameter_index stmt name</code><br>
<b>Raises</b><ul><li><code>Not_found</code> if <code class="code">name</code> was not found.</li>
<li><code>SqliteError</code> if the statement is invalid.</li>
</ul>
<b>Returns</b> the position of the free
    variable with name <code class="code">name</code> in statement <code class="code">stmt</code>.<br>
</div>
<br>
<a name="2_Stepwisequeryconveniencefunctions"></a>
<h2>Stepwise query convenience functions</h2><br>
<pre><span class="keyword">val</span> <a name="VALrow_data"></a>row_data : <code class="type"><a href="Sqlite3.html#TYPEstmt">stmt</a> -> <a href="Sqlite3.Data.html#TYPEt">Data.t</a> array</code></pre><div class="info">
<code class="code">row_data stmt</code><br>
<b>Raises</b> <code>SqliteError</code> if the statement is invalid.<br>
<b>Returns</b> all data values in the row returned by the
    last query step performed with statement <code class="code">stmt</code>.<br>
</div>
<pre><span class="keyword">val</span> <a name="VALrow_names"></a>row_names : <code class="type"><a href="Sqlite3.html#TYPEstmt">stmt</a> -> <a href="Sqlite3.html#TYPEheaders">headers</a></code></pre><div class="info">
<code class="code">row_names stmt</code><br>
<b>Raises</b> <code>SqliteError</code> if the statement is invalid.<br>
<b>Returns</b> all column headers of the row returned by the
    last query step performed with statement <code class="code">stmt</code>.<br>
</div>
<pre><span class="keyword">val</span> <a name="VALrow_decltypes"></a>row_decltypes : <code class="type"><a href="Sqlite3.html#TYPEstmt">stmt</a> -> string option array</code></pre><div class="info">
<code class="code">row_decltypes stmt</code><br>
<b>Raises</b> <code>SqliteError</code> if the statement is invalid.<br>
<b>Returns</b> all column type declarations of the
    row returned by the last query step performed with statement <code class="code">stmt</code>.<br>
</div>
<br>
<a name="2_Userdefinedfunctions"></a>
<h2>User-defined functions</h2><br>
<pre><span class="keyword">val</span> <a name="VALcreate_funN"></a>create_funN : <code class="type"><a href="Sqlite3.html#TYPEdb">db</a> -> string -> (<a href="Sqlite3.Data.html#TYPEt">Data.t</a> array -> <a href="Sqlite3.Data.html#TYPEt">Data.t</a>) -> unit</code></pre><div class="info">
<code class="code">create_funN db name f</code> registers function <code class="code">f</code> under name <code class="code">name</code>
    with database handle <code class="code">db</code>. The function has arity <code class="code">N</code>.<br>
<b>Raises</b> <code>SqliteError</code> if an invalid database handle is passed.<br>
</div>
<pre><span class="keyword">val</span> <a name="VALcreate_fun0"></a>create_fun0 : <code class="type"><a href="Sqlite3.html#TYPEdb">db</a> -> string -> (unit -> <a href="Sqlite3.Data.html#TYPEt">Data.t</a>) -> unit</code></pre><div class="info">
<code class="code">create_funN db name f</code> registers function <code class="code">f</code> under name <code class="code">name</code>
    with database handle <code class="code">db</code>. The function has arity <code class="code">0</code>.<br>
<b>Raises</b> <code>SqliteError</code> if an invalid database handle is passed.<br>
</div>
<pre><span class="keyword">val</span> <a name="VALcreate_fun1"></a>create_fun1 : <code class="type"><a href="Sqlite3.html#TYPEdb">db</a> -> string -> (<a href="Sqlite3.Data.html#TYPEt">Data.t</a> -> <a href="Sqlite3.Data.html#TYPEt">Data.t</a>) -> unit</code></pre><div class="info">
<code class="code">create_fun1 db name f</code> registers function <code class="code">f</code> under name <code class="code">name</code>
    with database handle <code class="code">db</code>. The function has arity <code class="code">1</code>.<br>
<b>Raises</b> <code>SqliteError</code> if an invalid database handle is passed.<br>
</div>
<pre><span class="keyword">val</span> <a name="VALcreate_fun2"></a>create_fun2 : <code class="type"><a href="Sqlite3.html#TYPEdb">db</a> -><br>       string -> (<a href="Sqlite3.Data.html#TYPEt">Data.t</a> -> <a href="Sqlite3.Data.html#TYPEt">Data.t</a> -> <a href="Sqlite3.Data.html#TYPEt">Data.t</a>) -> unit</code></pre><div class="info">
<code class="code">create_fun2 db name f</code> registers function <code class="code">f</code> under name <code class="code">name</code>
    with database handle <code class="code">db</code>. The function has arity <code class="code">2</code>.<br>
<b>Raises</b> <code>SqliteError</code> if an invalid database handle is passed.<br>
</div>
<pre><span class="keyword">val</span> <a name="VALcreate_fun3"></a>create_fun3 : <code class="type"><a href="Sqlite3.html#TYPEdb">db</a> -><br>       string -><br>       (<a href="Sqlite3.Data.html#TYPEt">Data.t</a> -> <a href="Sqlite3.Data.html#TYPEt">Data.t</a> -> <a href="Sqlite3.Data.html#TYPEt">Data.t</a> -> <a href="Sqlite3.Data.html#TYPEt">Data.t</a>) -><br>       unit</code></pre><div class="info">
<code class="code">create_fun3 db name f</code> registers function <code class="code">f</code> under name <code class="code">name</code>
    with database handle <code class="code">db</code>. The function has arity <code class="code">3</code>.<br>
<b>Raises</b> <code>SqliteError</code> if an invalid database handle is passed.<br>
</div>
<pre><span class="keyword">val</span> <a name="VALdelete_function"></a>delete_function : <code class="type"><a href="Sqlite3.html#TYPEdb">db</a> -> string -> unit</code></pre><div class="info">
<code class="code">delete_function db name</code> deletes function with name <code class="code">name</code> from
    database handle <code class="code">db</code>.<br>
<b>Raises</b> <code>SqliteError</code> if an invalid database handle is passed.<br>
</div>
<pre><span class="keyword">val</span> <a name="VALbusy_timeout"></a>busy_timeout : <code class="type"><a href="Sqlite3.html#TYPEdb">db</a> -> int -> unit</code></pre><div class="info">
<code class="code">busy_timeout db ms</code> sets a busy handler that sleeps for a
    specified amount of time when a table is locked. The handler will
    sleep multiple times until at least <code class="code">ms</code> milliseconds of sleeping
    have accumulated.<br>
<b>Raises</b> <code>SqliteError</code> if an invalid database handle is passed.<br>
</div>
<pre><span class="keyword">module</span> <a href="Sqlite3.Aggregate.html">Aggregate</a>: <code class="code">sig</code> <a href="Sqlite3.Aggregate.html">..</a> <code class="code">end</code></pre></body></html>