GEOLYTIX / xyz

An open source javascript framework for spatial data and application interfaces.
MIT License
86 stars 25 forks source link

jsonb location update and infoj #1270

Closed dbauszus-glx closed 1 month ago

dbauszus-glx commented 1 month ago

By defining a jsonb_field and jsonb_key it should be possible to update the a key value in a json field by casting the new key value.

The fieldfx can retrieve a single value.

The field must be unique for lookup of the value returned.

{
  "title": "Age",
  "field": "json_field_age",
  "fieldfx": "json_field -> 'age'",
  "jsonb_field": "json_field",
  "jsonb_key": "age",
  "edit": true,
  "inline": true
}

The location update will create a jsonb object with the field, key, and value to update.

The location_update query can create a coalesce update statement for the field.

The infoj must transform the value object from the newValue object into a simple value.

AlexanderGeere commented 1 month ago

@dbauszus-glx I changed it slightly to allow you to update multiple keys in the field at once. Works in the infoj and in the table for me in this state.

sonarcloud[bot] commented 1 month ago

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

dbauszus-glx commented 1 month ago

https://github.com/GEOLYTIX/xyz/wiki/Workspace-Configuration/8e718e9abb0b4b19ae48dcf1853822d12cfe297a#jsonb_field--jsonb_key