[Sqlalchemy-tickets] Issue #4293: mysql 8.0 reports DESC etc. for columns in indexes (zzzeek/sqlalc
Brought to you by:
zzzeek
From: Michael B. <iss...@bi...> - 2018-06-28 17:57:09
|
New issue 4293: mysql 8.0 reports DESC etc. for columns in indexes https://bitbucket.org/zzzeek/sqlalchemy/issues/4293/mysql-80-reports-desc-etc-for-columns-in Michael Bayer: Postgresql dialect supports this, so for mysql8.0 we have to ramp up the parsing: ``` #!python from sqlalchemy import * m1 = MetaData() t1 = Table( 'add_ix', m1, Column('x', String(50)), mysql_engine='InnoDB') Index('foo_idx', t1.c.x.desc()) for url in [ "postgresql://scott:tiger@localhost/test", "mysql://scott:tiger@mysql57/test", "mysql://scott:tiger@mysql80/test", ]: e = create_engine(url) m1.drop_all(e) m1.create_all(e) insp = inspect(e) assert \ insp.get_indexes("add_ix") == \ [{'name': 'foo_idx', 'unique': False, 'column_names': ['x']}], \ "failed on %s" % url ``` |