def get_non_innodb_tables(connectable, skip_tables=('migrate_version',
                                                    'alembic_version')):
    """Get a list of tables which don't use InnoDB storage engine.

     :param connectable: a SQLAlchemy Engine or a Connection instance
     :param skip_tables: a list of tables which might have a different
                         storage engine
     """

    query_str = """
        SELECT table_name
        FROM information_schema.tables
        WHERE table_schema = :database AND
              engine != 'InnoDB'
    """

    params = {}
    if skip_tables:
        params = dict(
            ('skip_%s' % i, table_name)
            for i, table_name in enumerate(skip_tables)
        )

        placeholders = ', '.join(':' + p for p in params)
        query_str += ' AND table_name NOT IN (%s)' % placeholders

    params['database'] = connectable.engine.url.database
    query = text(query_str)
    noninnodb = connectable.execute(query, **params)
    return [i[0] for i in noninnodb]
dataset/ETHPy150Open openstack/oslo.db/oslo_db/sqlalchemy/utils.py/get_non_innodb_tables/original