Announcement

Collapse
No announcement yet.

SQLite3 from outside scripts folder

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • SQLite3 from outside scripts folder

    Anyone know how, if possible, to use sqlite3.dll from root? A memory dump just shows:

    Code:
    require("luasql.sqlite3");
    SQLite3 = luasql.sqlite3();
    but require('sqlite3') fails to load, think these files are needed but cant seem to find them:

    Code:
    blank_project_pro_1\lua\luasql\sqlite3.lua'
    blank_project_pro_1\lua\luasql\sqlite3\init.lua'

  • #2
    Alternatively does anyone have a compiled LuaSQLite3 module?

    Comment


    • #3
      Originally posted by Shrek View Post
      Alternatively does anyone have a compiled LuaSQLite3 module?
      Yes , a long time ago :o

      SQLite3 Action Plugin is actually ,was action plugin version of LuaSQLite3

      simply it exports some functions to use it in AMS easily ,instead of a single initializer function ; luaopen_lsqlite3



      you can download plugin from the link above and then copy SQLite3.lmd to your project root
      and then replace its extension to dll as SQLite3.dll or whatever you want it to be

      you can use folowing code in order to load that plugin file as a Lua module

      Code:
      if not sqlite3 then
        local sqlite3_open, err1, err2 = package.loadlib("SQLite3.dll","irPlg_Action_RegisterActions")
        assert (sqlite3_open, (err1 or '')..(err2 or ''))
        sqlite3_open()
      end
      finally , you can test it to see how it works by putting following code to a button or something like that

      Code:
      local db = sqlite3.open_memory()
      
      db:exec[[
      
        CREATE TABLE test (id INTEGER PRIMARY KEY, content);
      
        INSERT IGNORE INTO test VALUES (NULL, 'Hello World');
        INSERT IGNORE INTO test VALUES (NULL, 'Hello Lua');
        INSERT IGNORE INTO test VALUES (NULL, 'Hello Sqlite3')
      ]]
      
      for row in db:nrows("SELECT * FROM test") do
       
       Dialog.Message("Notice", "Row Id :"..row.id.."\r\nText :"..row.content, MB_OK, MB_ICONINFORMATION, MB_DEFBUTTON1);
      
       
      end
      
      db:close()
      amsplugins.com Is Closed.

      Facebook Page

      Comment


      • #4
        thanks :yes

        Comment


        • #5
          U can also download the luaforwindows package and it's already compiled

          Comment

          Working...
          X