Usage of sqlite in a Renoise tool?

Is it somehow possible to use a sqlite database and driver within a renoise LUA tool?

All I found are kind of LUA extensions, written in C(++)… If it is not possible, what about including a sqlite package into the Renoise LUA core?

This might or might not be helpful, but I thought I would share, because your post reminded me of an experience I once had.

I’m not well versed in Renoise tool development, but I have done a bit of work inside some other software (HAProxy load balancer) that could be also extended with Lua, much like Renoise. for one project, I needed to calculate MD5 hashes and the HAProxy Lua did not contain any MD5 hash functions — since I couldn’t install any external Lua modules on that version, I found an open source MD5 hash function in Lua, so I inlined that MD5 Lua code into my HAProxy extension (my custom Lua code) and then used the function, as it was in the right namespace. I literally copied and pasted the whole Lua MD5 code from github to my code and it worked. If this works, it’s totally an ugly workaround, but it might get you unblocked.

A quick web search shows some SQLite Lua projects, like this: lua-ljsqlite3/init.lua at master · stepelu/lua-ljsqlite3 · GitHub — I don’t think this one in particular would work the way I described it unless all these 3 external modules are available inside the Renoise Lua core:

local ffi  = require "ffi"
local bit  = require "bit"
local xsys = require "xsys"

It might not be fun to go down the dependency rabbit hole to inline code for all those 3. Maybe you can find some other purely Lua SQLite module where the dependencies are satisfied?

Anyhow, this might be a totally useless post, but it really sounded like something I encountered, so I thought I would say something.

Good luck!

1 Like

Maybe related or useful:

Using External Lua Modules - Renoise Tool Development - Renoise Forums


Lua native extension module fails to load .dll? - Renoise Tool Development - Renoise Forums

1 Like