mirror of
https://github.com/mamedev/mame.git
synced 2024-11-16 07:48:32 +01:00
20 lines
421 B
Lua
20 lines
421 B
Lua
|
|
local sqlite3 = require("lsqlite3")
|
|
|
|
local db = sqlite3.open_memory()
|
|
|
|
db:trace( function(ud, sql)
|
|
print("Sqlite Trace:", sql)
|
|
end )
|
|
|
|
db:exec[[
|
|
CREATE TABLE test ( id INTEGER PRIMARY KEY, content VARCHAR );
|
|
|
|
INSERT INTO test VALUES (NULL, 'Hello World');
|
|
INSERT INTO test VALUES (NULL, 'Hello Lua');
|
|
INSERT INTO test VALUES (NULL, 'Hello Sqlite3');
|
|
]]
|
|
|
|
for row in db:rows("SELECT * FROM test") do
|
|
-- NOP
|
|
end
|