@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.
@@ -2558,6 +2558,13 @@ var init_etlPipeline = __esm({
2558
2558
  });
2559
2559
 
2560
2560
  // src/dmv2/sdk/materializedView.ts
2561
+ function formatTableReference(table) {
2562
+ const database = table instanceof OlapTable ? table.config.database : void 0;
2563
+ if (database) {
2564
+ return `\`${database}\`.\`${table.name}\``;
2565
+ }
2566
+ return `\`${table.name}\``;
2567
+ }
2561
2568
  var requireTargetTableName, MaterializedView;
2562
2569
  var init_materializedView = __esm({
2563
2570
  "src/dmv2/sdk/materializedView.ts"() {
@@ -2616,7 +2623,9 @@ var init_materializedView = __esm({
2616
2623
  this.name = options.materializedViewName;
2617
2624
  this.targetTable = targetTable;
2618
2625
  this.selectSql = selectStatement;
2619
- this.sourceTables = options.selectTables.map((t) => t.name);
2626
+ this.sourceTables = options.selectTables.map(
2627
+ (t) => formatTableReference(t)
2628
+ );
2620
2629
  this.metadata = options.metadata ? { ...options.metadata } : {};
2621
2630
  if (!this.metadata.source) {
2622
2631
  const stack = new Error().stack;
@@ -2699,11 +2708,19 @@ var init_sqlResource = __esm({
2699
2708
  });
2700
2709
 
2701
2710
  // src/dmv2/sdk/view.ts
2711
+ function formatTableReference2(table) {
2712
+ const database = table instanceof OlapTable ? table.config.database : void 0;
2713
+ if (database) {
2714
+ return `\`${database}\`.\`${table.name}\``;
2715
+ }
2716
+ return `\`${table.name}\``;
2717
+ }
2702
2718
  var View;
2703
2719
  var init_view = __esm({
2704
2720
  "src/dmv2/sdk/view.ts"() {
2705
2721
  "use strict";
2706
2722
  init_sqlHelpers();
2723
+ init_olapTable();
2707
2724
  init_internal();
2708
2725
  init_stackTrace();
2709
2726
  View = class {
@@ -2730,7 +2747,7 @@ var init_view = __esm({
2730
2747
  }
2731
2748
  this.name = name;
2732
2749
  this.selectSql = selectStatement;
2733
- this.sourceTables = baseTables.map((t) => t.name);
2750
+ this.sourceTables = baseTables.map((t) => formatTableReference2(t));
2734
2751
  this.metadata = metadata ? { ...metadata } : {};
2735
2752
  if (!this.metadata.source) {
2736
2753
  const stack = new Error().stack;