Skip to content

Commit 6a5fdfa

Browse files
fix: normalized behavior in DTD, handled the polyglot derive
1 parent 6c5fc52 commit 6a5fdfa

File tree

6 files changed

+17
-9
lines changed

6 files changed

+17
-9
lines changed

forward_engineering/configs/descriptors.js

-3
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,4 @@ module.exports = {
231231
domain: {
232232
mode: 'domain',
233233
},
234-
vector: {
235-
mode: 'vector',
236-
},
237234
};

forward_engineering/ddlProvider/ddlHelpers/columnDefinitionHelper.js

+3-4
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,10 @@ const canHaveTimePrecision = type => ['time', 'timestamp'].includes(type);
5858
const canHaveScale = type => type === 'numeric';
5959
const canHaveTypeModifier = type => ['geography', 'geometry'].includes(type);
6060

61-
const isVector = type => type === 'vector';
61+
const isVector = type => ['vector', 'halfvec', 'sparsevec'].includes(type);
6262

6363
const decorateType = (type, columnDefinition) => {
64-
const { length, precision, scale, typeModifier, srid, timezone, timePrecision, dimension, subtype, array_type } =
64+
const { length, precision, scale, typeModifier, srid, timezone, timePrecision, dimension, array_type } =
6565
columnDefinition;
6666

6767
if (canHaveLength(type) && _.isNumber(length)) {
@@ -75,8 +75,7 @@ const decorateType = (type, columnDefinition) => {
7575
} else if (canHaveTimePrecision(type) && (_.isNumber(timePrecision) || timezone)) {
7676
type = addWithTimezone(addPrecision(type, timePrecision), timezone);
7777
} else if (isVector(type)) {
78-
const resolvedType = subtype || type;
79-
type = dimension ? decorateVector(resolvedType, dimension) : resolvedType;
78+
type = dimension ? decorateVector(type, dimension) : type;
8079
}
8180

8281
return addArrayDecorator(type, array_type);

forward_engineering/ddlProvider/ddlProvider.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -593,7 +593,7 @@ module.exports = (baseProvider, options, app) => {
593593

594594
return {
595595
name: columnDefinition.name,
596-
type: columnDefinition.type,
596+
type: jsonSchema.mode || jsonSchema.type,
597597
primaryKey: keyHelper.isInlinePrimaryKey(jsonSchema),
598598
primaryKeyOptions,
599599
unique: keyHelper.isInlineUnique(jsonSchema),

polyglot/adapter.json

+11
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,17 @@
124124
"to": {
125125
"mode": "point"
126126
}
127+
},
128+
{
129+
"from": {
130+
"type": "numeric"
131+
},
132+
"to": {
133+
"mode": "real"
134+
},
135+
"parent": {
136+
"type": "vector"
137+
}
127138
}
128139
]
129140
},

properties_pane/field_level/fieldLevelConfig.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -5610,7 +5610,7 @@ making sure that you maintain a proper JSON format.
56105610
"type",
56115611
{
56125612
"propertyName": "Subtype",
5613-
"propertyKeyword": "subtype",
5613+
"propertyKeyword": "mode",
56145614
"propertyType": "select",
56155615
"options": ["", "halfvec", "sparsevec"],
56165616
"cleanDependency": true

types/vector.json

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
"parentType": "array",
66
"useSample": false,
77
"hiddenOnEntity": "view",
8+
"restrictNormalization": true,
89
"defaultValues": {
910
"properties": [],
1011
"primaryKey": false,

0 commit comments

Comments
 (0)