[META] Add support for JSON field queries in entity queries

Created on 23 April 2022, over 2 years ago
Updated 10 January 2024, 12 months ago

Problem/Motivation

Both Postgres and MySQL/MariaDB now support JSON fields, and adding a field backed by this field type is trivial enough, e.g. with json_field module.

However, I don't believe there's any way to query data in these fields with the entity query DBAL. This would likely require implementation of the requisite syntax in the respective database driver modules, which have been split into their own modules in Drupal 9.4.

There are definitely advantages to JSON storage of data that may currently be serialzied (e.g., πŸ“Œ Move from serialized columns to JSON encoded data wherever possible, or use allowed_classes Active ) but IMHO querying is the real killer feature. Data in these fields could store information similar to what you may store in a NoSQL database, but without having to employ a totally separate NoSQL backend such as MongoDB. Because Drupal's ORM is very much relational (at least for the forseeable future), being able to selectively employ JSON queries would be a huge gain.

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

✨ Feature request
Status

Closed: duplicate

Version

11.0 πŸ”₯

Component
DatabaseΒ  β†’

Last updated 2 days ago

  • Maintained by
  • πŸ‡³πŸ‡±Netherlands @daffie
Created by

πŸ‡ΊπŸ‡ΈUnited States bradjones1 Digital Nomad Life

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024