edelooff / sqlalchemy-json

Full-featured JSON type with mutation tracking for SQLAlchemy
http://variable-scope.com/posts/mutation-tracking-in-nested-json-structures-using-sqlalchemy
BSD 2-Clause "Simplified" License
189 stars 34 forks source link

Switch to sqlalchemy.types.JSON #23

Closed morganchristiansson closed 4 years ago

morganchristiansson commented 4 years ago

Per #22 and https://github.com/kvesteri/sqlalchemy-utils/issues/164#issuecomment-171681943 sqlalchemy_utils.types.json.JSONType is not to be used anymore

edelooff commented 4 years ago

Using the native type sounds like the correct change to make (as of a few years). Anyone not on an SQLAlchemy version that supports it should seriously consider updating to that.

There's a few references to sqlalchemy-utils in the documentation and dependencies which would need to be cleaned up if we actually remove the use of/dependency on sqla-utils. If you could update those this should be ready to go.

morganchristiansson commented 4 years ago

@edelooff Awesome. I added another commit and bumped version to 0.3.0.

I was wondering if updating the parent class/type will cause issues with alembic autogenerate but it only looks at MutableJson class doesn't it.

morganchristiansson commented 4 years ago

Forgot to mention that this is to allow using sqlalchemy-json with MySQL 5.7+ JSON columns which today is not supported.

morganchristiansson commented 4 years ago

@edelooff Any thoughts on this? It seems safe to proceed.

Btw please excuse my python - I'm the devops/cloud engineer in my team. I'll further update as we make use of sqlalchemy-json.

edelooff commented 4 years ago

Hey @morganchristiansson, apologies for the delay in merging this. The changes look complete and pretty functional. Alembic migrations pick up the applicable NestedMutable type rather then the actual underlying type. Whether that's a wart or a feature is for everyone else to decide :-)

morganchristiansson commented 4 years ago

Thanks. Looking forward to using 0.3.0 instead of my fork in my apps requirements.txt

Also I noticed I added 0.3.0 changelog entry between 0.2.1 and 0.2.2

I pushed commit to fix please merge https://github.com/morganchristiansson/sqlalchemy-json opened PR #24