This function is used to store a database object instance for later use by sql() calls that don't specify a db.
where query is a string giving SQL query, and db is a database object