@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.
@@ -2473,6 +2473,13 @@ var init_etlPipeline = __esm({
2473
2473
  });
2474
2474
 
2475
2475
  // src/dmv2/sdk/materializedView.ts
2476
+ function formatTableReference(table) {
2477
+ const database = table instanceof OlapTable ? table.config.database : void 0;
2478
+ if (database) {
2479
+ return `\`${database}\`.\`${table.name}\``;
2480
+ }
2481
+ return `\`${table.name}\``;
2482
+ }
2476
2483
  var requireTargetTableName, MaterializedView;
2477
2484
  var init_materializedView = __esm({
2478
2485
  "src/dmv2/sdk/materializedView.ts"() {
@@ -2531,7 +2538,9 @@ var init_materializedView = __esm({
2531
2538
  this.name = options.materializedViewName;
2532
2539
  this.targetTable = targetTable;
2533
2540
  this.selectSql = selectStatement;
2534
- this.sourceTables = options.selectTables.map((t) => t.name);
2541
+ this.sourceTables = options.selectTables.map(
2542
+ (t) => formatTableReference(t)
2543
+ );
2535
2544
  this.metadata = options.metadata ? { ...options.metadata } : {};
2536
2545
  if (!this.metadata.source) {
2537
2546
  const stack = new Error().stack;
@@ -2614,11 +2623,19 @@ var init_sqlResource = __esm({
2614
2623
  });
2615
2624
 
2616
2625
  // src/dmv2/sdk/view.ts
2626
+ function formatTableReference2(table) {
2627
+ const database = table instanceof OlapTable ? table.config.database : void 0;
2628
+ if (database) {
2629
+ return `\`${database}\`.\`${table.name}\``;
2630
+ }
2631
+ return `\`${table.name}\``;
2632
+ }
2617
2633
  var View;
2618
2634
  var init_view = __esm({
2619
2635
  "src/dmv2/sdk/view.ts"() {
2620
2636
  "use strict";
2621
2637
  init_sqlHelpers();
2638
+ init_olapTable();
2622
2639
  init_internal();
2623
2640
  init_stackTrace();
2624
2641
  View = class {
@@ -2645,7 +2662,7 @@ var init_view = __esm({
2645
2662
  }
2646
2663
  this.name = name;
2647
2664
  this.selectSql = selectStatement;
2648
- this.sourceTables = baseTables.map((t) => t.name);
2665
+ this.sourceTables = baseTables.map((t) => formatTableReference2(t));
2649
2666
  this.metadata = metadata ? { ...metadata } : {};
2650
2667
  if (!this.metadata.source) {
2651
2668
  const stack = new Error().stack;