*** 1,48 **** I have a preview of womething like that, http://dad-it.com:8080/sqlite3.dll is the 3.3.10 with minor modifications and with lsqlite3.5 (lua sqlite3 bindings), where every opened database has Lua 5.1.1 as procedural language, in Lua we have a global var 'db' that refers to the actual database, we can use anything that can be used with lsqlite3, as well http://dad-it.com:8080/sqlite3.exe is the sqlite3 shell with the same additions as the sqlite3.dll, a small example is at http://dad-it.com:8080/test-lua-sqlite3.sql. ! select install_lua_script(' ! ! local function udf1_scalar(ctx, v) ! local ud = ctx:user_data() - ud.r = (ud.r or '''') .. tostring(v) - ctx:result_text(ud.r) ! end ! db:create_function(''udf1'', 1, udf1_scalar, { })'); ! select 'Udf1 result :' || udf1(549); ! ! select install_lua_script('sequence_number = 0 ! function sequencial_number(ctx) local ud = ctx:user_data() sequence_number = sequence_number + 1 ud.r = sequence_number ctx:result_text(ud.r) ! end ! function set_sequencial_number(ctx,v) local ud = ctx:user_data() sequence_number = v ud.r = sequence_number ctx:result_text(ud.r) ! end ! ! db:create_function(''seqnr'', 0, sequencial_number, { }) ! db:create_function(''set_seqnr'', 1, set_sequencial_number, { })')" ! ! select seqnr(),* from day_slots limit 10; ! in main.c: ! --------- ! #ifdef LUA_SQLITE_PROCEDURAL ! #include "lua_procedural.h" ! #endif /* ** Close an existing SQLite database --- 1,41 ---- I have a preview of womething like that, http://dad-it.com:8080/sqlite3.dll is the 3.3.10 with minor modifications and with lsqlite3.5 (lua sqlite3 bindings), where every opened database has Lua 5.1.1 as procedural language, in Lua we have a global var 'db' that refers to the actual database, we can use anything that can be used with lsqlite3, as well http://dad-it.com:8080/sqlite3.exe is the sqlite3 shell with the same additions as the sqlite3.dll, a small example is at http://dad-it.com:8080/test-lua-sqlite3.sql. ! select install_lua_script(' ! local function udf1_scalar(ctx, v) local ud = ctx:user_data() ud.r = (ud.r or '''') .. tostring(v) ctx:result_text(ud.r) + end ! db:create_function(''udf1'', 1, udf1_scalar, { })'); ! select 'Udf1 result :' || udf1(549); ! select install_lua_script('sequence_number = 0 ! function sequencial_number(ctx) local ud = ctx:user_data() sequence_number = sequence_number + 1 ud.r = sequence_number ctx:result_text(ud.r) ! end ! function set_sequencial_number(ctx,v) local ud = ctx:user_data() sequence_number = v ud.r = sequence_number ctx:result_text(ud.r) ! end ! db:create_function(''seqnr'', 0, sequencial_number, { }) ! db:create_function(''set_seqnr'', 1, set_sequencial_number, { })')" ! select seqnr(),* from day_slots limit 10; ! in main.c: ! --------- ! #ifdef LUA_SQLITE_PROCEDURAL ! #include "lua_procedural.h" ! #endif /* ** Close an existing SQLite database