upload luasqlite3

This commit is contained in:
2025-01-07 22:54:09 +05:00
parent 8b36f749e1
commit 01d0bf60a6
27 changed files with 231828 additions and 0 deletions

22
examples/smart.lua Normal file
View File

@@ -0,0 +1,22 @@
local sqlite3 = require("lsqlite3")
local db = sqlite3.open_memory()
db:exec[[ CREATE TABLE test (id INTEGER PRIMARY KEY, content) ]]
local stmt = db:prepare[[ INSERT INTO test VALUES (:key, :value) ]]
stmt:bind_names{ key = 1, value = "Hello World" }
stmt:step()
stmt:reset()
stmt:bind_names{ key = 2, value = "Hello Lua" }
stmt:step()
stmt:reset()
stmt:bind_names{ key = 3, value = "Hello Sqlite3" }
stmt:step()
stmt:finalize()
for row in db:nrows("SELECT * FROM test") do
print(row.id, row.content)
end