def _fetch(self, query, size=(- 1), commit=True):
    result = self.session.execute(query)
    (self.session.commit() if commit else 0)
    if (query.upper()[:6] == 'SELECT'):
        if (size < 0):
            al = result.fetchall()
            al = [dict(el) for el in al]
            return (al or None)
        elif (size == 1):
            on = dict(result.fetchone())
            self.value_decode(on)
            return (on or None)
        else:
            mny = result.fetchmany(size)
            mny = [dict(el) for el in mny]
            return (mny or None)
    elif (query.upper()[:6] in ('UPDATE', 'DELETE', 'INSERT')):
        return {'rowcount': result.rowcount}
def _fetch(self, query, size=(- 1), commit=True):
    result = self.session.execute(query)
    (self.session.commit() if commit else 0)
    if (query.upper()[:6] == 'SELECT'):
        if (size < 0):
            al = result.fetchall()
            al = [dict(el) for el in al]
            return (al or None)
        elif (size == 1):
            on = dict(result.fetchone())
            self.value_decode(on)
            return (on or None)
        else:
            mny = result.fetchmany(size)
            mny = [dict(el) for el in mny]
            return (mny or None)
    elif (query.upper()[:6] in ('UPDATE', 'DELETE', 'INSERT')):
        return {'rowcount': result.rowcount}