'Run several data against one query
:param query: query to execute on server
:param args:  Sequence of sequences or mappings.  It is used as parameter.
:return: Number of rows affected, if any.
This method improves performance on multiple-row INSERT and
REPLACE. Otherwise it is equivalent to looping over args with
execute().'

def executemany(self, query, args):

    if (not args):
        return
    m = RE_INSERT_VALUES.match(query)
    if m:
        q_prefix = (m.group(1) % ())
        q_values = m.group(2).rstrip()
        q_postfix = (m.group(3) or '')
        assert ((q_values[0] == '(') and (q_values[(-1)] == ')'))
        return self._do_execute_many(q_prefix, q_values, q_postfix, args, self.max_stmt_length, self._get_db().encoding)
    self.rowcount = sum((self.execute(query, arg) for arg in args))
    return self.rowcount
