@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/dmv2/index.mjs
CHANGED
|
@@ -2477,8 +2477,8 @@ var init_materializedView = __esm({
|
|
|
2477
2477
|
selectSql;
|
|
2478
2478
|
/** Names of source tables that the SELECT reads from */
|
|
2479
2479
|
sourceTables;
|
|
2480
|
-
/**
|
|
2481
|
-
|
|
2480
|
+
/** Optional metadata for the materialized view */
|
|
2481
|
+
metadata;
|
|
2482
2482
|
constructor(options, targetSchema, targetColumns) {
|
|
2483
2483
|
let selectStatement = options.selectStatement;
|
|
2484
2484
|
if (typeof selectStatement !== "string") {
|
|
@@ -2509,8 +2509,14 @@ var init_materializedView = __esm({
|
|
|
2509
2509
|
this.targetTable = targetTable;
|
|
2510
2510
|
this.selectSql = selectStatement;
|
|
2511
2511
|
this.sourceTables = options.selectTables.map((t) => t.name);
|
|
2512
|
-
|
|
2513
|
-
this.
|
|
2512
|
+
this.metadata = options.metadata ? { ...options.metadata } : {};
|
|
2513
|
+
if (!this.metadata.source) {
|
|
2514
|
+
const stack = new Error().stack;
|
|
2515
|
+
const sourceInfo = getSourceFileFromStack(stack);
|
|
2516
|
+
if (sourceInfo) {
|
|
2517
|
+
this.metadata.source = { file: sourceInfo };
|
|
2518
|
+
}
|
|
2519
|
+
}
|
|
2514
2520
|
const materializedViews = getMooseInternal().materializedViews;
|
|
2515
2521
|
if (!isClientOnlyMode() && materializedViews.has(this.name)) {
|
|
2516
2522
|
throw new Error(`MaterializedView with name ${this.name} already exists`);
|
|
@@ -2601,23 +2607,30 @@ var init_view = __esm({
|
|
|
2601
2607
|
selectSql;
|
|
2602
2608
|
/** Names of source tables/views that the SELECT reads from */
|
|
2603
2609
|
sourceTables;
|
|
2604
|
-
/**
|
|
2605
|
-
|
|
2610
|
+
/** Optional metadata for the view */
|
|
2611
|
+
metadata;
|
|
2606
2612
|
/**
|
|
2607
2613
|
* Creates a new View instance.
|
|
2608
2614
|
* @param name The name of the view to be created.
|
|
2609
2615
|
* @param selectStatement The SQL SELECT statement that defines the view's logic.
|
|
2610
2616
|
* @param baseTables An array of OlapTable or View objects that the `selectStatement` reads from. Used for dependency tracking.
|
|
2617
|
+
* @param metadata Optional metadata for the view (e.g., description, source file).
|
|
2611
2618
|
*/
|
|
2612
|
-
constructor(name, selectStatement, baseTables) {
|
|
2619
|
+
constructor(name, selectStatement, baseTables, metadata) {
|
|
2613
2620
|
if (typeof selectStatement !== "string") {
|
|
2614
2621
|
selectStatement = toStaticQuery(selectStatement);
|
|
2615
2622
|
}
|
|
2616
2623
|
this.name = name;
|
|
2617
2624
|
this.selectSql = selectStatement;
|
|
2618
2625
|
this.sourceTables = baseTables.map((t) => t.name);
|
|
2619
|
-
|
|
2620
|
-
this.
|
|
2626
|
+
this.metadata = metadata ? { ...metadata } : {};
|
|
2627
|
+
if (!this.metadata.source) {
|
|
2628
|
+
const stack = new Error().stack;
|
|
2629
|
+
const sourceInfo = getSourceFileFromStack(stack);
|
|
2630
|
+
if (sourceInfo) {
|
|
2631
|
+
this.metadata.source = { file: sourceInfo };
|
|
2632
|
+
}
|
|
2633
|
+
}
|
|
2621
2634
|
const customViews = getMooseInternal().customViews;
|
|
2622
2635
|
if (!isClientOnlyMode() && customViews.has(this.name)) {
|
|
2623
2636
|
throw new Error(`View with name ${this.name} already exists`);
|