@514labs/moose-lib 0.6.297-ci-25-g92aec239 → 0.6.297-ci-32-g6119ebc8

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.
@@ -1900,7 +1900,7 @@ declare class ETLPipeline<T, U> {
1900
1900
  */
1901
1901
  declare class View {
1902
1902
  /** @internal */
1903
- readonly kind = "CustomView";
1903
+ readonly kind = "View";
1904
1904
  /** The name of the view */
1905
1905
  name: string;
1906
1906
  /** The SELECT SQL statement that defines the view */
@@ -2157,16 +2157,16 @@ declare function getMaterializedViews(): Map<string, MaterializedView<any>>;
2157
2157
  */
2158
2158
  declare function getMaterializedView(name: string): MaterializedView<any> | undefined;
2159
2159
  /**
2160
- * Get all registered custom views.
2160
+ * Get all registered views.
2161
2161
  * @returns A Map of view name to View instance
2162
2162
  */
2163
- declare function getCustomViews(): Map<string, View>;
2163
+ declare function getViews(): Map<string, View>;
2164
2164
  /**
2165
- * Get a registered custom view by name.
2166
- * @param name - The name of the custom view
2165
+ * Get a registered view by name.
2166
+ * @param name - The name of the view
2167
2167
  * @returns The View instance or undefined if not found
2168
2168
  */
2169
- declare function getCustomView(name: string): View | undefined;
2169
+ declare function getView(name: string): View | undefined;
2170
2170
 
2171
2171
  /**
2172
2172
  * @module dmv2
@@ -2208,4 +2208,4 @@ type SimpleAggregated<AggregationFunction extends string, ArgType = any> = {
2208
2208
  _argType?: ArgType;
2209
2209
  };
2210
2210
 
2211
- export { type RawValue as $, type Aggregated as A, getWorkflows as B, ConsumptionApi as C, type DeadLetterModel as D, type EgressConfig as E, type FrameworkApp as F, getWorkflow as G, getWebApps as H, IngestApi as I, getWebApp as J, getCustomView as K, LifeCycle as L, MaterializedView as M, getCustomViews as N, OlapTable as O, getMaterializedView as P, getMaterializedViews as Q, type ApiUtil as R, type SimpleAggregated as S, Task as T, type ConsumptionUtil as U, View as V, Workflow as W, quoteIdentifier as X, type IdentifierBrandedString as Y, type NonIdentifierBrandedString as Z, type Value as _, type OlapConfig as a, sql as a0, Sql as a1, toStaticQuery as a2, toQuery as a3, toQueryPreview as a4, getValueFromParameter as a5, createClickhouseParameter as a6, mapToClickHouseType as a7, type MooseUtils as a8, MooseClient as a9, type Blocks as aa, ClickHouseEngines as ab, dropView as ac, createMaterializedView as ad, populateTable as ae, QueryClient as af, WorkflowClient as ag, getTemporalClient as ah, ApiHelpers as ai, ConsumptionHelpers as aj, joinQueries as ak, type ConsumerConfig as al, type TransformConfig as am, type TaskContext as an, type TaskConfig as ao, type IngestPipelineConfig as ap, type MaterializedViewConfig as aq, type S3QueueTableSettings as b, Stream as c, type StreamConfig as d, type DeadLetter as e, DeadLetterQueue as f, type IngestConfig as g, Api as h, type ApiConfig as i, IngestPipeline as j, SqlResource as k, ETLPipeline as l, type ETLPipelineConfig as m, WebApp as n, type WebAppConfig as o, type WebAppHandler as p, getTables as q, getTable as r, getStreams as s, getStream as t, getIngestApis as u, getIngestApi as v, getApis as w, getApi as x, getSqlResources as y, getSqlResource as z };
2211
+ export { type RawValue as $, type Aggregated as A, getWorkflows as B, ConsumptionApi as C, type DeadLetterModel as D, type EgressConfig as E, type FrameworkApp as F, getWorkflow as G, getWebApps as H, IngestApi as I, getWebApp as J, getView as K, LifeCycle as L, MaterializedView as M, getViews as N, OlapTable as O, getMaterializedView as P, getMaterializedViews as Q, type ApiUtil as R, type SimpleAggregated as S, Task as T, type ConsumptionUtil as U, View as V, Workflow as W, quoteIdentifier as X, type IdentifierBrandedString as Y, type NonIdentifierBrandedString as Z, type Value as _, type OlapConfig as a, sql as a0, Sql as a1, toStaticQuery as a2, toQuery as a3, toQueryPreview as a4, getValueFromParameter as a5, createClickhouseParameter as a6, mapToClickHouseType as a7, type MooseUtils as a8, MooseClient as a9, type Blocks as aa, ClickHouseEngines as ab, dropView as ac, createMaterializedView as ad, populateTable as ae, QueryClient as af, WorkflowClient as ag, getTemporalClient as ah, ApiHelpers as ai, ConsumptionHelpers as aj, joinQueries as ak, type ConsumerConfig as al, type TransformConfig as am, type TaskContext as an, type TaskConfig as ao, type IngestPipelineConfig as ap, type MaterializedViewConfig as aq, type S3QueueTableSettings as b, Stream as c, type StreamConfig as d, type DeadLetter as e, DeadLetterQueue as f, type IngestConfig as g, Api as h, type ApiConfig as i, IngestPipeline as j, SqlResource as k, ETLPipeline as l, type ETLPipelineConfig as m, WebApp as n, type WebAppConfig as o, type WebAppHandler as p, getTables as q, getTable as r, getStreams as s, getStream as t, getIngestApis as u, getIngestApi as v, getApis as w, getApi as x, getSqlResources as y, getSqlResource as z };
@@ -1900,7 +1900,7 @@ declare class ETLPipeline<T, U> {
1900
1900
  */
1901
1901
  declare class View {
1902
1902
  /** @internal */
1903
- readonly kind = "CustomView";
1903
+ readonly kind = "View";
1904
1904
  /** The name of the view */
1905
1905
  name: string;
1906
1906
  /** The SELECT SQL statement that defines the view */
@@ -2157,16 +2157,16 @@ declare function getMaterializedViews(): Map<string, MaterializedView<any>>;
2157
2157
  */
2158
2158
  declare function getMaterializedView(name: string): MaterializedView<any> | undefined;
2159
2159
  /**
2160
- * Get all registered custom views.
2160
+ * Get all registered views.
2161
2161
  * @returns A Map of view name to View instance
2162
2162
  */
2163
- declare function getCustomViews(): Map<string, View>;
2163
+ declare function getViews(): Map<string, View>;
2164
2164
  /**
2165
- * Get a registered custom view by name.
2166
- * @param name - The name of the custom view
2165
+ * Get a registered view by name.
2166
+ * @param name - The name of the view
2167
2167
  * @returns The View instance or undefined if not found
2168
2168
  */
2169
- declare function getCustomView(name: string): View | undefined;
2169
+ declare function getView(name: string): View | undefined;
2170
2170
 
2171
2171
  /**
2172
2172
  * @module dmv2
@@ -2208,4 +2208,4 @@ type SimpleAggregated<AggregationFunction extends string, ArgType = any> = {
2208
2208
  _argType?: ArgType;
2209
2209
  };
2210
2210
 
2211
- export { type RawValue as $, type Aggregated as A, getWorkflows as B, ConsumptionApi as C, type DeadLetterModel as D, type EgressConfig as E, type FrameworkApp as F, getWorkflow as G, getWebApps as H, IngestApi as I, getWebApp as J, getCustomView as K, LifeCycle as L, MaterializedView as M, getCustomViews as N, OlapTable as O, getMaterializedView as P, getMaterializedViews as Q, type ApiUtil as R, type SimpleAggregated as S, Task as T, type ConsumptionUtil as U, View as V, Workflow as W, quoteIdentifier as X, type IdentifierBrandedString as Y, type NonIdentifierBrandedString as Z, type Value as _, type OlapConfig as a, sql as a0, Sql as a1, toStaticQuery as a2, toQuery as a3, toQueryPreview as a4, getValueFromParameter as a5, createClickhouseParameter as a6, mapToClickHouseType as a7, type MooseUtils as a8, MooseClient as a9, type Blocks as aa, ClickHouseEngines as ab, dropView as ac, createMaterializedView as ad, populateTable as ae, QueryClient as af, WorkflowClient as ag, getTemporalClient as ah, ApiHelpers as ai, ConsumptionHelpers as aj, joinQueries as ak, type ConsumerConfig as al, type TransformConfig as am, type TaskContext as an, type TaskConfig as ao, type IngestPipelineConfig as ap, type MaterializedViewConfig as aq, type S3QueueTableSettings as b, Stream as c, type StreamConfig as d, type DeadLetter as e, DeadLetterQueue as f, type IngestConfig as g, Api as h, type ApiConfig as i, IngestPipeline as j, SqlResource as k, ETLPipeline as l, type ETLPipelineConfig as m, WebApp as n, type WebAppConfig as o, type WebAppHandler as p, getTables as q, getTable as r, getStreams as s, getStream as t, getIngestApis as u, getIngestApi as v, getApis as w, getApi as x, getSqlResources as y, getSqlResource as z };
2211
+ export { type RawValue as $, type Aggregated as A, getWorkflows as B, ConsumptionApi as C, type DeadLetterModel as D, type EgressConfig as E, type FrameworkApp as F, getWorkflow as G, getWebApps as H, IngestApi as I, getWebApp as J, getView as K, LifeCycle as L, MaterializedView as M, getViews as N, OlapTable as O, getMaterializedView as P, getMaterializedViews as Q, type ApiUtil as R, type SimpleAggregated as S, Task as T, type ConsumptionUtil as U, View as V, Workflow as W, quoteIdentifier as X, type IdentifierBrandedString as Y, type NonIdentifierBrandedString as Z, type Value as _, type OlapConfig as a, sql as a0, Sql as a1, toStaticQuery as a2, toQuery as a3, toQueryPreview as a4, getValueFromParameter as a5, createClickhouseParameter as a6, mapToClickHouseType as a7, type MooseUtils as a8, MooseClient as a9, type Blocks as aa, ClickHouseEngines as ab, dropView as ac, createMaterializedView as ad, populateTable as ae, QueryClient as af, WorkflowClient as ag, getTemporalClient as ah, ApiHelpers as ai, ConsumptionHelpers as aj, joinQueries as ak, type ConsumerConfig as al, type TransformConfig as am, type TaskContext as an, type TaskConfig as ao, type IngestPipelineConfig as ap, type MaterializedViewConfig as aq, type S3QueueTableSettings as b, Stream as c, type StreamConfig as d, type DeadLetter as e, DeadLetterQueue as f, type IngestConfig as g, Api as h, type ApiConfig as i, IngestPipeline as j, SqlResource as k, ETLPipeline as l, type ETLPipelineConfig as m, WebApp as n, type WebAppConfig as o, type WebAppHandler as p, getTables as q, getTable as r, getStreams as s, getStream as t, getIngestApis as u, getIngestApi as v, getApis as w, getApi as x, getSqlResources as y, getSqlResource as z };
package/dist/index.d.mts CHANGED
@@ -1,6 +1,6 @@
1
- export { C as ClickHouseByteSize, q as ClickHouseCodec, j as ClickHouseDecimal, n as ClickHouseDefault, k as ClickHouseFixedStringSize, l as ClickHouseFloat, a as ClickHouseInt, m as ClickHouseJson, e as ClickHouseLineString, p as ClickHouseMaterialized, f as ClickHouseMultiLineString, h as ClickHouseMultiPolygon, b as ClickHouseNamedTuple, c as ClickHousePoint, g as ClickHousePolygon, i as ClickHousePrecision, d as ClickHouseRing, o as ClickHouseTTL, D as DateTime, r as DateTime64, t as DateTime64String, s as DateTimeString, E as Decimal, F as FixedString, u as Float32, v as Float64, w as Int16, x as Int32, y as Int64, I as Int8, J as JWT, K as Key, L as LowCardinality, z as UInt16, A as UInt32, B as UInt64, U as UInt8, W as WithDefault } from './browserCompatible-CkJwv4dC.mjs';
2
- import { a8 as MooseUtils, R as ApiUtil, a9 as MooseClient } from './index-CdKEq7FH.mjs';
3
- export { A as Aggregated, h as Api, i as ApiConfig, ai as ApiHelpers, aa as Blocks, ab as ClickHouseEngines, C as ConsumptionApi, aj as ConsumptionHelpers, U as ConsumptionUtil, e as DeadLetter, D as DeadLetterModel, f as DeadLetterQueue, l as ETLPipeline, m as ETLPipelineConfig, E as EgressConfig, F as FrameworkApp, Y as IdentifierBrandedString, I as IngestApi, g as IngestConfig, j as IngestPipeline, L as LifeCycle, M as MaterializedView, Z as NonIdentifierBrandedString, a as OlapConfig, O as OlapTable, af as QueryClient, $ as RawValue, b as S3QueueTableSettings, S as SimpleAggregated, a1 as Sql, k as SqlResource, c as Stream, d as StreamConfig, T as Task, _ as Value, V as View, n as WebApp, o as WebAppConfig, p as WebAppHandler, W as Workflow, ag as WorkflowClient, a6 as createClickhouseParameter, ad as createMaterializedView, ac as dropView, x as getApi, w as getApis, K as getCustomView, N as getCustomViews, v as getIngestApi, u as getIngestApis, P as getMaterializedView, Q as getMaterializedViews, z as getSqlResource, y as getSqlResources, t as getStream, s as getStreams, r as getTable, q as getTables, ah as getTemporalClient, a5 as getValueFromParameter, J as getWebApp, H as getWebApps, G as getWorkflow, B as getWorkflows, ak as joinQueries, a7 as mapToClickHouseType, ae as populateTable, X as quoteIdentifier, a0 as sql, a3 as toQuery, a4 as toQueryPreview, a2 as toStaticQuery } from './index-CdKEq7FH.mjs';
1
+ export { C as ClickHouseByteSize, q as ClickHouseCodec, j as ClickHouseDecimal, n as ClickHouseDefault, k as ClickHouseFixedStringSize, l as ClickHouseFloat, a as ClickHouseInt, m as ClickHouseJson, e as ClickHouseLineString, p as ClickHouseMaterialized, f as ClickHouseMultiLineString, h as ClickHouseMultiPolygon, b as ClickHouseNamedTuple, c as ClickHousePoint, g as ClickHousePolygon, i as ClickHousePrecision, d as ClickHouseRing, o as ClickHouseTTL, D as DateTime, r as DateTime64, t as DateTime64String, s as DateTimeString, E as Decimal, F as FixedString, u as Float32, v as Float64, w as Int16, x as Int32, y as Int64, I as Int8, J as JWT, K as Key, L as LowCardinality, z as UInt16, A as UInt32, B as UInt64, U as UInt8, W as WithDefault } from './browserCompatible-Dfx6yRB5.mjs';
2
+ import { a8 as MooseUtils, R as ApiUtil, a9 as MooseClient } from './index-CI9e2hZ2.mjs';
3
+ export { A as Aggregated, h as Api, i as ApiConfig, ai as ApiHelpers, aa as Blocks, ab as ClickHouseEngines, C as ConsumptionApi, aj as ConsumptionHelpers, U as ConsumptionUtil, e as DeadLetter, D as DeadLetterModel, f as DeadLetterQueue, l as ETLPipeline, m as ETLPipelineConfig, E as EgressConfig, F as FrameworkApp, Y as IdentifierBrandedString, I as IngestApi, g as IngestConfig, j as IngestPipeline, L as LifeCycle, M as MaterializedView, Z as NonIdentifierBrandedString, a as OlapConfig, O as OlapTable, af as QueryClient, $ as RawValue, b as S3QueueTableSettings, S as SimpleAggregated, a1 as Sql, k as SqlResource, c as Stream, d as StreamConfig, T as Task, _ as Value, V as View, n as WebApp, o as WebAppConfig, p as WebAppHandler, W as Workflow, ag as WorkflowClient, a6 as createClickhouseParameter, ad as createMaterializedView, ac as dropView, x as getApi, w as getApis, v as getIngestApi, u as getIngestApis, P as getMaterializedView, Q as getMaterializedViews, z as getSqlResource, y as getSqlResources, t as getStream, s as getStreams, r as getTable, q as getTables, ah as getTemporalClient, a5 as getValueFromParameter, K as getView, N as getViews, J as getWebApp, H as getWebApps, G as getWorkflow, B as getWorkflows, ak as joinQueries, a7 as mapToClickHouseType, ae as populateTable, X as quoteIdentifier, a0 as sql, a3 as toQuery, a4 as toQueryPreview, a2 as toStaticQuery } from './index-CI9e2hZ2.mjs';
4
4
  import * as _clickhouse_client from '@clickhouse/client';
5
5
  import { KafkaJS } from '@514labs/kafka-javascript';
6
6
  import http from 'http';
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
- export { C as ClickHouseByteSize, q as ClickHouseCodec, j as ClickHouseDecimal, n as ClickHouseDefault, k as ClickHouseFixedStringSize, l as ClickHouseFloat, a as ClickHouseInt, m as ClickHouseJson, e as ClickHouseLineString, p as ClickHouseMaterialized, f as ClickHouseMultiLineString, h as ClickHouseMultiPolygon, b as ClickHouseNamedTuple, c as ClickHousePoint, g as ClickHousePolygon, i as ClickHousePrecision, d as ClickHouseRing, o as ClickHouseTTL, D as DateTime, r as DateTime64, t as DateTime64String, s as DateTimeString, E as Decimal, F as FixedString, u as Float32, v as Float64, w as Int16, x as Int32, y as Int64, I as Int8, J as JWT, K as Key, L as LowCardinality, z as UInt16, A as UInt32, B as UInt64, U as UInt8, W as WithDefault } from './browserCompatible-Dqfdy6x5.js';
2
- import { a8 as MooseUtils, R as ApiUtil, a9 as MooseClient } from './index-CdKEq7FH.js';
3
- export { A as Aggregated, h as Api, i as ApiConfig, ai as ApiHelpers, aa as Blocks, ab as ClickHouseEngines, C as ConsumptionApi, aj as ConsumptionHelpers, U as ConsumptionUtil, e as DeadLetter, D as DeadLetterModel, f as DeadLetterQueue, l as ETLPipeline, m as ETLPipelineConfig, E as EgressConfig, F as FrameworkApp, Y as IdentifierBrandedString, I as IngestApi, g as IngestConfig, j as IngestPipeline, L as LifeCycle, M as MaterializedView, Z as NonIdentifierBrandedString, a as OlapConfig, O as OlapTable, af as QueryClient, $ as RawValue, b as S3QueueTableSettings, S as SimpleAggregated, a1 as Sql, k as SqlResource, c as Stream, d as StreamConfig, T as Task, _ as Value, V as View, n as WebApp, o as WebAppConfig, p as WebAppHandler, W as Workflow, ag as WorkflowClient, a6 as createClickhouseParameter, ad as createMaterializedView, ac as dropView, x as getApi, w as getApis, K as getCustomView, N as getCustomViews, v as getIngestApi, u as getIngestApis, P as getMaterializedView, Q as getMaterializedViews, z as getSqlResource, y as getSqlResources, t as getStream, s as getStreams, r as getTable, q as getTables, ah as getTemporalClient, a5 as getValueFromParameter, J as getWebApp, H as getWebApps, G as getWorkflow, B as getWorkflows, ak as joinQueries, a7 as mapToClickHouseType, ae as populateTable, X as quoteIdentifier, a0 as sql, a3 as toQuery, a4 as toQueryPreview, a2 as toStaticQuery } from './index-CdKEq7FH.js';
1
+ export { C as ClickHouseByteSize, q as ClickHouseCodec, j as ClickHouseDecimal, n as ClickHouseDefault, k as ClickHouseFixedStringSize, l as ClickHouseFloat, a as ClickHouseInt, m as ClickHouseJson, e as ClickHouseLineString, p as ClickHouseMaterialized, f as ClickHouseMultiLineString, h as ClickHouseMultiPolygon, b as ClickHouseNamedTuple, c as ClickHousePoint, g as ClickHousePolygon, i as ClickHousePrecision, d as ClickHouseRing, o as ClickHouseTTL, D as DateTime, r as DateTime64, t as DateTime64String, s as DateTimeString, E as Decimal, F as FixedString, u as Float32, v as Float64, w as Int16, x as Int32, y as Int64, I as Int8, J as JWT, K as Key, L as LowCardinality, z as UInt16, A as UInt32, B as UInt64, U as UInt8, W as WithDefault } from './browserCompatible-Cs3UY_5a.js';
2
+ import { a8 as MooseUtils, R as ApiUtil, a9 as MooseClient } from './index-CI9e2hZ2.js';
3
+ export { A as Aggregated, h as Api, i as ApiConfig, ai as ApiHelpers, aa as Blocks, ab as ClickHouseEngines, C as ConsumptionApi, aj as ConsumptionHelpers, U as ConsumptionUtil, e as DeadLetter, D as DeadLetterModel, f as DeadLetterQueue, l as ETLPipeline, m as ETLPipelineConfig, E as EgressConfig, F as FrameworkApp, Y as IdentifierBrandedString, I as IngestApi, g as IngestConfig, j as IngestPipeline, L as LifeCycle, M as MaterializedView, Z as NonIdentifierBrandedString, a as OlapConfig, O as OlapTable, af as QueryClient, $ as RawValue, b as S3QueueTableSettings, S as SimpleAggregated, a1 as Sql, k as SqlResource, c as Stream, d as StreamConfig, T as Task, _ as Value, V as View, n as WebApp, o as WebAppConfig, p as WebAppHandler, W as Workflow, ag as WorkflowClient, a6 as createClickhouseParameter, ad as createMaterializedView, ac as dropView, x as getApi, w as getApis, v as getIngestApi, u as getIngestApis, P as getMaterializedView, Q as getMaterializedViews, z as getSqlResource, y as getSqlResources, t as getStream, s as getStreams, r as getTable, q as getTables, ah as getTemporalClient, a5 as getValueFromParameter, K as getView, N as getViews, J as getWebApp, H as getWebApps, G as getWorkflow, B as getWorkflows, ak as joinQueries, a7 as mapToClickHouseType, ae as populateTable, X as quoteIdentifier, a0 as sql, a3 as toQuery, a4 as toQueryPreview, a2 as toStaticQuery } from './index-CI9e2hZ2.js';
4
4
  import * as _clickhouse_client from '@clickhouse/client';
5
5
  import { KafkaJS } from '@514labs/kafka-javascript';
6
6
  import http from 'http';
package/dist/index.js CHANGED
@@ -564,7 +564,7 @@ var init_internal = __esm({
564
564
  workflows: /* @__PURE__ */ new Map(),
565
565
  webApps: /* @__PURE__ */ new Map(),
566
566
  materializedViews: /* @__PURE__ */ new Map(),
567
- customViews: /* @__PURE__ */ new Map()
567
+ views: /* @__PURE__ */ new Map()
568
568
  };
569
569
  defaultRetentionPeriod = 60 * 60 * 24 * 7;
570
570
  getMooseInternal = () => globalThis.moose_internal;
@@ -581,7 +581,7 @@ var init_internal = __esm({
581
581
  registry.workflows.clear();
582
582
  registry.webApps.clear();
583
583
  registry.materializedViews.clear();
584
- registry.customViews.clear();
584
+ registry.views.clear();
585
585
  const appDir = `${import_process.default.cwd()}/${getSourceDir()}`;
586
586
  Object.keys(require.cache).forEach((key) => {
587
587
  if (key.startsWith(appDir)) {
@@ -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,16 +2631,24 @@ 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 {
2633
2650
  /** @internal */
2634
- kind = "CustomView";
2651
+ kind = "View";
2635
2652
  /** The name of the view */
2636
2653
  name;
2637
2654
  /** The SELECT SQL statement that defines the view */
@@ -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;
@@ -2662,11 +2679,11 @@ var init_view = __esm({
2662
2679
  this.metadata.source = { file: sourceInfo };
2663
2680
  }
2664
2681
  }
2665
- const customViews = getMooseInternal().customViews;
2666
- if (!isClientOnlyMode() && customViews.has(this.name)) {
2682
+ const views = getMooseInternal().views;
2683
+ if (!isClientOnlyMode() && views.has(this.name)) {
2667
2684
  throw new Error(`View with name ${this.name} already exists`);
2668
2685
  }
2669
- customViews.set(this.name, this);
2686
+ views.set(this.name, this);
2670
2687
  }
2671
2688
  };
2672
2689
  }
@@ -2876,11 +2893,11 @@ function getMaterializedViews() {
2876
2893
  function getMaterializedView(name) {
2877
2894
  return getMooseInternal().materializedViews.get(name);
2878
2895
  }
2879
- function getCustomViews() {
2880
- return getMooseInternal().customViews;
2896
+ function getViews() {
2897
+ return getMooseInternal().views;
2881
2898
  }
2882
- function getCustomView(name) {
2883
- return getMooseInternal().customViews.get(name);
2899
+ function getView(name) {
2900
+ return getMooseInternal().views.get(name);
2884
2901
  }
2885
2902
  var init_registry = __esm({
2886
2903
  "src/dmv2/registry.ts"() {
@@ -3764,8 +3781,6 @@ __export(index_exports, {
3764
3781
  getApi: () => getApi,
3765
3782
  getApis: () => getApis,
3766
3783
  getClickhouseClient: () => getClickhouseClient,
3767
- getCustomView: () => getCustomView,
3768
- getCustomViews: () => getCustomViews,
3769
3784
  getFileName: () => getFileName,
3770
3785
  getIngestApi: () => getIngestApi,
3771
3786
  getIngestApis: () => getIngestApis,
@@ -3785,6 +3800,8 @@ __export(index_exports, {
3785
3800
  getTables: () => getTables,
3786
3801
  getTemporalClient: () => getTemporalClient,
3787
3802
  getValueFromParameter: () => getValueFromParameter,
3803
+ getView: () => getView,
3804
+ getViews: () => getViews,
3788
3805
  getWebApp: () => getWebApp,
3789
3806
  getWebApps: () => getWebApps,
3790
3807
  getWorkflow: () => getWorkflow,
@@ -3876,8 +3893,6 @@ init_index();
3876
3893
  getApi,
3877
3894
  getApis,
3878
3895
  getClickhouseClient,
3879
- getCustomView,
3880
- getCustomViews,
3881
3896
  getFileName,
3882
3897
  getIngestApi,
3883
3898
  getIngestApis,
@@ -3897,6 +3912,8 @@ init_index();
3897
3912
  getTables,
3898
3913
  getTemporalClient,
3899
3914
  getValueFromParameter,
3915
+ getView,
3916
+ getViews,
3900
3917
  getWebApp,
3901
3918
  getWebApps,
3902
3919
  getWorkflow,