@514labs/moose-lib 0.6.297-ci-22-g1be0de24 → 0.6.297-ci-23-g751e4221
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-CkQfVyoI.d.mts → browserCompatible-CkJwv4dC.d.mts} +1 -1
- package/dist/{browserCompatible-CprLtYmW.d.ts → browserCompatible-Dqfdy6x5.d.ts} +1 -1
- package/dist/browserCompatible.d.mts +2 -2
- package/dist/browserCompatible.d.ts +2 -2
- package/dist/browserCompatible.js +22 -9
- package/dist/browserCompatible.js.map +1 -1
- package/dist/browserCompatible.mjs +22 -9
- package/dist/browserCompatible.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 +22 -9
- package/dist/dmv2/index.js.map +1 -1
- package/dist/dmv2/index.mjs +22 -9
- package/dist/dmv2/index.mjs.map +1 -1
- package/dist/{index-9XL-mk89.d.mts → index-CdKEq7FH.d.mts} +16 -5
- package/dist/{index-9XL-mk89.d.ts → index-CdKEq7FH.d.ts} +16 -5
- package/dist/index.d.mts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +22 -9
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +22 -9
- package/dist/index.mjs.map +1 -1
- package/dist/moose-runner.js +2 -2
- package/dist/moose-runner.js.map +1 -1
- package/dist/moose-runner.mjs +2 -2
- package/dist/moose-runner.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -2492,8 +2492,8 @@ var init_materializedView = __esm({
|
|
|
2492
2492
|
selectSql;
|
|
2493
2493
|
/** Names of source tables that the SELECT reads from */
|
|
2494
2494
|
sourceTables;
|
|
2495
|
-
/**
|
|
2496
|
-
|
|
2495
|
+
/** Optional metadata for the materialized view */
|
|
2496
|
+
metadata;
|
|
2497
2497
|
constructor(options, targetSchema, targetColumns) {
|
|
2498
2498
|
let selectStatement = options.selectStatement;
|
|
2499
2499
|
if (typeof selectStatement !== "string") {
|
|
@@ -2524,8 +2524,14 @@ var init_materializedView = __esm({
|
|
|
2524
2524
|
this.targetTable = targetTable;
|
|
2525
2525
|
this.selectSql = selectStatement;
|
|
2526
2526
|
this.sourceTables = options.selectTables.map((t) => t.name);
|
|
2527
|
-
|
|
2528
|
-
this.
|
|
2527
|
+
this.metadata = options.metadata ? { ...options.metadata } : {};
|
|
2528
|
+
if (!this.metadata.source) {
|
|
2529
|
+
const stack = new Error().stack;
|
|
2530
|
+
const sourceInfo = getSourceFileFromStack(stack);
|
|
2531
|
+
if (sourceInfo) {
|
|
2532
|
+
this.metadata.source = { file: sourceInfo };
|
|
2533
|
+
}
|
|
2534
|
+
}
|
|
2529
2535
|
const materializedViews = getMooseInternal().materializedViews;
|
|
2530
2536
|
if (!isClientOnlyMode() && materializedViews.has(this.name)) {
|
|
2531
2537
|
throw new Error(`MaterializedView with name ${this.name} already exists`);
|
|
@@ -2616,23 +2622,30 @@ var init_view = __esm({
|
|
|
2616
2622
|
selectSql;
|
|
2617
2623
|
/** Names of source tables/views that the SELECT reads from */
|
|
2618
2624
|
sourceTables;
|
|
2619
|
-
/**
|
|
2620
|
-
|
|
2625
|
+
/** Optional metadata for the view */
|
|
2626
|
+
metadata;
|
|
2621
2627
|
/**
|
|
2622
2628
|
* Creates a new View instance.
|
|
2623
2629
|
* @param name The name of the view to be created.
|
|
2624
2630
|
* @param selectStatement The SQL SELECT statement that defines the view's logic.
|
|
2625
2631
|
* @param baseTables An array of OlapTable or View objects that the `selectStatement` reads from. Used for dependency tracking.
|
|
2632
|
+
* @param metadata Optional metadata for the view (e.g., description, source file).
|
|
2626
2633
|
*/
|
|
2627
|
-
constructor(name, selectStatement, baseTables) {
|
|
2634
|
+
constructor(name, selectStatement, baseTables, metadata) {
|
|
2628
2635
|
if (typeof selectStatement !== "string") {
|
|
2629
2636
|
selectStatement = toStaticQuery(selectStatement);
|
|
2630
2637
|
}
|
|
2631
2638
|
this.name = name;
|
|
2632
2639
|
this.selectSql = selectStatement;
|
|
2633
2640
|
this.sourceTables = baseTables.map((t) => t.name);
|
|
2634
|
-
|
|
2635
|
-
this.
|
|
2641
|
+
this.metadata = metadata ? { ...metadata } : {};
|
|
2642
|
+
if (!this.metadata.source) {
|
|
2643
|
+
const stack = new Error().stack;
|
|
2644
|
+
const sourceInfo = getSourceFileFromStack(stack);
|
|
2645
|
+
if (sourceInfo) {
|
|
2646
|
+
this.metadata.source = { file: sourceInfo };
|
|
2647
|
+
}
|
|
2648
|
+
}
|
|
2636
2649
|
const customViews = getMooseInternal().customViews;
|
|
2637
2650
|
if (!isClientOnlyMode() && customViews.has(this.name)) {
|
|
2638
2651
|
throw new Error(`View with name ${this.name} already exists`);
|