code: def query_file(self, path, fetchall=False, **params):
          
  
          # If path doesn't exists
          if not os.path.exists(path):
              raise IOError("File '{}' not found!".format(path))
  
          # If it's a directory
          if os.path.isdir(path):
              raise IOError("'{}' is a directory!".format(path))
  
          # Read the given .sql file into memory.
          with open(path) as f:
              query = f.read()
  
          # Defer processing to self.query method.
          return self.query(query=query, fetchall=fetchall, **params)
docs: Like Connection.query, but takes a filename to load a query from.