lsqlite3.c looked like a good idea for connnecting SQL and lua, but I couldn't get it to work and rather than struggle on this, I'll write my own library later on.