@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.
@@ -2535,6 +2535,13 @@ var init_etlPipeline = __esm({
2535
2535
  });
2536
2536
 
2537
2537
  // src/dmv2/sdk/materializedView.ts
2538
+ function formatTableReference(table) {
2539
+ const database = table instanceof OlapTable ? table.config.database : void 0;
2540
+ if (database) {
2541
+ return `\`${database}\`.\`${table.name}\``;
2542
+ }
2543
+ return `\`${table.name}\``;
2544
+ }
2538
2545
  var requireTargetTableName, MaterializedView;
2539
2546
  var init_materializedView = __esm({
2540
2547
  "src/dmv2/sdk/materializedView.ts"() {
@@ -2593,7 +2600,9 @@ var init_materializedView = __esm({
2593
2600
  this.name = options.materializedViewName;
2594
2601
  this.targetTable = targetTable;
2595
2602
  this.selectSql = selectStatement;
2596
- this.sourceTables = options.selectTables.map((t) => t.name);
2603
+ this.sourceTables = options.selectTables.map(
2604
+ (t) => formatTableReference(t)
2605
+ );
2597
2606
  this.metadata = options.metadata ? { ...options.metadata } : {};
2598
2607
  if (!this.metadata.source) {
2599
2608
  const stack = new Error().stack;
@@ -2676,11 +2685,19 @@ var init_sqlResource = __esm({
2676
2685
  });
2677
2686
 
2678
2687
  // src/dmv2/sdk/view.ts
2688
+ function formatTableReference2(table) {
2689
+ const database = table instanceof OlapTable ? table.config.database : void 0;
2690
+ if (database) {
2691
+ return `\`${database}\`.\`${table.name}\``;
2692
+ }
2693
+ return `\`${table.name}\``;
2694
+ }
2679
2695
  var View;
2680
2696
  var init_view = __esm({
2681
2697
  "src/dmv2/sdk/view.ts"() {
2682
2698
  "use strict";
2683
2699
  init_sqlHelpers();
2700
+ init_olapTable();
2684
2701
  init_internal();
2685
2702
  init_stackTrace();
2686
2703
  View = class {
@@ -2707,7 +2724,7 @@ var init_view = __esm({
2707
2724
  }
2708
2725
  this.name = name;
2709
2726
  this.selectSql = selectStatement;
2710
- this.sourceTables = baseTables.map((t) => t.name);
2727
+ this.sourceTables = baseTables.map((t) => formatTableReference2(t));
2711
2728
  this.metadata = metadata ? { ...metadata } : {};
2712
2729
  if (!this.metadata.source) {
2713
2730
  const stack = new Error().stack;