Implementing a Cross-DB JSONField
summary
Implements a cross-DB JSONField that lands in Django 3.1, showing a tiny TextField-based proof-of-concept, then the real implementation that maps per-backend types and CHECKs in DatabaseWrapper. Covers Postgres json/jsonb, MySQL binary JSON, MariaDB aliasing to LONGTEXT, SQLiteβs JSON1 functions, and Oracle VARCHAR/LOB; explains lookup SQL (->, #>, JSON_EXTRACT/UNQUOTE, JSON_VALUE/JSON_QUERY) and which lookups are unsupported on SQLite/Oracle (contains). Explains the JSON null vs SQL NULL gotcha, using Value wrappers and callable defaults, and advertises django-jsonfield-backport for older Django.
AI-written summary Β· about
