Ensure that the DB exists and has the right columns
We try a query, and if it fails then we try to create the DB.
ensure_db(db)
db
Useful links