/** * dbt semantic layer provider. * Reads dbt's native YAML format (semantic_models + metrics) and maps * them to DQL SemanticLayer definitions. */ import { SemanticLayer } from '../semantic-layer.js'; import type { SemanticLayerProvider, SemanticLayerProviderConfig } from './provider.js'; interface DbtSemanticModel { name: string; label?: string; description?: string; model?: string; node_relation?: { alias?: string; schema_name?: string; database?: string; relation_name?: string; }; defaults?: { agg_time_dimension?: string; }; entities?: Array<{ name: string; type: string; expr?: string; label?: string; description?: string; role?: string; config?: Record; meta?: Record; }>; dimensions?: Array<{ name: string; type: string; expr?: string; label?: string; description?: string; type_params?: Record & { time_granularity?: string; validity_params?: Record; }; config?: Record; meta?: Record; }>; measures?: Array<{ name: string; agg: string; expr?: string; label?: string; description?: string; agg_time_dimension?: string; create_metric?: boolean; non_additive_dimension?: Record; filter?: string | Record | Array>; config?: Record; meta?: Record; }>; config?: Record; meta?: Record; package_name?: string; original_file_path?: string; unique_id?: string; } export declare class DbtProvider implements SemanticLayerProvider { readonly name = "dbt"; load(config: SemanticLayerProviderConfig, projectRoot: string): SemanticLayer; } /** * Where a foreign entity joins TO. In dbt/MetricFlow, a foreign entity `location` * joins to the semantic model whose PRIMARY (or natural/unique) entity is also * named `location`. This index maps that entity name → the target cube and its * join key, so cross-model joins resolve to a real cube instead of the entity name. */ export type PrimaryEntityIndex = Map; /** Build the primary-entity → {cube, key} index across all semantic models. */ export declare function buildPrimaryEntityIndex(models: DbtSemanticModel[]): PrimaryEntityIndex; /** The five MetricFlow time grains, coarsest-last. A column stored at grain N * can be truncated to any grain ≥ N but never finer. */ /** MetricFlow's reserved name for the global aggregate time axis. */ export declare const METRIC_TIME = "metric_time"; export {}; //# sourceMappingURL=dbt-provider.d.ts.map