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()<EOL>commands = [cmd for cmd in command.split('<STR_LIT:;>') if cmd]<EOL>if len(commands) > <NUM_LIT:1>:<EOL><INDENT>native.isolation_level = '<STR_LIT>'<EOL>commands.insert(<NUM_LIT:0>, '<STR_LIT>')<EOL><DEDENT>else:<EOL><INDENT>native.isolation_level = None<EOL><DEDENT>def _gen_sub_value(val):<EOL><INDENT>output = []<EOL>replace = []<EOL>for sub_value in val:<EOL><INDENT>if isinstance(sub_value, (list, tuple, set)):<EOL><INDENT>cmd, vals = _gen_sub_value(sub_value)<EOL>replace.append(cmd)<EOL>output += vals<EOL><DEDENT>else:<EOL><INDENT>replace.append('<STR_LIT:?>')<EOL>output.append(sub_value)<EOL><DEDENT>return '<STR_LIT>'.format('<STR_LIT:U+002C>'.join(replace)), output<EOL><DEDENT><DEDENT>rowcount = <NUM_LIT:0><EOL>for cmd in commands:<EOL><INDENT>if not cmd.endswith('<STR_LIT:;>'):<EOL><INDENT>cmd += '<STR_LIT:;>'<EOL><DEDENT>args = []<EOL>for grp, key in FORMAT_EXPR.findall(cmd):<EOL><INDENT>value = data[key]<EOL>if isinstance(value, (list, tuple, set)):<EOL><INDENT>replace, values = _gen_sub_value(value)<EOL>cmd = cmd.replace(grp, replace)<EOL>args += values<EOL><DEDENT>else:<EOL><INDENT>cmd = cmd.replace(grp, '<STR_LIT:?>')<EOL>args.append(value)<EOL><DEDENT><DEDENT>log.debug('<STR_LIT>')<EOL>log.debug(command)<EOL>log.debug(args)<EOL>log.debug('<STR_LIT>')<EOL>try:<EOL><INDENT>cursor.execute(cmd, tuple(args))<EOL>if cursor.rowcount != -<NUM_LIT:1>:<EOL><INDENT>rowcount += cursor.rowcount<EOL><DEDENT><DEDENT>except sqlite.OperationalError as err:<EOL><INDENT>if err == '<STR_LIT>':<EOL><INDENT>raise orb.errors.Interruption()<EOL><DEDENT>else:<EOL><INDENT>log.exception('<STR_LIT>')<EOL>raise orb.errors.QueryFailed(cmd, args, nstr(err))<EOL><DEDENT><DEDENT>except sqlite.IntegrityError as err:<EOL><INDENT>duplicate_error = re.search('<STR_LIT>', nstr(err))<EOL>if duplicate_error:<EOL><INDENT>result = duplicate_error.group(<NUM_LIT:1>)<EOL>msg = '<STR_LIT>'.format(value=result)<EOL>raise orb.errors.DuplicateEntryFound(msg)<EOL><DEDENT>else:<EOL><INDENT>log.exception('<STR_LIT>')<EOL>raise orb.errors.QueryFailed(command, data, nstr(err))<EOL><DEDENT><DEDENT>except Exception as err:<EOL><INDENT>log.exception('<STR_LIT>')<EOL>raise orb.errors.QueryFailed(cmd, args, nstr(err))<EOL><DEDENT><DEDENT>if returning:<EOL><INDENT>results = [mapper(record) for record in cursor.fetchall()]<EOL>rowcount = len(results)  <EOL><DEDENT>else:<EOL><INDENT>results = []<EOL><DEDENT>native.isolation_level = None<EOL>native.commit()<EOL>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