Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 293641

PostgreSQL: Support JSON data type

$
0
0

Problem/Motivation

I am trying to create a field type that leverages the JSON and JSONB data types in Postgres. My goal is to have a field that can store JSON objects who's properties can be indexed. This is a Postgres specific feature.

Proposed resolution

Add json:normal and jsonb:normal mapped to json and jsonb Drupal field types for pgsql driver, Schema::getFieldTypeMap().

'json:normal' => 'json',
      'jsonb:normal' => 'jsonb',
      );
    return $map;
  }

Remaining tasks

  • Review field type map and approach

Data model changes

json and jsonb field types are available for use in schema for pgsql driver.

Release notes snippet

Basically I want to be able to paste JSON or parse a CSV with another custom module and store the object in this field with the intent of being able to query this data, treating it like a NoSQL store. Since Mongo isn't fully implemented, and would require two databases running instead of one, Postgres seems like a natural fit.


Viewing all articles
Browse latest Browse all 293641

Trending Articles