I thought this would be trivial but ended up fighting with various solutions until I found one that worked without requiring additional configurations.
So first you might need to install the sqlite3 development libraries (which are needed to compile the Lua sqlite3 connector):
sudo apt-get install libsqlite3-dev
install luarocks if you don’t have it
sudo apt-get install luarocks
and finally, install lsqlite3:
sudo luarocks install lsqlite3