Opened 14 months ago
Last modified 10 months ago
#35718 closed New feature
Some useful postgres functions for JSON are missing from contrib — at Initial Version
| Reported by: | john-parton | Owned by: | |
|---|---|---|---|
| Component: | Database layer (models, ORM) | Version: | dev | 
| Severity: | Normal | Keywords: | |
| Cc: | Sage Abdullah | Triage Stage: | Ready for checkin | 
| Has patch: | yes | Needs documentation: | no | 
| Needs tests: | no | Patch needs improvement: | no | 
| Easy pickings: | no | UI/UX: | no | 
Description
There's a large number of postgres-specific functions for manipulating json: https://www.postgresql.org/docs/current/functions-json.html
In my projects for work, I have created several:
- jsonb_build_object
- jsonb_build_array
- jsonb_array_elements
- jsonb_extract_path
- jsonb_extract_path_text
- jsonb_array_length
It would be nice if these were included in contrib.postgres.functions, ideally in a submodule like contrib.postgres.function.json to allow room to expand.
I know postgres's json support is a bit of test-bed for more fleshed out json support in general, but I would recommend just adding things as postgres-specific to limit the scope of the changes.
I can open a basic pull request.