first commit

This commit is contained in:
Souti
2025-03-06 11:09:58 +01:00
commit 11f7d440ff
330 changed files with 38306 additions and 0 deletions

View File

@@ -0,0 +1,28 @@
require "path"
require "sqlite3"
local db = sqlite3.open_memory()
assert( db:exec[[
CREATE TABLE test (col1, col2);
INSERT INTO test VALUES (1, 2);
INSERT INTO test VALUES (2, 4);
INSERT INTO test VALUES (3, 6);
INSERT INTO test VALUES (4, 8);
INSERT INTO test VALUES (5, 10);
]] )
assert( db:set_function("my_sum", 2, function(a, b)
return a + b
end))
for col1, col2, sum in db:cols("SELECT *, my_sum(col1, col2) FROM test") do
print(col1, col2, sum)
end