@514labs/moose-lib 0.6.247 → 0.6.248-ci-1-g620909c2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{browserCompatible-CwNwv0e0.d.mts → browserCompatible-CYDIQRRZ.d.mts} +26 -2
- package/dist/{browserCompatible-2eoeppzc.d.ts → browserCompatible-C_H_-QHB.d.ts} +26 -2
- package/dist/browserCompatible.d.mts +2 -2
- package/dist/browserCompatible.d.ts +2 -2
- package/dist/browserCompatible.js +10 -5
- package/dist/browserCompatible.js.map +1 -1
- package/dist/browserCompatible.mjs +10 -5
- package/dist/browserCompatible.mjs.map +1 -1
- package/dist/compilerPlugin.js +25 -1
- package/dist/compilerPlugin.js.map +1 -1
- package/dist/compilerPlugin.mjs +25 -1
- package/dist/compilerPlugin.mjs.map +1 -1
- package/dist/dataModels/toDataModels.js +25 -1
- package/dist/dataModels/toDataModels.js.map +1 -1
- package/dist/dataModels/toDataModels.mjs +25 -1
- package/dist/dataModels/toDataModels.mjs.map +1 -1
- package/dist/dmv2/index.d.mts +1 -1
- package/dist/dmv2/index.d.ts +1 -1
- package/dist/dmv2/index.js +10 -5
- package/dist/dmv2/index.js.map +1 -1
- package/dist/dmv2/index.mjs +10 -5
- package/dist/dmv2/index.mjs.map +1 -1
- package/dist/{index-bZEbqrMe.d.mts → index-xC52kbse.d.mts} +102 -1
- package/dist/{index-bZEbqrMe.d.ts → index-xC52kbse.d.ts} +102 -1
- package/dist/index.d.mts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +11 -5
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +11 -5
- package/dist/index.mjs.map +1 -1
- package/dist/moose-runner.js +15 -0
- package/dist/moose-runner.js.map +1 -1
- package/dist/moose-runner.mjs +15 -0
- package/dist/moose-runner.mjs.map +1 -1
- package/package.json +1 -1
package/dist/compilerPlugin.mjs
CHANGED
|
@@ -421,6 +421,22 @@ var handleDefault = (t, checker) => {
|
|
|
421
421
|
}
|
|
422
422
|
return defaultType.value;
|
|
423
423
|
};
|
|
424
|
+
var handleMaterialized = (t, checker) => {
|
|
425
|
+
const materializedType = getTaggedType(
|
|
426
|
+
t,
|
|
427
|
+
checker,
|
|
428
|
+
"_clickhouse_materialized"
|
|
429
|
+
);
|
|
430
|
+
if (materializedType === null) {
|
|
431
|
+
return null;
|
|
432
|
+
}
|
|
433
|
+
if (!materializedType.isStringLiteral()) {
|
|
434
|
+
throw new UnsupportedFeature(
|
|
435
|
+
'ClickHouseMaterialized must use a string literal, e.g. ClickHouseMaterialized<"toDate(timestamp)">'
|
|
436
|
+
);
|
|
437
|
+
}
|
|
438
|
+
return materializedType.value;
|
|
439
|
+
};
|
|
424
440
|
var handleTtl = (t, checker) => {
|
|
425
441
|
const ttlType = getTaggedType(t, checker, "_clickhouse_ttl");
|
|
426
442
|
if (ttlType === null) {
|
|
@@ -911,13 +927,21 @@ var toColumns = (t, checker) => {
|
|
|
911
927
|
isJwt,
|
|
912
928
|
node?.type
|
|
913
929
|
);
|
|
930
|
+
const defaultValue = defaultExpression ?? handleDefault(type, checker);
|
|
931
|
+
const materializedValue = handleMaterialized(type, checker);
|
|
932
|
+
if (defaultValue && materializedValue) {
|
|
933
|
+
throw new UnsupportedFeature(
|
|
934
|
+
`Column '${prop.name}' cannot have both ClickHouseDefault and ClickHouseMaterialized. Use one or the other.`
|
|
935
|
+
);
|
|
936
|
+
}
|
|
914
937
|
return {
|
|
915
938
|
name: prop.name,
|
|
916
939
|
data_type: dataType,
|
|
917
940
|
primary_key: isKey,
|
|
918
941
|
required: !nullable,
|
|
919
942
|
unique: false,
|
|
920
|
-
default:
|
|
943
|
+
default: defaultValue,
|
|
944
|
+
materialized: materializedValue,
|
|
921
945
|
ttl: handleTtl(type, checker),
|
|
922
946
|
codec: handleCodec(type, checker),
|
|
923
947
|
annotations
|