Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for JSON opaque Values #1364

Open
altmannmarcelo opened this issue Aug 30, 2024 · 0 comments
Open

Support for JSON opaque Values #1364

altmannmarcelo opened this issue Aug 30, 2024 · 0 comments
Labels
Medium priority Created by Linear-GitHub Sync
Milestone

Comments

@altmannmarcelo
Copy link
Contributor

Description

We need to add support for JSON opaque values. The current code assumed if we fail to serialize a json value to serde_json due to Opaque value, we would receive the opaque value as part of the error, which is not the case and we should manually parse each element of the json object and correctly serialize opaque values depending on their type.

DROP TABLE IF EXISTS j_test;
CREATE TABLE j_test (
  id INT NOT NULL AUTO_INCREMENT,
  j_field JSON NOT NULL,
  updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (id)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
INSERT INTO j_test (id, j_field, updated_at) VALUES (6, '{"order": {"orderId": 56789, "date": "2024-08-28", "items": [{"productId": 101, "quantity": 2, "price": 19.99}, {"productId": 202, "quantity": 1, "price": 49.99}], "totalAmount": 89.97}}', '2024-08-29 12:35:01');

-- snapshot
UPDATE j_test SET j_field = JSON_SET(j_field, '$.order.items[0].price', 24.99) WHERE id = 6;

Change in user-visible behavior

Requires documentation change

@altmannmarcelo altmannmarcelo added this to the v.41 milestone Sep 5, 2024
@altmannmarcelo altmannmarcelo added the Medium priority Created by Linear-GitHub Sync label Sep 5, 2024
@altmannmarcelo altmannmarcelo modified the milestones: v.41, v.42 Sep 9, 2024
@altmannmarcelo altmannmarcelo modified the milestones: v.42, v.43, v.44 Sep 16, 2024
@altmannmarcelo altmannmarcelo modified the milestones: v.44, v.45 Sep 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Medium priority Created by Linear-GitHub Sync
Projects
None yet
Development

No branches or pull requests

1 participant