Hi everyone,

I used the sprints at DjangoCon US to work on this issue in form of a 
third-party package. Mainly, I created a subclass of 
django.contrib.postgres.fields.JSONField that

   - includes code from django-mysql to work on MySQL 5.7+ as well
   - does some nasty hacks to even work on MariaDB 10.2.7+
   - gracefully falls back to storing JSON strings in a TextField on all 
   other databases

Unfortunately, the differences between the JSON implementations (especially 
between MariaDB and MySQL) seem to be quite large. Since my primary 
objective was to prove that it is possible to create a multi-database 
field, I resolved this mostly with some back-and-forth data conversion 
hacks, instead of searching for a clean solution. Not all features of the 
PostgreSQL version are possible on MySQL/MariaDB, but the most useful ones 
all are.

This would probably need a lot of cleaning up before considering to move it 
to Django core, and you'd likely also want to explore integrating 
Oracle/SQLite for that. I will probably not have time to do that, but if 
someone else wants to, this might provide a starting point.

Here's the repository: https://github.com/raphaelm/django-jsonfallback

Best
Raphael

P.S. Thanks to all organizers and attendees for an amazing conference <3

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/330b1ade-ab27-4135-9952-d6a188789c31%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to