@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.
@@ -2450,6 +2450,13 @@ var init_etlPipeline = __esm({
2450
2450
  });
2451
2451
 
2452
2452
  // src/dmv2/sdk/materializedView.ts
2453
+ function formatTableReference(table) {
2454
+ const database = table instanceof OlapTable ? table.config.database : void 0;
2455
+ if (database) {
2456
+ return `\`${database}\`.\`${table.name}\``;
2457
+ }
2458
+ return `\`${table.name}\``;
2459
+ }
2453
2460
  var requireTargetTableName, MaterializedView;
2454
2461
  var init_materializedView = __esm({
2455
2462
  "src/dmv2/sdk/materializedView.ts"() {
@@ -2508,7 +2515,9 @@ var init_materializedView = __esm({
2508
2515
  this.name = options.materializedViewName;
2509
2516
  this.targetTable = targetTable;
2510
2517
  this.selectSql = selectStatement;
2511
- this.sourceTables = options.selectTables.map((t) => t.name);
2518
+ this.sourceTables = options.selectTables.map(
2519
+ (t) => formatTableReference(t)
2520
+ );
2512
2521
  this.metadata = options.metadata ? { ...options.metadata } : {};
2513
2522
  if (!this.metadata.source) {
2514
2523
  const stack = new Error().stack;
@@ -2591,11 +2600,19 @@ var init_sqlResource = __esm({
2591
2600
  });
2592
2601
 
2593
2602
  // src/dmv2/sdk/view.ts
2603
+ function formatTableReference2(table) {
2604
+ const database = table instanceof OlapTable ? table.config.database : void 0;
2605
+ if (database) {
2606
+ return `\`${database}\`.\`${table.name}\``;
2607
+ }
2608
+ return `\`${table.name}\``;
2609
+ }
2594
2610
  var View;
2595
2611
  var init_view = __esm({
2596
2612
  "src/dmv2/sdk/view.ts"() {
2597
2613
  "use strict";
2598
2614
  init_sqlHelpers();
2615
+ init_olapTable();
2599
2616
  init_internal();
2600
2617
  init_stackTrace();
2601
2618
  View = class {
@@ -2622,7 +2639,7 @@ var init_view = __esm({
2622
2639
  }
2623
2640
  this.name = name;
2624
2641
  this.selectSql = selectStatement;
2625
- this.sourceTables = baseTables.map((t) => t.name);
2642
+ this.sourceTables = baseTables.map((t) => formatTableReference2(t));
2626
2643
  this.metadata = metadata ? { ...metadata } : {};
2627
2644
  if (!this.metadata.source) {
2628
2645
  const stack = new Error().stack;