#29821 closed New feature (duplicate)
Add JSONField for all supported DBs (and move into core).
Reported by: | Vackar Afzal | Owned by: | nobody |
---|---|---|---|
Component: | Database layer (models, ORM) | Version: | dev |
Severity: | Normal | Keywords: | Oracle Json |
Cc: | Triage Stage: | Accepted | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
Django has added JSONField for postgres databases.
Given that Oracle 12 now has native JSON columns, would be nice to expose this in a similar fashion.
I've provided a reference implementation [here https://github.com/Exscientia/oracle-json-field] and made it available via [pip https://pypi.org/project/oracle-json-field/]. It is based heavily on the Postgres implementation.
Note: In the reference implementation I have added a .filter_json()
method whose only purpose is to ensure that table names are aliased - an Oracle requirement for Json queries. If there is a cleaner way to force table names to be aliased then this can be removed, and give 100% feature parity with Django's core query API i.e. just use
MyModel.objects.filter(...)
Is this something that you would consider adding to the official Django project. If so please feel free to re-use any of the code from the reference implementation. Additionally I would be happy to create a pull-request if it makes integration easier.
Change History (4)
comment:1 by , 6 years ago
Summary: | Oracle Native JSON Field → Add JSONField for all supported DBs (and move into core). |
---|---|
Version: | 2.0 → master |
comment:2 by , 6 years ago
Triage Stage: | Unreviewed → Accepted |
---|
(I think this is legitimate, even if a DEP is needed before implementation. Thus Accepting. Please adjust if that's the wrong flow.)
comment:3 by , 6 years ago
Resolution: | → duplicate |
---|---|
Status: | new → closed |
Duplicate of #12990 which I reopened.
comment:4 by , 6 years ago
Thanks for the swift resolution on this, great to see that this may become part of the core.
Hi Vackar.
If you don't mind, I'm going to retitle this from "Oracle Native JSON Field".
Adding a JSONField for all DBs has been discussed on the mailing list a couple of times:
The main take-home there was:
This last is now viable on all supported DBs (I believe).
You've provided an example for Oracle. The Django django-mysql package does similar there.
(Is there an SQLite option yet?)
I think a candidate for inclusion in Django itself would need to handle all supported databases, rather than just the one.