def _execute(self,<EOL>native,<EOL>command,<EOL>data=None,<EOL>returning=True,<EOL>mapper=dict):
if data is None:<EOL><INDENT>data = {}<EOL><DEDENT>cursor = native.cursor(cursor_factory=DictCursor)<EOL>try:<EOL><INDENT>register_hstore(cursor, unicode=True)<EOL><DEDENT>except pg.ProgrammingError:<EOL><INDENT>log.warning('<STR_LIT>')<EOL><DEDENT>try:<EOL><INDENT>register_json(cursor)<EOL><DEDENT>except pg.ProgrammingError:<EOL><INDENT>log.warning('<STR_LIT>')<EOL><DEDENT>start = datetime.datetime.now()<EOL>log.debug('<STR_LIT>')<EOL>log.debug(command % data)<EOL>log.debug('<STR_LIT>')<EOL>try:<EOL><INDENT>cursor.execute(command, data)<EOL>rowcount = cursor.rowcount<EOL><DEDENT>except pg_ext.QueryCanceledError as cancelled:<EOL><INDENT>try:<EOL><INDENT>native.rollback()<EOL><DEDENT>except StandardError as err:<EOL><INDENT>log.error('<STR_LIT>'.format(err))<EOL><DEDENT>log.critical(command)<EOL>if data:<EOL><INDENT>log.critical(str(data))<EOL><DEDENT>if '<STR_LIT>' in str(cancelled):<EOL><INDENT>raise orb.errors.QueryTimeout(command, (datetime.datetime.now() - start).total_seconds())<EOL><DEDENT>else:<EOL><INDENT>raise orb.errors.Interruption()<EOL><DEDENT><DEDENT>except pg.InterfaceError:<EOL><INDENT>raise orb.errors.ConnectionLost()<EOL><DEDENT>except (pg.IntegrityError, pg.OperationalError) as err:<EOL><INDENT>try:<EOL><INDENT>native.rollback()<EOL><DEDENT>except StandardError:<EOL><INDENT>pass<EOL><DEDENT>duplicate_error = re.search('<STR_LIT>', nstr(err))<EOL>if duplicate_error:<EOL><INDENT>key = duplicate_error.group(<NUM_LIT:1>)<EOL>result = re.match('<STR_LIT>', key)<EOL>if not result:<EOL><INDENT>result = re.match('<STR_LIT>', key)<EOL><DEDENT>if result:<EOL><INDENT>msg = '<STR_LIT>'.format(**result.groupdict())<EOL>raise orb.errors.DuplicateEntryFound(msg)<EOL><DEDENT>else:<EOL><INDENT>raise orb.errors.DuplicateEntryFound(duplicate_error.group())<EOL><DEDENT><DEDENT>reference_error = re.search('<STR_LIT>', nstr(err))<EOL>if reference_error:<EOL><INDENT>msg = '<STR_LIT>'<EOL>raise orb.errors.CannotDelete(msg)<EOL><DEDENT>log.debug(traceback.print_exc())<EOL>raise orb.errors.QueryFailed(command, data, nstr(err))<EOL><DEDENT>except (pg.Error, pg.ProgrammingError) as err:<EOL><INDENT>try:<EOL><INDENT>native.rollback()<EOL><DEDENT>except StandardError:<EOL><INDENT>pass<EOL><DEDENT>log.error(traceback.print_exc())<EOL>raise orb.errors.QueryFailed(command, data, nstr(err))<EOL><DEDENT>try:<EOL><INDENT>results = [mapper(record) for record in cursor.fetchall()]<EOL><DEDENT>except pg.ProgrammingError:<EOL><INDENT>results = []<EOL><DEDENT>return results, rowcount<EOL>
Executes the inputted command into the current \
connection cursor.

:param      command    | <str>
            data       | <dict> || None
            autoCommit | <bool> | commit database changes immediately
            autoClose  | <bool> | closes connections immediately

:return     [{<str> key: <variant>, ..}, ..], <int> count