[MDEV-7524] Add JSON_DECODE() function to decode a json string to a dynamic column structure Created: 2015-01-28  Updated: 2023-08-07  Resolved: 2023-08-07

Status: Closed
Project: MariaDB Server
Component/s: Dynamic Columns
Fix Version/s: N/A

Type: Task Priority: Minor
Reporter: Heinz Wiesinger Assignee: Unassigned
Resolution: Won't Do Votes: 2
Labels: None


 Description   

Dynamic column functionality includes a COLUMN_JSON() function to transform a dynamic column structure to a JSON string. It would be handy to also have a counterpart function that decodes a JSON string into a dynamic column structure. It could potentially be used like this

SELECT COLUMN_GET(JSON_DECODE('{"child_column":12345}'), 'child_column' AS int);
SELECT COLUMN_GET(COLUMN_GET(JSON_DECODE('{"parent_column":{"child_column":12345}}'), 'parent_column' AS char), 'child_column' AS int);

I currently store quite some JSON values as TEXT in tables, so alternatively this could also allow me to use JSON_DECODE() on INSERT to store it as a dynamic column structure directly.



 Comments   
Comment by Ralf Gebhardt [ 2023-08-07 ]

When working with JSON the JSON Type and JSON functions should now be used instead of Dynamic columns

Generated at Thu Feb 08 07:20:15 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.