def query_file(self, path, fetchall=False, **params):
<EOL>if not os.path.exists(path):<EOL><INDENT>raise IOError("<STR_LIT>".format(path))<EOL><DEDENT>if os.path.isdir(path):<EOL><INDENT>raise IOError("<STR_LIT>".format(path))<EOL><DEDENT>with open(path) as f:<EOL><INDENT>query = f.read()<EOL><DEDENT>return self.query(query=query, fetchall=fetchall, **params)<EOL>
Like Connection.query, but takes a filename to load a query from.