[Sqlalchemy-tickets] Issue #3619: base JSON type + unification across pg/mysql (zzzeek/sqlalchemy)
Brought to you by:
zzzeek
|
From: Mike B. <iss...@bi...> - 2015-12-28 22:28:59
|
New issue 3619: base JSON type + unification across pg/mysql https://bitbucket.org/zzzeek/sqlalchemy/issues/3619/base-json-type-unification-across-pg-mysql Mike Bayer: since #3547, mysql has a JSON type also, the approach we've taken in #3503 needs to be expanded. Critical is that a base sqlalchemy.sql.sqltypes.JSON type needs to exist analogous to sqlalchemy.sql.sqltypes.Array. Basic JSON single-index and pathed-index values should then work on PG or MySQL backends equally, which means the operator massaging we see in PG's version of _setup_getitem() as well as the early massaging we see in https://github.com/zzzeek/sqlalchemy/pull/221/files must be moved to the compiler. The JSON index operator needs to be a first class operator, and the PG and MySQL dialects will need to handle rendering using a `visit_json_getitem_binary` operator; additionally, the value passed to the index needs to be assembled into a `ClauseList` if it is in fact a list of pathed items, in the same way that the IN operator works (though this will occur wihtin sqltypes.JSON.Comparator._setup_getitem. (more to come) |