/** * Snowflake Semantic Views Provider. * * Introspects Snowflake's semantic views (CREATE SEMANTIC VIEW) to discover * metrics, dimensions, and relationships. Unlike file-based providers (dbt, * cubejs), this provider requires a live Snowflake connection. * * Because dql-core must not depend on dql-connectors, this provider accepts * a generic query executor function. The CLI / local-runtime injects the * actual Snowflake connector at runtime. * * Usage: * const provider = new SnowflakeSemanticProvider(async (sql) => { * return connector.execute(sql); * }); * const layer = await provider.loadAsync(config, projectRoot); */ import { SemanticLayer } from '../semantic-layer.js'; import type { SemanticLayerProviderConfig } from './provider.js'; export interface SnowflakeQueryRow { [column: string]: unknown; } export interface SnowflakeQueryResult { rows: SnowflakeQueryRow[]; } /** A function that executes a SQL query against Snowflake and returns rows. */ export type SnowflakeQueryExecutor = (sql: string) => Promise; export declare class SnowflakeSemanticProvider { private readonly executeQuery; readonly name = "snowflake"; constructor(executeQuery: SnowflakeQueryExecutor); /** * Load semantic layer definitions from Snowflake semantic views. * This is async because it needs to query Snowflake metadata. * Uses a file cache (1-hour TTL) to avoid repeated introspection. */ loadAsync(config: SemanticLayerProviderConfig, _projectRoot: string): Promise; /** * Clear the cached introspection so the next load queries Snowflake fresh. */ static clearCache(projectRoot: string): boolean; /** * Check if cache is present and fresh. */ static isCached(projectRoot: string): { cached: boolean; age?: number; }; private populateLayerFromCache; /** * Discover available semantic views in the Snowflake account. */ private discoverSemanticViews; private discoverViaInformationSchema; } //# sourceMappingURL=snowflake-provider.d.ts.map