def query(self, query, fetchall=False, **params):
<EOL>cursor = self._conn.execute(text(query), **params) <EOL>row_gen = (Record(cursor.keys(), row) for row in cursor)<EOL>results = RecordCollection(row_gen)<EOL>if fetchall:<EOL><INDENT>results.all()<EOL><DEDENT>return results<EOL>
Executes the given SQL query against the connected Database.
        Parameters can, optionally, be provided. Returns a RecordCollection,
        which can be iterated over to get result rows as dictionaries.