thanks, indeed mysql 8 reorders the keys
https://stackoverflow.com/a/48382771
On Wed, Jan 6, 2021, at 11:10 AM, yoch@gmail.com wrote:
> Thank you for your answer.
>
> I'm using MySQL 8 with pymysql.
>
> The `data` column has JSON type, and it seems that MySQL is actually
> reordering
Thank you for your answer.
I'm using MySQL 8 with pymysql.
The `data` column has JSON type, and it seems that MySQL is actually
reordering keys.
Le mercredi 6 janvier 2021 à 15:31:49 UTC+2, Mike Bayer a écrit :
> perhaps Python's json encoder does not maintain ordering? I don't know
>
perhaps Python's json encoder does not maintain ordering? I don't know
either. Can you set echo='debug' on your create_engine() and examine the
parameters being passed as well as the data being returned? also I'm not
seeing which database backend or driver you're using which may be
the reason Alembic puts env.py into your project, rather than having this just
be part of Alembic, is so that you can customize it as needed, so it sounds
like for everything you're doing you want to be inside of env.py making those
changes.
On Wed, Jan 6, 2021, at 1:43 AM, Nikola Radovanovic
Hi,
I have a problem with a custom JSON type, which is not preserving keys
order, despite that I'm using python 3.8.
Here is the type definition and usage:
```
import json
from sqlalchemy import Column, Integer
from sqlalchemy.types import TypeDecorator, TEXT
from sqlalchemy.ext.mutable import