@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.js
CHANGED
|
@@ -451,6 +451,22 @@ var handleDefault = (t, checker) => {
|
|
|
451
451
|
}
|
|
452
452
|
return defaultType.value;
|
|
453
453
|
};
|
|
454
|
+
var handleMaterialized = (t, checker) => {
|
|
455
|
+
const materializedType = getTaggedType(
|
|
456
|
+
t,
|
|
457
|
+
checker,
|
|
458
|
+
"_clickhouse_materialized"
|
|
459
|
+
);
|
|
460
|
+
if (materializedType === null) {
|
|
461
|
+
return null;
|
|
462
|
+
}
|
|
463
|
+
if (!materializedType.isStringLiteral()) {
|
|
464
|
+
throw new UnsupportedFeature(
|
|
465
|
+
'ClickHouseMaterialized must use a string literal, e.g. ClickHouseMaterialized<"toDate(timestamp)">'
|
|
466
|
+
);
|
|
467
|
+
}
|
|
468
|
+
return materializedType.value;
|
|
469
|
+
};
|
|
454
470
|
var handleTtl = (t, checker) => {
|
|
455
471
|
const ttlType = getTaggedType(t, checker, "_clickhouse_ttl");
|
|
456
472
|
if (ttlType === null) {
|
|
@@ -941,13 +957,21 @@ var toColumns = (t, checker) => {
|
|
|
941
957
|
isJwt,
|
|
942
958
|
node?.type
|
|
943
959
|
);
|
|
960
|
+
const defaultValue = defaultExpression ?? handleDefault(type, checker);
|
|
961
|
+
const materializedValue = handleMaterialized(type, checker);
|
|
962
|
+
if (defaultValue && materializedValue) {
|
|
963
|
+
throw new UnsupportedFeature(
|
|
964
|
+
`Column '${prop.name}' cannot have both ClickHouseDefault and ClickHouseMaterialized. Use one or the other.`
|
|
965
|
+
);
|
|
966
|
+
}
|
|
944
967
|
return {
|
|
945
968
|
name: prop.name,
|
|
946
969
|
data_type: dataType,
|
|
947
970
|
primary_key: isKey,
|
|
948
971
|
required: !nullable,
|
|
949
972
|
unique: false,
|
|
950
|
-
default:
|
|
973
|
+
default: defaultValue,
|
|
974
|
+
materialized: materializedValue,
|
|
951
975
|
ttl: handleTtl(type, checker),
|
|
952
976
|
codec: handleCodec(type, checker),
|
|
953
977
|
annotations
|