I wish there was a lite version of SQLite with a much simplified interface that is actually a viable alternative to file_open().
I wish there was a lite version of SQLite with a much simplified interface that is actually a viable alternative to file_open().
It also has a pretty straightforward C API, so it might not be too hard to build bindings yourself if they don’t exist
Google for "Lua SQLite", click top link. http://lua.sqlite.org/index.cgi/doc/tip/doc/lsqlite3.wiki Go to download page, ok. http://lua.sqlite.org/index.cgi/index Download latest version, unzip it. It's in C. What? I thought this was a Lua binding.
Back to Google. Second link. https://makoserver.net/articles/Lua-SQLite-Database-Tutorial Umm... part of some Mako Server thing? I just want SQLite.
Back to Google, third link. http://lua-users.org/wiki/LuaSqlite "LuaSQLite is a Lua binding for SQLite." Alright! Goto website and... http://luaforge.net/projects/luasqlite/ It's a dead link. Uhh okay, back to previous page... "Other SQLite wrappers include:" Three out of four links dead. Only working link: https://github.com/maxdoom-com/lsqlite It's C again. What the hell.
Baaack to Google. Fourth link. https://mroth.net/lua-sqlite3 "Lua-Sqlite3 is a binding of Sqlite3 for Lua." Excellent. Download latest release... Finally, Lua files! Uhh there's a lot of stuff here. Documentation? "These parts needs to be written: ", "Please be patient... ", "Last update: 2006" uh oh. More C code... Prebuilt binaries? Nope!
Fifth Google link is a Lua plugin for SQLite, the inverse of what I want.
Sixth link, "(Yet Another*) Lua wrapper for SQLite" It's more C. No prebuilt binaries!
Seventh link. "LJSQlite3: SQlite3 Interface" No download. It's part of some large scientific computation package.
At this point, all I'm thinking is "this isn't worth it".
I know I could use LuaJIT's FFI to make my own wrapper to SQLite's C interface but at that point I'm not saving time anymore. Best to ignore the whole thing. Serializing data to/from files shouldn't be that complicated. I'll stick with my "piles of files", no matter how "awesomely engineered" SQLite is supposed to be, if it's this much pain to even start using.
The next best thing I have is this dead simple:
local blob = filewriter()
blob:write(literally_any_data_i_have)
writefile("filename", blob:tostring())It it works like pip for python, I think that `luarocks install lsqlite3` might be enough to start using it.