JsonField in Django for MySQL

7.2k views Asked by At

I currently use django 3.2 and MySQL as database, I want use MySql Json Field. For this reason use django-mysql third party package in my project. After create model got this Warning: (django_mysql.W004) django_mysql.models.JSONField is deprecated. HINT: Use django.db.models.JSONField or django-jsonfield-backport instead. If i use django.db.models.JSONField as json field, django use specific MySQL's JsonField ? Dose any effect on preformance? Which one has best performance on database?

1

There are 1 answers

0
Sırrı Kırımlıoğlu On

The documentation here, does not mention a difference in performance. So, probably there is none. It looks like the change is only for supporting all databases with the same unique model field. There is a similar issue in this link. So, you can check that, too. As I read, django-jsonfield-backport is for early versions of Django. So, choose according to your version.