Skip to content

Commit 11ed70a

Browse files
authored
HCK-12180: implement RE of JSON data type from instance (#143)
* HCK-12180: implement RE of JSON data type from instance * Disable not supported subtypes
1 parent c7ae288 commit 11ed70a

File tree

5 files changed

+7
-31
lines changed

5 files changed

+7
-31
lines changed

properties_pane/field_level/fieldLevelConfig.json

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -5147,22 +5147,6 @@ making sure that you maintain a proper JSON format.
51475147
{
51485148
"name": "array",
51495149
"value": "array"
5150-
},
5151-
{
5152-
"name": "string",
5153-
"value": "string"
5154-
},
5155-
{
5156-
"name": "number",
5157-
"value": "number"
5158-
},
5159-
{
5160-
"name": "boolean",
5161-
"value": "boolean"
5162-
},
5163-
{
5164-
"name": "null",
5165-
"value": "null"
51665150
}
51675151
],
51685152
"defaultValue": "object"

reverse_engineering/reverseEngineeringService/helpers/containsJson.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
const containsJson = ({ tableInfo }) =>
22
tableInfo.some(item => {
3+
if (item['DATA_TYPE'] === 'json') {
4+
return true;
5+
}
6+
37
if (item['DATA_TYPE'] !== 'nvarchar') {
48
return false;
59
}

reverse_engineering/reverseEngineeringService/helpers/defineJSONTypes.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ const defineType = value => {
1616
};
1717

1818
const handleField = (name, properties, cellValue) => {
19-
if (!cellValue || properties.mode !== 'nvarchar') {
19+
if (!cellValue || (properties.mode !== 'nvarchar' && properties.type !== 'json')) {
2020
return { [name]: properties };
2121
}
2222

@@ -68,7 +68,7 @@ const defineJSONTypes = row => jsonSchema => {
6868
};
6969

7070
const getColumnValue = (firstRow, fieldName, fieldProperties, rows) => {
71-
if (!['varchar', 'nvarchar'].includes(fieldProperties.mode)) {
71+
if (!['varchar', 'nvarchar', 'json'].includes(fieldProperties.mode)) {
7272
return firstRow[fieldName];
7373
}
7474
const complexValueRow = rows.find(row => {

reverse_engineering/reverseEngineeringService/helpers/reverseTableColumn.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ const handleType = type => {
3939
case 'xml':
4040
case 'cursor':
4141
case 'rowversion':
42-
return { type };
42+
case 'json':
4343
default:
4444
return { type };
4545
}

types/json.json

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -24,18 +24,6 @@
2424
"array": {
2525
"parentType": "jsonArray",
2626
"childValueType": ["jsonString", "jsonNumber", "jsonObject", "jsonArray", "jsonBoolean", "jsonNull"]
27-
},
28-
"string": {
29-
"parentType": "jsonString"
30-
},
31-
"number": {
32-
"parentType": "jsonNumber"
33-
},
34-
"boolean": {
35-
"parentType": "jsonBoolean"
36-
},
37-
"null": {
38-
"parentType": "jsonNull"
3927
}
4028
},
4129
"dependency": {

0 commit comments

Comments
 (0)