db: added option to control sqlite commit interval (in queries)
db: trigger commits on either time or number-of-queries limits