LuaSQLite3

Check-in [01d3974c29]
Login

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

Overview
Comment:Add docn for lversion(); tests for Lua 5.3 64-bit integers.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 01d3974c291c4b47f75f96a6b8d98ac9fe34dff2
User & Date: e 2015-01-06 22:32:44
Context
2015-01-06
22:46
Update README and version info for 0.9.3 release check-in: 4991508bc8 user: e tags: trunk
22:32
Add docn for lversion(); tests for Lua 5.3 64-bit integers. check-in: 01d3974c29 user: e tags: trunk
04:51
Add lversion function; prepare for 0.9.3 release. check-in: f465f235ba user: e tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to doc/lsqlite3.wiki.

11
12
13
14
15
16
17

18
19
20
21
22
23
24
...
212
213
214
215
216
217
218






219
220
221
222
223
224
225
	<li><a href="#examples">EXAMPLES</a></li>
	<li><a href="#verification_tests">VERIFICATION TESTS</a></li>
	<li><a href="#reference">REFERENCE</a></li>
	<li><a href="#sqlite3_functions">SQLite3 functions</a></li>
	<ul>

		<li><a href="#sqlite3_complete">sqlite3.complete</a></li>

		<li><a href="#sqlite3_open">sqlite3.open</a></li>
		<li><a href="#sqlite3_open_memory">sqlite3.open_memory</a></li>
		<li><a href="#sqlite3_temp_directory">sqlite3.temp_directory</a></li>
		<li><a href="#sqlite3_version">sqlite3.version</a></li>
	</ul>

	<li><a href="#database_methods">Database methods</a></li>
................................................................................
<p>
</p>
<h2><a name="sqlite3_version">sqlite3.version</a></h2>
<pre>
        sqlite3.version()</pre>
<p>Returns a string with SQLite version information, in the form 'x.y[.z]'.</p>
<p>






</p>
<hr />
<h1><a name="database_methods">Database methods</a></h1>
<p>After opening a database with <a href="#sqlite3_open"><code>sqlite3.open()</code></a> or 
<a href="#sqlite3_open_memory"><code>sqlite3.open_memory()</code></a>
the returned database object should be used for all further method calls
in connection with that database. An open database object supports the







>







 







>
>
>
>
>
>







11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
...
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
	<li><a href="#examples">EXAMPLES</a></li>
	<li><a href="#verification_tests">VERIFICATION TESTS</a></li>
	<li><a href="#reference">REFERENCE</a></li>
	<li><a href="#sqlite3_functions">SQLite3 functions</a></li>
	<ul>

		<li><a href="#sqlite3_complete">sqlite3.complete</a></li>
        <li><a href="#sqlite3_lversion">sqlite3.lversion</a></li>
		<li><a href="#sqlite3_open">sqlite3.open</a></li>
		<li><a href="#sqlite3_open_memory">sqlite3.open_memory</a></li>
		<li><a href="#sqlite3_temp_directory">sqlite3.temp_directory</a></li>
		<li><a href="#sqlite3_version">sqlite3.version</a></li>
	</ul>

	<li><a href="#database_methods">Database methods</a></li>
................................................................................
<p>
</p>
<h2><a name="sqlite3_version">sqlite3.version</a></h2>
<pre>
        sqlite3.version()</pre>
<p>Returns a string with SQLite version information, in the form 'x.y[.z]'.</p>
<p>
</p>
<h2><a name="sqlite3_lversion">sqlite3.lversion</a></h2>
<pre>
        sqlite3.lversion()</pre>
<p>Returns a string with lsqlite3 library version information, in the form 'x.y[.z]'.</p>
<p>
</p>
<hr />
<h1><a name="database_methods">Database methods</a></h1>
<p>After opening a database with <a href="#sqlite3_open"><code>sqlite3.open()</code></a> or 
<a href="#sqlite3_open_memory"><code>sqlite3.open_memory()</code></a>
the returned database object should be used for all further method calls
in connection with that database. An open database object supports the

Changes to test/tests-sqlite3.lua.

867
868
869
870
871
872
873

































874
875
876
877
878
879
880
end

function gco.teardown()
  assert_true( (gco.db == nil) or (gco.db:close() == sqlite3.OK) )
end




































----------------------------
-- Test for bugs reported --
----------------------------

bug = lunit_TestCase("Bug-Report Tests")








>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
end

function gco.teardown()
  assert_true( (gco.db == nil) or (gco.db:close() == sqlite3.OK) )
end


if _VERSION >= 'Lua 5.3' then

l53 = lunit_TestCase("Lua 5.3 integers")

function l53.setup()
  l53.db = assert( sqlite3.open_memory() )
  assert_equal( sqlite3.OK, l53.db:exec("CREATE TABLE test (id, val)") )
  assert_equal( sqlite3.OK, l53.db:exec("INSERT INTO test VALUES (1, 0x12345678abcdef09)") )
  assert_equal( sqlite3.OK, l53.db:exec("INSERT INTO test VALUES (2, 5.1234567890123456)") )
  assert_equal( sqlite3.OK, l53.db:exec("INSERT INTO test VALUES (3, 42)") )
end

-- l53.db:close()
function l53.test_intfloat()
    local db = l53.db
    for row in db:nrows("SELECT val FROM test WHERE id = 1") do
      assert_equal (row.val, 0x12345678abcdef09)
      assert_equal (row.val & 0xffffffff, 0xabcdef09)
      assert_equal (row.val >> 32, 0x12345678)
    end
    for row in db:nrows("SELECT val FROM test WHERE id = 2") do
      assert_equal (row.val, 5.1234567890123456)
    end
    for row in db:nrows("SELECT val FROM test WHERE id = 3") do
      assert_equal (row.val, 42)
    end
end

function l53.teardown()
  assert_true( (l53.db == nil) or (l53.db:close() == sqlite3.OK) )
end

end

----------------------------
-- Test for bugs reported --
----------------------------

bug = lunit_TestCase("Bug-Report Tests")