docs: def _query(self, query_str, query_args=None, **query_options):
          """
          **query_options -- dict
              ignore_result -- boolean -- true to not attempt to fetch results
              fetchone -- boolean -- true to only fetch one result
              count_result -- boolean -- true to return the int count of rows affected
          """
          ret = True
          # http://stackoverflow.com/questions/6739355/dictcursor-doesnt-seem-to-work-under-psycopg2
          connection = query_options.get('connection', None)
          with self.connection(connection) as connection:
              cur = connection.cursor()
              ignore_result = query_options.get('ignore_result', False)
              count_result = query_options.get('count_result', False)
              one_result = query_options.get('fetchone', query_options.get('one_result', False))
              cursor_result = query_options.get('cursor_result', False)
  
              try:
                  if query_args:
                      self.log("{}{}{}", query_str, os.linesep, query_args)
                      cur.execute(query_str, query_args)
                  else:
                      self.log(query_str)
                      cur.execute(query_str)
  
                  if cursor_result:
                      ret = cur
  
                  elif not ignore_result:
                      if one_result:
                          ret = self._normalize_result_dict(cur.fetchone())
                      elif count_result:
                          ret = cur.rowcount
                      else:
                          ret = self._normalize_result_list(cur.fetchall())
  
              except Exception as e:
                  self.log(e)
                  raise
  
              return ret