Sqlite native-extension

As discussed by @Arônimo on the Defold Discord he was interested in a sqlite native extension. Having built a few lua extensions (from pather packages) a few times I decided to setup a publicly available Defold one here:

The project is now quite usable.

What this project has:

  • A sqlite3 native binding for desktop OS’s - OSX, Windows and Linux
  • Use of the native interface in log.gui_script
  • A gui that has a simple command line interface. Described below.

The command line has:

  • Simple data entry. (supports only backspace).
  • History. Arrow up / down to select previous commands
  • No cursor functionality plain text entry.
  • Output window shows select’s and command errors

The extension is based almost completely on this project here:
https://mroth.net/lua-sqlite3/documentation
Examples and information about its use in lua should work as is. You will always need to add a local sqlite3 = require("libsqlite.sqlite3") to your lua files to use the examples.

Here’s a pic of the functioning gui:

The other platforms will be looked at over the coming week.
Hope this helps.

16 Likes

All usable and working now. Will add android and ios over coming week (all things going well).
Feel free to copy and use you need. Will make it a formal native extension soon too.

6 Likes

Little update. Heres the build repo for the sqlite libs. Trying to org an android and IOS build for it.

7 Likes