LuaSQLite3

Check-in [7c2c1f829c]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Update wiki doc
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 7c2c1f829cc565cdca1e33335196196a4dc08881
User & Date: e 2015-01-05 20:16:09
Context
2015-01-05
21:24
Add load_extension. Fix PUSH_INT64 for Lua < 5.3. check-in: f3fe11aaa4 user: e tags: trunk
20:16
Update wiki doc check-in: 7c2c1f829c user: e tags: trunk
19:26
Fix issue: auto-gc of db with live statements check-in: b2441f7aa8 user: e tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to doc/lsqlite3.wiki.

73
74
75
76
77
78
79
80

81
82
83
84
85
86
87
...
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
...
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
...
609
610
611
612
613
614
615
616



617
618
619
620
621
622
623
624
...
847
848
849
850
851
852
853








854
855
856
857
858
859
860
...
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
...
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
		<li><a href="#stmt_get_value">stmt:get_value</a></li>
		<li><a href="#stmt_get_values">stmt:get_values</a></li>
		<li><a href="#stmt_isopen">stmt:isopen</a></li>
		<li><a href="#stmt_nrows">stmt:nrows</a></li>
		<li><a href="#stmt_reset">stmt:reset</a></li>
		<li><a href="#stmt_rows">stmt:rows</a></li>
		<li><a href="#stmt_step">stmt:step</a></li>
		<li><a href="#stmt_urows">stmt:urows</a></li>

	</ul>

	<li><a href="#methods_for_callback_contexts">Methods for callback contexts</a></li>
	<ul>

		<li><a href="#context_aggregate_count">context:aggregate_count</a></li>
		<li><a href="#context_get_aggregate_data">context:get_aggregate_data</a></li>
................................................................................
<hr name="index" />
</div>

<p>
</p>
<hr />
<h1><a name="name">NAME</a></h1>
<p><strong>LuaSQLite 3</strong> - a Lua 5.1 and Lua 5.2 wrapper for the SQLite3 library</p>
<p>
</p>
<hr />
<h1><a name="overview">OVERVIEW</a></h1>
<p><strong>LuaSQLite 3</strong> is a thin wrapper around the public domain SQLite3
database engine.</p>
<p>The <code>lsqlite3</code> module supports the creation and manipulation of 
................................................................................
<hr />
<h1><a name="verification_tests">VERIFICATION TESTS</a></h1>
<p>The distribution contains a <em>tests</em> directory with some units tests using 
an enhanced version of Michael Roth's <code>lunit</code> called <code>lunitx</code>. Some of the 
tests were also derived from Michael's <strong>lua-sqlite3</strong> module, and more unit tests 
added by Doug Currie. Get <code>lunitx</code> using Luarocks.</p>
<p>The distribution also contains some functional tests by Tiago.</p>
<p>This version of <code>lsqlite3</code> was tested with SQLite 3.7.16.1.</p>
<p>
</p>
<hr />
<h1><a name="reference">REFERENCE</a></h1>
<p>
</p>
<hr />
................................................................................
methods.</p>
<p>
</p>
<h2><a name="stmt_bind">stmt:bind</a></h2>
<pre>
        stmt:bind(n[,value])</pre>
<p>Binds value to statement parameter <code>n</code>. If the type of value is string 
or number, it is bound as text or double, respectively. If <code>value</code> is a



boolean or nil or missing, any previous binding is removed. The function
returns <code>sqlite3.OK</code> on success or else a numerical error code (see
<a href="#numerical_error_and_result_codes">Numerical error and result codes</a>).</p>
<p>
</p>
<h2><a name="stmt_bind_blob">stmt:bind_blob</a></h2>
<pre>
        stmt:bind_blob(n,blob)</pre>
................................................................................
<h2><a name="stmt_urows">stmt:urows</a></h2>
<pre>
        stmt:urows()</pre>
<p>Returns an function that iterates over the values of the result set of
statement stmt. Each iteration returns the values for the current row.
This is the prepared statement equivalent of <a href="#db_urows"><code>db:urows()</code></a>.</p>
<p>








</p>
<hr />
<h1><a name="methods_for_callback_contexts">Methods for callback contexts</a></h1>
<p>A callback context is available as a parameter inside the callback
functions <a href="#db_create_aggregate"><code>db:create_aggregate()</code></a> and 
<a href="#db_create_function"><code>db:create_function()</code></a>. It can be used
to get further information about the state of a query.</p>
................................................................................
</pre>
<p>For details about their exact meaning please see the <strong>SQLite3
documentation</strong> <a href="http://www.sqlite.org/">http://www.sqlite.org/</a>.</p>
<p>
</p>
<hr />
<h1><a name="version">VERSION</a></h1>
<p>This is <code>lsqlite3</code> version <code>fsl_9</code>, also known as &quot;devel-0.9&quot;.</p>
<p>
</p>
<hr />
<h1><a name="credits">CREDITS</a></h1>
<p><code>lsqlite3</code> was developed by Tiago Dionizio and Doug Currie with 
contributions from Thomas Lauer and Michael Roth.</p>
<p>This documentation is based on the &quot;(very) preliminary&quot; documents
................................................................................
<p>
</p>
<hr />
<h1><a name="license">LICENSE</a></h1>
<pre>
    /************************************************************************
    * lsqlite3                                                              *
    * Copyright (C) 2002-2013 Tiago Dionizio, Doug Currie                   *
    * All rights reserved.                                                  *
    * Author    : Tiago Dionizio &lt;tiago.dionizio@ist.utl.pt&gt;                *
    * Author    : Doug Currie &lt;doug.currie@alum.mit.edu&gt;                    *
    * Library   : lsqlite3 - a SQLite 3 database binding for Lua 5          *
    *                                                                       *
    * Permission is hereby granted, free of charge, to any person obtaining *
    * a copy of this software and associated documentation files (the       *







|
>







 







|







 







|







 







|
>
>
>
|







 







>
>
>
>
>
>
>
>







 







|







 







|







73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
...
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
...
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
...
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
...
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
...
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
...
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
		<li><a href="#stmt_get_value">stmt:get_value</a></li>
		<li><a href="#stmt_get_values">stmt:get_values</a></li>
		<li><a href="#stmt_isopen">stmt:isopen</a></li>
		<li><a href="#stmt_nrows">stmt:nrows</a></li>
		<li><a href="#stmt_reset">stmt:reset</a></li>
		<li><a href="#stmt_rows">stmt:rows</a></li>
		<li><a href="#stmt_step">stmt:step</a></li>
        <li><a href="#stmt_urows">stmt:urows</a></li>
        <li><a href="#stmt_last_insert_rowid">stmt:last_insert_rowid</a></li>
	</ul>

	<li><a href="#methods_for_callback_contexts">Methods for callback contexts</a></li>
	<ul>

		<li><a href="#context_aggregate_count">context:aggregate_count</a></li>
		<li><a href="#context_get_aggregate_data">context:get_aggregate_data</a></li>
................................................................................
<hr name="index" />
</div>

<p>
</p>
<hr />
<h1><a name="name">NAME</a></h1>
<p><strong>LuaSQLite 3</strong> - a Lua 5.1 to 5.3 wrapper for the SQLite3 library</p>
<p>
</p>
<hr />
<h1><a name="overview">OVERVIEW</a></h1>
<p><strong>LuaSQLite 3</strong> is a thin wrapper around the public domain SQLite3
database engine.</p>
<p>The <code>lsqlite3</code> module supports the creation and manipulation of 
................................................................................
<hr />
<h1><a name="verification_tests">VERIFICATION TESTS</a></h1>
<p>The distribution contains a <em>tests</em> directory with some units tests using 
an enhanced version of Michael Roth's <code>lunit</code> called <code>lunitx</code>. Some of the 
tests were also derived from Michael's <strong>lua-sqlite3</strong> module, and more unit tests 
added by Doug Currie. Get <code>lunitx</code> using Luarocks.</p>
<p>The distribution also contains some functional tests by Tiago.</p>
<p>This version of <code>lsqlite3</code> was tested with SQLite 3.8.7.4.</p>
<p>
</p>
<hr />
<h1><a name="reference">REFERENCE</a></h1>
<p>
</p>
<hr />
................................................................................
methods.</p>
<p>
</p>
<h2><a name="stmt_bind">stmt:bind</a></h2>
<pre>
        stmt:bind(n[,value])</pre>
<p>Binds value to statement parameter <code>n</code>. If the type of value is string 
it is bound as text. If the type of value is number, then with Lua prior to 5.3 
it is bound as a double, with Lua 5.3 it is bound as an integer or double
depending on its subtype using <code>lua_isinteger</code>. If <code>value</code> is a
boolean then it is bound as 0 for <code>false</code> or 1 for <code>true</code>.
If <code>value</code> is nil or missing, any previous binding is removed. The function
returns <code>sqlite3.OK</code> on success or else a numerical error code (see
<a href="#numerical_error_and_result_codes">Numerical error and result codes</a>).</p>
<p>
</p>
<h2><a name="stmt_bind_blob">stmt:bind_blob</a></h2>
<pre>
        stmt:bind_blob(n,blob)</pre>
................................................................................
<h2><a name="stmt_urows">stmt:urows</a></h2>
<pre>
        stmt:urows()</pre>
<p>Returns an function that iterates over the values of the result set of
statement stmt. Each iteration returns the values for the current row.
This is the prepared statement equivalent of <a href="#db_urows"><code>db:urows()</code></a>.</p>
<p>
</p>
<h2><a name="stmt_last_insert_rowid">stmt:last_insert_rowid</a></h2>
<pre>
        stmt:last_insert_rowid()</pre>
<p>This function returns the rowid of the most recent INSERT into the
database corresponding to this statement. 
See <a href="#db_last_insert_rowid"><code>db:last_insert_rowid()</code></a>.</p>
<p>
</p>
<hr />
<h1><a name="methods_for_callback_contexts">Methods for callback contexts</a></h1>
<p>A callback context is available as a parameter inside the callback
functions <a href="#db_create_aggregate"><code>db:create_aggregate()</code></a> and 
<a href="#db_create_function"><code>db:create_function()</code></a>. It can be used
to get further information about the state of a query.</p>
................................................................................
</pre>
<p>For details about their exact meaning please see the <strong>SQLite3
documentation</strong> <a href="http://www.sqlite.org/">http://www.sqlite.org/</a>.</p>
<p>
</p>
<hr />
<h1><a name="version">VERSION</a></h1>
<p>This is <code>lsqlite3</code> version <code>fsl_9u</code>, also known as &quot;devel-0.9.2-1&quot;.</p>
<p>
</p>
<hr />
<h1><a name="credits">CREDITS</a></h1>
<p><code>lsqlite3</code> was developed by Tiago Dionizio and Doug Currie with 
contributions from Thomas Lauer and Michael Roth.</p>
<p>This documentation is based on the &quot;(very) preliminary&quot; documents
................................................................................
<p>
</p>
<hr />
<h1><a name="license">LICENSE</a></h1>
<pre>
    /************************************************************************
    * lsqlite3                                                              *
    * Copyright (C) 2002-2015 Tiago Dionizio, Doug Currie                   *
    * All rights reserved.                                                  *
    * Author    : Tiago Dionizio &lt;tiago.dionizio@ist.utl.pt&gt;                *
    * Author    : Doug Currie &lt;doug.currie@alum.mit.edu&gt;                    *
    * Library   : lsqlite3 - a SQLite 3 database binding for Lua 5          *
    *                                                                       *
    * Permission is hereby granted, free of charge, to any person obtaining *
    * a copy of this software and associated documentation files (the       *