@514labs/moose-lib 0.6.297-ci-24-g9a20c7e5 → 0.6.297-ci-30-g6530526d

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/index.js CHANGED
@@ -2481,6 +2481,13 @@ var init_etlPipeline = __esm({
2481
2481
  });
2482
2482
 
2483
2483
  // src/dmv2/sdk/materializedView.ts
2484
+ function formatTableReference(table) {
2485
+ const database = table instanceof OlapTable ? table.config.database : void 0;
2486
+ if (database) {
2487
+ return `\`${database}\`.\`${table.name}\``;
2488
+ }
2489
+ return `\`${table.name}\``;
2490
+ }
2484
2491
  var requireTargetTableName, MaterializedView;
2485
2492
  var init_materializedView = __esm({
2486
2493
  "src/dmv2/sdk/materializedView.ts"() {
@@ -2539,7 +2546,9 @@ var init_materializedView = __esm({
2539
2546
  this.name = options.materializedViewName;
2540
2547
  this.targetTable = targetTable;
2541
2548
  this.selectSql = selectStatement;
2542
- this.sourceTables = options.selectTables.map((t) => t.name);
2549
+ this.sourceTables = options.selectTables.map(
2550
+ (t) => formatTableReference(t)
2551
+ );
2543
2552
  this.metadata = options.metadata ? { ...options.metadata } : {};
2544
2553
  if (!this.metadata.source) {
2545
2554
  const stack = new Error().stack;
@@ -2622,11 +2631,19 @@ var init_sqlResource = __esm({
2622
2631
  });
2623
2632
 
2624
2633
  // src/dmv2/sdk/view.ts
2634
+ function formatTableReference2(table) {
2635
+ const database = table instanceof OlapTable ? table.config.database : void 0;
2636
+ if (database) {
2637
+ return `\`${database}\`.\`${table.name}\``;
2638
+ }
2639
+ return `\`${table.name}\``;
2640
+ }
2625
2641
  var View;
2626
2642
  var init_view = __esm({
2627
2643
  "src/dmv2/sdk/view.ts"() {
2628
2644
  "use strict";
2629
2645
  init_sqlHelpers();
2646
+ init_olapTable();
2630
2647
  init_internal();
2631
2648
  init_stackTrace();
2632
2649
  View = class {
@@ -2653,7 +2670,7 @@ var init_view = __esm({
2653
2670
  }
2654
2671
  this.name = name;
2655
2672
  this.selectSql = selectStatement;
2656
- this.sourceTables = baseTables.map((t) => t.name);
2673
+ this.sourceTables = baseTables.map((t) => formatTableReference2(t));
2657
2674
  this.metadata = metadata ? { ...metadata } : {};
2658
2675
  if (!this.metadata.source) {
2659
2676
  const stack = new Error().stack;