You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would be nice to have it available in sqlalchemy.dialects.mysql, in the same way its PostgreSQL counterpart can be imported from sqlalchemy.dialects.postgresql.
I wouldn't mind working on the implementation, if given the required elements (some exceptions are poorly documented, e.g.: sqlalchemy.exc.CompileError: (in table 'entities', column 'data'): Compiler <sqlalchemy.dialects.mysql.base.MySQLTypeCompiler object at 0x7f1fcd4a0d10> can't render element of type <class '__main__.JSON'> ).
Added :class:.mysql.JSON for MySQL 5.7. The JSON type provides
persistence of JSON values in MySQL as well as basic operator support
of "getitem" and "getpath", making use of the JSON_EXTRACT
function in order to refer to individual paths in a JSON structure.
fixes MySQL 5.7 JSON type support #3547
Added a new type to core :class:.types.JSON. This is the
base of the PostgreSQL :class:.postgresql.JSON type as well as that
of the new :class:.mysql.JSON type, so that a PG/MySQL-agnostic
JSON column may be used. The type features basic index and path
searching support.
fixes base JSON type + unification across pg/mysql #3619
reorganization of migration docs etc. to try to refer both to
the fixes to JSON that helps Postgresql while at the same time
indicating these are new features of the new base JSON type.
a rework of the Array/Indexable system some more, moving things
that are specific to Array out of Indexable.
new operators for JSON indexing added to core so that these can
be compiled by the PG and MySQL dialects individually
rename sqltypes.Array to sqltypes.ARRAY - as there is no generic
Array implementation, this is an uppercase type for now, consistent
with the new sqltypes.JSON type that is also not a generic implementation.
There may need to be some convention change to handle the case of
datatypes that aren't generic, rely upon DB-native implementations,
but aren't necessarily all named the same thing.
Activity
sqlalchemy-bot commentedon Oct 2, 2015
Michael Bayer (@zzzeek) wrote:
1.1 is tentative here but sure, the implementation is quite simple just imitate what you see at https://bitbucket.org/zzzeek/sqlalchemy/src/ac08920284935e7e7519ce77ba369703390155dc/lib/sqlalchemy/dialects/postgresql/json.py?at=master&fileviewer=file-view-default. However the PR must have tests in test/dialect/mysql/test_types.py, at least database round trip tests.
sqlalchemy-bot commentedon Oct 2, 2015
Changes by Michael Bayer (@zzzeek):
sqlalchemy-bot commentedon Oct 5, 2015
Mathieu Rodic wrote:
Woking on it ([see fork)(https://github.com/mathieurodic/sqlalchemy)):
[]operator implementation, which can be tricky as MySQL implements it as a function.sqlalchemy-bot commentedon Dec 1, 2015
Stephen Rauch (@stephenrauch) wrote:
What is the status of this?
sqlalchemy-bot commentedon Dec 9, 2015
Stephen Rauch (@stephenrauch) wrote:
Just pushed some code in support of this ticket.
zzzeek/sqlalchemy#221
sqlalchemy-bot commentedon Dec 9, 2015
Michael Bayer (@zzzeek) wrote:
that is impressive. i'll have to take a detailed look at it thanks!
sqlalchemy-bot commentedon Dec 28, 2015
Changes by Michael Bayer (@zzzeek):
sqlalchemy-bot commentedon Jan 6, 2016
Michael Bayer (@zzzeek) wrote:
.mysql.JSONfor MySQL 5.7. The JSON type providespersistence of JSON values in MySQL as well as basic operator support
of "getitem" and "getpath", making use of the
JSON_EXTRACTfunction in order to refer to individual paths in a JSON structure.
fixes MySQL 5.7 JSON type support #3547
.types.JSON. This is thebase of the PostgreSQL :class:
.postgresql.JSONtype as well as thatof the new :class:
.mysql.JSONtype, so that a PG/MySQL-agnosticJSON column may be used. The type features basic index and path
searching support.
fixes base JSON type + unification across pg/mysql #3619
the fixes to JSON that helps Postgresql while at the same time
indicating these are new features of the new base JSON type.
that are specific to Array out of Indexable.
be compiled by the PG and MySQL dialects individually
Array implementation, this is an uppercase type for now, consistent
with the new sqltypes.JSON type that is also not a generic implementation.
There may need to be some convention change to handle the case of
datatypes that aren't generic, rely upon DB-native implementations,
but aren't necessarily all named the same thing.
→ a80bb4e
sqlalchemy-bot commentedon Jan 6, 2016
Changes by Michael Bayer (@zzzeek):