Add database, schema, index queries, aggregate functions. Update other queries to match new API.