In addition to executing SQL statements directly, Iguana offers another method for writing to databases using a Database Schema File (*.vdb), db.tables{}
and the conn:merge{}
function.
This method simplifies data insertion and updating by automatically handling allows you to easily map data to multiple rows in a single Lua table and then perform a bulk insert or update without writing complex and long SQL statements. Data INSERTs and UPDATEs are simplified as it automatically handles the logic for determining whether to insert new rows or update existing ones, depending on the configuration of key columns in the VDB.
...