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

Add support for Oracle/PostgreSQL JSON validations #1338

Open
nj1973 opened this issue Nov 21, 2024 · 1 comment
Open

Add support for Oracle/PostgreSQL JSON validations #1338

nj1973 opened this issue Nov 21, 2024 · 1 comment
Labels
priority: p2 Medium priority. Fix may not be included in next release (e.g. minor documentation, cleanup) type: feature request 'Nice-to-have' improvement, new feature or different behavior or design.

Comments

@nj1973
Copy link
Contributor

nj1973 commented Nov 21, 2024

Test case

Oracle:

CREATE TABLE dvt_test.tab_json
(
  id VARCHAR2(10) NOT NULL PRIMARY KEY
, col_json1 CLOB
, col_json2 CLOB
);
ALTER TABLE dvt_test.tab_json ADD CONSTRAINT tab_json_chk1 CHECK (col_json1 IS JSON) ENABLE;
ALTER TABLE dvt_test.tab_json ADD CONSTRAINT tab_json_chk2 CHECK (col_json2 IS JSON) ENABLE;
INSERT INTO dvt_test.tab_json VALUES (1,'{"a": 1}','{"a": 1}');
COMMIT;

PostgreSQL:

CREATE TABLE dvt_test.tab_json
(
  id varchar(10) NOT NULL PRIMARY KEY
, col_json1 json
, col_json2 jsonb
);
INSERT INTO dvt_test.tab_json VALUES (1,'{"a": 1}','{"a": 1}');

Oracle uses CLOB/NCLOB columns for JSON data, we should be able to compare these with PostgreSQL JSON columns. At a minimum, for column validation, we should be able to compare by string length like we do for some other string columns.

We need to check all validation types. Search for "issue-1338" in the repo.

We might need to revert some of the changes from #1335.

@nj1973 nj1973 added the type: feature request 'Nice-to-have' improvement, new feature or different behavior or design. label Nov 21, 2024
@nj1973 nj1973 self-assigned this Nov 21, 2024
@nj1973 nj1973 removed their assignment Nov 21, 2024
@helensilva14 helensilva14 added the priority: p2 Medium priority. Fix may not be included in next release (e.g. minor documentation, cleanup) label Nov 25, 2024
@nj1973
Copy link
Contributor Author

nj1973 commented Nov 29, 2024

We should add json/jsonb columns to the pso_data_validator.dvt_pg_types test table.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: p2 Medium priority. Fix may not be included in next release (e.g. minor documentation, cleanup) type: feature request 'Nice-to-have' improvement, new feature or different behavior or design.
Projects
None yet
Development

No branches or pull requests

2 participants