semanticdb-v2 2.0.0-alpha.4 → 2.0.0-alpha.6
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.
- package/README.md +190 -17
- package/dist/cache/redis-query-cache.esm.js +1 -1
- package/dist/cache/redis-query-cache.js +1 -1
- package/dist/cache/types.d.ts +2 -0
- package/dist/compiler/compile-cte.d.ts +1 -1
- package/dist/errors.d.ts +2 -1
- package/dist/executor/components.d.ts +8 -3
- package/dist/executor/connection-registry.d.ts +2 -2
- package/dist/executor/execute-query.d.ts +6 -1
- package/dist/executor/federated-execution.d.ts +37 -0
- package/dist/executor/fetch-entities.d.ts +5 -1
- package/dist/executor/result-hydrator/types.d.ts +2 -0
- package/dist/executor/total.d.ts +11 -0
- package/dist/executor/types.d.ts +41 -6
- package/dist/i18n/index.d.ts +4 -0
- package/dist/i18n/locales/en-US.d.ts +2 -0
- package/dist/i18n/locales/zh-CN.d.ts +2 -0
- package/dist/i18n/registry.d.ts +13 -0
- package/dist/i18n/types.d.ts +9 -0
- package/dist/index.d.ts +11 -8
- package/dist/logicform-types.d.ts +44 -12
- package/dist/normalizer/core.d.ts +5 -0
- package/dist/normalizer/default-pred-name.d.ts +2 -0
- package/dist/normalizer/index.d.ts +1 -0
- package/dist/normalizer/pred-expression.d.ts +6 -0
- package/dist/normalizer/property-resolve.d.ts +1 -0
- package/dist/operators/builtins/period-name.d.ts +2 -1
- package/dist/operators/builtins/query-expression.d.ts +3 -0
- package/dist/operators/index.d.ts +2 -1
- package/dist/operators/registry.d.ts +1 -1
- package/dist/operators/resolve.d.ts +3 -0
- package/dist/operators/types.d.ts +55 -15
- package/dist/physical/clickhouse-provider.d.ts +14 -2
- package/dist/physical/connection.d.ts +57 -15
- package/dist/physical/dameng-provider.d.ts +61 -0
- package/dist/physical/databricks-provider.d.ts +83 -0
- package/dist/physical/display-query.d.ts +3 -0
- package/dist/physical/doris-provider.d.ts +2 -1
- package/dist/physical/duckdb-coordinator-provider.d.ts +37 -0
- package/dist/physical/gbase-provider.d.ts +11 -0
- package/dist/physical/index.d.ts +21 -9
- package/dist/physical/load-driver.d.ts +1 -0
- package/dist/physical/maxcompute-provider.d.ts +37 -0
- package/dist/physical/mysql-protocol-provider.d.ts +21 -6
- package/dist/physical/mysql-provider.d.ts +2 -1
- package/dist/physical/oracle-provider.d.ts +15 -4
- package/dist/physical/postgresql-provider.d.ts +18 -4
- package/dist/physical/provider.d.ts +16 -1
- package/dist/physical/snowflake-provider.d.ts +15 -3
- package/dist/physical/sqlserver-provider.d.ts +65 -0
- package/dist/physical/starrocks-provider.d.ts +2 -1
- package/dist/planner/build-lineage.d.ts +1 -1
- package/dist/planner/create-logical-plan.d.ts +7 -0
- package/dist/planner/index.d.ts +4 -2
- package/dist/planner/mapping-granularity.d.ts +7 -0
- package/dist/planner/rewrite-nested-components.d.ts +8 -0
- package/dist/planner/select-schema-mapping.d.ts +16 -2
- package/dist/planner/semantics/index.d.ts +0 -3
- package/dist/planner/semantics/periods.d.ts +13 -0
- package/dist/planner/semantics/registry-defaults.d.ts +2 -1
- package/dist/planner/types.d.ts +80 -12
- package/dist/plugins/hierarchy/index.d.ts +1 -1
- package/dist/plugins/hierarchy/mapping-granularity.d.ts +4 -0
- package/dist/plugins/hierarchy/types.d.ts +17 -0
- package/dist/plugins/index.d.ts +10 -1
- package/dist/{planner/semantics → plugins}/observation/classification.d.ts +1 -1
- package/dist/plugins/observation/index.d.ts +17 -0
- package/dist/{planner/semantics → plugins}/observation/operator-policy.d.ts +2 -3
- package/dist/plugins/observation/periods.d.ts +18 -0
- package/dist/{planner/semantics → plugins}/observation/rule.d.ts +1 -1
- package/dist/{planner/semantics → plugins}/observation/types.d.ts +1 -1
- package/dist/plugins/property-hierarchy/index.d.ts +11 -0
- package/dist/plugins/recursive/index.d.ts +26 -0
- package/dist/plugins/temporal/index.d.ts +13 -0
- package/dist/plugins/types.d.ts +165 -1
- package/dist/plugins/validity/classification.d.ts +5 -0
- package/dist/plugins/validity/index.d.ts +15 -0
- package/dist/plugins/validity/periods.d.ts +15 -0
- package/dist/plugins/validity/query-policy.d.ts +3 -0
- package/dist/plugins/validity/rule.d.ts +2 -0
- package/dist/plugins/validity/semantic-types.d.ts +3 -0
- package/dist/schema/dependent-projection.d.ts +8 -0
- package/dist/schema/index.d.ts +1 -0
- package/dist/schema-mappings/freshness.d.ts +1 -1
- package/dist/schema-mappings/granularity.d.ts +5 -0
- package/dist/schema-mappings/index.d.ts +2 -1
- package/dist/schema-mappings/registry.d.ts +5 -3
- package/dist/schema-mappings/types.d.ts +43 -0
- package/dist/schema-mappings/yiask.d.ts +6 -2
- package/dist/semantic-types/index.d.ts +5 -3
- package/dist/semantic-types/registry.d.ts +2 -0
- package/dist/semantic-types/resolve-schema.d.ts +1 -1
- package/dist/semantic-types/types.d.ts +6 -13
- package/dist/semantic-types/validate-resolved-schema.d.ts +2 -5
- package/dist/semanticdb.esm.js +4 -3
- package/dist/semanticdb.js +4 -3
- package/package.json +47 -5
- package/dist/planner/semantics/lifecycle/classification.d.ts +0 -7
- package/dist/planner/semantics/lifecycle/index.d.ts +0 -3
- package/dist/planner/semantics/lifecycle/query-policy.d.ts +0 -3
- package/dist/planner/semantics/lifecycle/rule.d.ts +0 -2
- package/dist/planner/semantics/observation/index.d.ts +0 -4
- package/dist/semantic-types/builtins/end-date.d.ts +0 -2
- package/dist/semantic-types/builtins/start-date.d.ts +0 -2
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import type { CoreComputeProvider, DatePart, DataRow, ProviderExecutionRequest } from './provider';
|
|
2
|
+
type DatabricksBind = string | number | boolean | bigint | Date | null;
|
|
3
|
+
export interface DatabricksConnectionBase {
|
|
4
|
+
readonly host: string;
|
|
5
|
+
readonly path: string;
|
|
6
|
+
readonly catalog?: string;
|
|
7
|
+
readonly schema?: string;
|
|
8
|
+
/** Legacy datasource field for the default schema. */
|
|
9
|
+
readonly database?: string;
|
|
10
|
+
}
|
|
11
|
+
export interface DatabricksAccessTokenAuth {
|
|
12
|
+
readonly authType: 'access-token';
|
|
13
|
+
readonly token: string;
|
|
14
|
+
readonly oauthClientId?: never;
|
|
15
|
+
readonly oauthClientSecret?: never;
|
|
16
|
+
readonly azureTenantId?: never;
|
|
17
|
+
readonly useDatabricksOAuthInAzure?: never;
|
|
18
|
+
readonly oauthScopes?: never;
|
|
19
|
+
}
|
|
20
|
+
export interface DatabricksOAuthAuth {
|
|
21
|
+
readonly authType: 'databricks-oauth';
|
|
22
|
+
readonly oauthClientId: string;
|
|
23
|
+
readonly oauthClientSecret: string;
|
|
24
|
+
readonly token?: never;
|
|
25
|
+
readonly azureTenantId?: string;
|
|
26
|
+
readonly useDatabricksOAuthInAzure?: boolean;
|
|
27
|
+
readonly oauthScopes?: readonly string[];
|
|
28
|
+
}
|
|
29
|
+
export type DatabricksConnectionOptions = DatabricksConnectionBase & (DatabricksAccessTokenAuth | DatabricksOAuthAuth);
|
|
30
|
+
export interface DatabricksOperationLike {
|
|
31
|
+
fetchAll(): Promise<unknown>;
|
|
32
|
+
cancel(): Promise<unknown>;
|
|
33
|
+
close(): Promise<unknown>;
|
|
34
|
+
}
|
|
35
|
+
export interface DatabricksSessionLike {
|
|
36
|
+
executeStatement(sql: string, options: {
|
|
37
|
+
readonly ordinalParameters: DatabricksBind[];
|
|
38
|
+
}): Promise<DatabricksOperationLike>;
|
|
39
|
+
close(): Promise<unknown>;
|
|
40
|
+
}
|
|
41
|
+
export interface DatabricksClientLike {
|
|
42
|
+
connect(options: object): Promise<unknown>;
|
|
43
|
+
openSession(options: {
|
|
44
|
+
readonly initialCatalog?: string;
|
|
45
|
+
readonly initialSchema?: string;
|
|
46
|
+
}): Promise<DatabricksSessionLike>;
|
|
47
|
+
close(): Promise<void>;
|
|
48
|
+
}
|
|
49
|
+
export interface DatabricksProviderOptions {
|
|
50
|
+
readonly connection?: DatabricksConnectionOptions;
|
|
51
|
+
readonly client?: DatabricksClientLike;
|
|
52
|
+
}
|
|
53
|
+
export declare const databricksConnectOptions: (input: unknown) => object;
|
|
54
|
+
export declare class DatabricksProvider implements CoreComputeProvider {
|
|
55
|
+
#private;
|
|
56
|
+
readonly kind: "databricks";
|
|
57
|
+
readonly supportsHavingAlias = false;
|
|
58
|
+
readonly supportsRecursiveCte = true;
|
|
59
|
+
constructor(options?: DatabricksProviderOptions);
|
|
60
|
+
quoteIdentifier(identifier: string): string;
|
|
61
|
+
tableAlias(expression: string, alias: string): string;
|
|
62
|
+
paginate(sql: string, pageSize: number, offset: number): string;
|
|
63
|
+
parameter(index: number, value: unknown): string;
|
|
64
|
+
displayQuery(sql: string, parameters: readonly unknown[]): string;
|
|
65
|
+
dateBucket(expression: string, level: string): string;
|
|
66
|
+
datePart(expression: string, part: DatePart): string;
|
|
67
|
+
dateShift(expression: string, granularity: string, offset: number): string;
|
|
68
|
+
castValue(expression: string, type: string): string;
|
|
69
|
+
aggregateFunction(name: string, expression?: string): string;
|
|
70
|
+
stringify(expression: string): string;
|
|
71
|
+
concat(expressions: readonly string[]): string;
|
|
72
|
+
substring(expression: string, start: number, length: number): string;
|
|
73
|
+
stringLength(expression: string): string;
|
|
74
|
+
regex(expression: string, pattern: string, options?: string): string;
|
|
75
|
+
arrayContains(arrayExpression: string, valueExpression: string): string;
|
|
76
|
+
expandArray(arrayExpression: string, alias: string, column: string): {
|
|
77
|
+
joinSql: string;
|
|
78
|
+
valueExpression: string;
|
|
79
|
+
};
|
|
80
|
+
execute(request: ProviderExecutionRequest): Promise<DataRow[]>;
|
|
81
|
+
close(): Promise<void>;
|
|
82
|
+
}
|
|
83
|
+
export {};
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
export declare const displayClickHouseQuery: (sql: string, parameters: readonly unknown[]) => string;
|
|
2
2
|
export declare const displayOracleQuery: (sql: string, parameters: readonly unknown[]) => string;
|
|
3
3
|
export declare const displayPostgreSQLQuery: (sql: string, parameters: readonly unknown[]) => string;
|
|
4
|
+
export declare const displayMySQLQuery: (sql: string, parameters: readonly unknown[]) => string;
|
|
4
5
|
export declare const displayQuestionMarkQuery: (sql: string, parameters: readonly unknown[]) => string;
|
|
6
|
+
export declare const displayDamengQuery: (sql: string, parameters: readonly unknown[]) => string;
|
|
7
|
+
export declare const displaySQLServerQuery: (sql: string, parameters: readonly unknown[]) => string;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { MySQLProtocolProvider } from './mysql-protocol-provider';
|
|
2
|
-
import type { MySQLProtocolPoolLike, MySQLProtocolProviderOptions } from './mysql-protocol-provider';
|
|
2
|
+
import type { MySQLProtocolPoolLike, MySQLProtocolConnectionOptions, MySQLProtocolProviderOptions } from './mysql-protocol-provider';
|
|
3
3
|
export type DorisPoolLike = MySQLProtocolPoolLike;
|
|
4
|
+
export type DorisConnectionOptions = MySQLProtocolConnectionOptions;
|
|
4
5
|
export type DorisProviderOptions = MySQLProtocolProviderOptions;
|
|
5
6
|
/** Doris adapter using its MySQL-compatible protocol and SQL surface. */
|
|
6
7
|
export declare class DorisProvider extends MySQLProtocolProvider {
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { CoreComputeProvider, DataRow, DatePart, ProviderExecutionRequest } from './provider';
|
|
2
|
+
export type DuckDBCoordinatorColumnKind = 'boolean' | 'date' | 'number' | 'string';
|
|
3
|
+
export interface DuckDBCoordinatorColumn {
|
|
4
|
+
readonly name: string;
|
|
5
|
+
readonly kind: DuckDBCoordinatorColumnKind;
|
|
6
|
+
}
|
|
7
|
+
/** In-process SQL engine used only to combine results from separate physical connections. */
|
|
8
|
+
export declare class DuckDBCoordinatorProvider implements CoreComputeProvider {
|
|
9
|
+
private readonly instance;
|
|
10
|
+
private readonly connection;
|
|
11
|
+
readonly kind: "duckdb";
|
|
12
|
+
readonly supportsHavingAlias = true;
|
|
13
|
+
readonly supportsRecursiveCte = true;
|
|
14
|
+
static create(): Promise<DuckDBCoordinatorProvider>;
|
|
15
|
+
private constructor();
|
|
16
|
+
quoteIdentifier(identifier: string): string;
|
|
17
|
+
tableAlias(expression: string, alias: string): string;
|
|
18
|
+
paginate(sql: string, pageSize: number, offset: number): string;
|
|
19
|
+
parameter(index: number, value: unknown): string;
|
|
20
|
+
displayQuery(sql: string, parameters: readonly unknown[]): string;
|
|
21
|
+
dateBucket(expression: string, level: string): string;
|
|
22
|
+
datePart(expression: string, part: DatePart): string;
|
|
23
|
+
dateShift(expression: string, granularity: string, offset: number): string;
|
|
24
|
+
datePeriodBoundary(expression: string, granularity: string, boundary: 'start' | 'end'): string;
|
|
25
|
+
castValue(expression: string, type: string): string;
|
|
26
|
+
scalarExtremum(operator: 'least' | 'greatest', expressions: readonly string[]): string;
|
|
27
|
+
aggregateFunction(name: string, expression?: string): string;
|
|
28
|
+
stringify(expression: string): string;
|
|
29
|
+
concat(expressions: readonly string[]): string;
|
|
30
|
+
substring(expression: string, start: number, length: number): string;
|
|
31
|
+
stringLength(expression: string): string;
|
|
32
|
+
regex(expression: string, pattern: string, options?: string): string;
|
|
33
|
+
arrayContains(arrayExpression: string, valueExpression: string): string;
|
|
34
|
+
materialize(tableName: string, inputColumns: readonly DuckDBCoordinatorColumn[], rows: readonly DataRow[]): Promise<void>;
|
|
35
|
+
execute(request: ProviderExecutionRequest): Promise<DataRow[]>;
|
|
36
|
+
close(): Promise<void>;
|
|
37
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { MySQLProtocolProvider } from './mysql-protocol-provider';
|
|
2
|
+
import type { MySQLProtocolConnectionOptions, MySQLProtocolPoolLike, MySQLProtocolProviderOptions } from './mysql-protocol-provider';
|
|
3
|
+
export type GBasePoolLike = MySQLProtocolPoolLike;
|
|
4
|
+
export type GBaseConnectionOptions = MySQLProtocolConnectionOptions;
|
|
5
|
+
export type GBaseProviderOptions = MySQLProtocolProviderOptions;
|
|
6
|
+
/** GBase 8a adapter using its MySQL-compatible protocol and SQL surface. */
|
|
7
|
+
export declare class GBaseProvider extends MySQLProtocolProvider {
|
|
8
|
+
readonly kind: "gbase";
|
|
9
|
+
readonly supportsRecursiveCte = false;
|
|
10
|
+
constructor(options?: GBaseProviderOptions);
|
|
11
|
+
}
|
package/dist/physical/index.d.ts
CHANGED
|
@@ -1,18 +1,30 @@
|
|
|
1
1
|
/** Internal physical adapters selected from the public database connection configuration. */
|
|
2
|
-
export type { CoreComputeProvider, DataRow, ProviderExecutionRequest, SqlRenderCapabilities, SqlParameters, } from './provider';
|
|
3
|
-
export { createProvider } from './connection';
|
|
4
|
-
export type { DatabaseConnection } from './connection';
|
|
2
|
+
export type { CoreComputeProvider, DatePart, DataRow, ProviderExecutionRequest, ProviderKind, ProviderKindExtensions, SqlRenderCapabilities, SqlParameters, } from './provider';
|
|
3
|
+
export { builtinProviderDefinitions, createProvider, defaultProviderRegistry, ProviderRegistry, } from './connection';
|
|
4
|
+
export type { BuiltinDatabaseConnection, DatabaseConnection, DatabaseConnectionBase, DatabaseConnectionExtensions, ProviderDefinition, } from './connection';
|
|
5
|
+
export { DuckDBCoordinatorProvider } from './duckdb-coordinator-provider';
|
|
6
|
+
export type { DuckDBCoordinatorColumn, DuckDBCoordinatorColumnKind, } from './duckdb-coordinator-provider';
|
|
5
7
|
export { ClickHouseProvider, } from './clickhouse-provider';
|
|
6
8
|
export type { ClickHouseClientLike, ClickHouseProviderOptions, } from './clickhouse-provider';
|
|
9
|
+
export { DatabricksProvider } from './databricks-provider';
|
|
10
|
+
export type { DatabricksClientLike, DatabricksConnectionBase, DatabricksConnectionOptions, DatabricksAccessTokenAuth, DatabricksOAuthAuth, DatabricksProviderOptions, DatabricksSessionLike, DatabricksOperationLike, } from './databricks-provider';
|
|
11
|
+
export { DamengProvider } from './dameng-provider';
|
|
12
|
+
export type { DamengConnectionLike, DamengConnectionOptions, DamengDriverLike, DamengPoolLike, DamengPoolOptions, DamengProviderOptions, } from './dameng-provider';
|
|
7
13
|
export { DorisProvider } from './doris-provider';
|
|
8
|
-
export type { DorisPoolLike, DorisProviderOptions } from './doris-provider';
|
|
14
|
+
export type { DorisConnectionOptions, DorisPoolLike, DorisProviderOptions } from './doris-provider';
|
|
15
|
+
export { GBaseProvider } from './gbase-provider';
|
|
16
|
+
export type { GBaseConnectionOptions, GBasePoolLike, GBaseProviderOptions } from './gbase-provider';
|
|
17
|
+
export { MaxComputeProvider } from './maxcompute-provider';
|
|
18
|
+
export type { MaxComputeClientLike, MaxComputeConnectionOptions, MaxComputeProviderOptions, } from './maxcompute-provider';
|
|
9
19
|
export { MySQLProvider } from './mysql-provider';
|
|
10
|
-
export type { MySQLPoolLike, MySQLProviderOptions } from './mysql-provider';
|
|
20
|
+
export type { MySQLConnectionOptions, MySQLPoolLike, MySQLProviderOptions } from './mysql-provider';
|
|
11
21
|
export { OracleProvider } from './oracle-provider';
|
|
12
|
-
export type { OracleConnectionLike, OracleDriverLike, OraclePoolLike, OracleProviderOptions, } from './oracle-provider';
|
|
22
|
+
export type { OracleConnectionLike, OracleConnectionOptions, OracleDriverLike, OraclePoolLike, OracleProviderOptions, } from './oracle-provider';
|
|
13
23
|
export { PostgreSQLProvider } from './postgresql-provider';
|
|
14
|
-
export type { PostgreSQLPoolLike, PostgreSQLProviderOptions, } from './postgresql-provider';
|
|
24
|
+
export type { PostgreSQLPoolLike, PostgreSQLConnectionOptions, PostgreSQLProviderOptions, } from './postgresql-provider';
|
|
15
25
|
export { SnowflakeProvider } from './snowflake-provider';
|
|
16
|
-
export type { SnowflakeConnectionLike, SnowflakeProviderOptions, SnowflakeStatementLike, } from './snowflake-provider';
|
|
26
|
+
export type { SnowflakeConnectionLike, SnowflakeConnectionOptions, SnowflakeProviderOptions, SnowflakeStatementLike, } from './snowflake-provider';
|
|
27
|
+
export { SQLServerProvider, sqlServerPoolOptions } from './sqlserver-provider';
|
|
28
|
+
export type { SQLServerConnectionOptions, SQLServerDriverLike, SQLServerPoolLike, SQLServerProviderOptions, SQLServerRequestLike, } from './sqlserver-provider';
|
|
17
29
|
export { StarRocksProvider } from './starrocks-provider';
|
|
18
|
-
export type { StarRocksPoolLike, StarRocksProviderOptions, } from './starrocks-provider';
|
|
30
|
+
export type { StarRocksPoolLike, StarRocksConnectionOptions, StarRocksProviderOptions, } from './starrocks-provider';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const driverLoadError: (packageName: string, cause: unknown) => Error;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { CoreComputeProvider, DataRow, DatePart, ProviderExecutionRequest, SqlParameters } from './provider';
|
|
2
|
+
/**
|
|
3
|
+
* Parameterized MaxCompute execution boundary supplied by the application.
|
|
4
|
+
* Implementations must bind `parameters`; they must not interpolate them into `sql`.
|
|
5
|
+
*/
|
|
6
|
+
export interface MaxComputeClientLike {
|
|
7
|
+
execute(request: ProviderExecutionRequest): Promise<DataRow[]>;
|
|
8
|
+
close(): Promise<void>;
|
|
9
|
+
}
|
|
10
|
+
export interface MaxComputeConnectionOptions {
|
|
11
|
+
readonly client: MaxComputeClientLike;
|
|
12
|
+
}
|
|
13
|
+
export type MaxComputeProviderOptions = MaxComputeConnectionOptions;
|
|
14
|
+
/** MaxCompute SQL dialect backed by a caller-owned parameterized execution client. */
|
|
15
|
+
export declare class MaxComputeProvider implements CoreComputeProvider {
|
|
16
|
+
#private;
|
|
17
|
+
readonly kind: "maxcompute";
|
|
18
|
+
readonly supportsRecursiveCte = false;
|
|
19
|
+
constructor(options: MaxComputeProviderOptions);
|
|
20
|
+
quoteIdentifier(identifier: string): string;
|
|
21
|
+
tableAlias(expression: string, alias: string): string;
|
|
22
|
+
paginate(sql: string, pageSize: number, offset: number): string;
|
|
23
|
+
parameter(index: number, value: unknown): string;
|
|
24
|
+
displayQuery(sql: string, parameters: SqlParameters): string;
|
|
25
|
+
dateBucket(expression: string, level: string): string;
|
|
26
|
+
datePart(expression: string, part: DatePart): string;
|
|
27
|
+
dateShift(expression: string, granularity: string, offset: number): string;
|
|
28
|
+
datePeriodBoundary(expression: string, granularity: string, boundary: 'start' | 'end'): string;
|
|
29
|
+
aggregateFunction(name: string, expression?: string): string;
|
|
30
|
+
stringify(expression: string): string;
|
|
31
|
+
concat(expressions: readonly string[]): string;
|
|
32
|
+
substring(expression: string, start: number, length: number): string;
|
|
33
|
+
stringLength(expression: string): string;
|
|
34
|
+
regex(expression: string, pattern: string, options?: string): string;
|
|
35
|
+
execute(request: ProviderExecutionRequest): Promise<DataRow[]>;
|
|
36
|
+
close(): Promise<void>;
|
|
37
|
+
}
|
|
@@ -1,17 +1,30 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type { CoreComputeProvider, DataRow, ProviderExecutionRequest, SqlParameters } from './provider';
|
|
1
|
+
import type { CoreComputeProvider, DatePart, DataRow, ProviderExecutionRequest, SqlParameters } from './provider';
|
|
3
2
|
export interface MySQLProtocolPoolLike {
|
|
4
3
|
execute(sql: string, values: readonly unknown[]): Promise<readonly [unknown, unknown]>;
|
|
5
4
|
end(): Promise<void>;
|
|
6
5
|
}
|
|
6
|
+
export interface MySQLProtocolConnectionOptions {
|
|
7
|
+
readonly host?: string;
|
|
8
|
+
readonly port?: number;
|
|
9
|
+
readonly user?: string;
|
|
10
|
+
readonly password?: string;
|
|
11
|
+
readonly database?: string;
|
|
12
|
+
readonly connectionLimit?: number;
|
|
13
|
+
readonly maxIdle?: number;
|
|
14
|
+
readonly idleTimeout?: number;
|
|
15
|
+
readonly enableKeepAlive?: boolean;
|
|
16
|
+
readonly keepAliveInitialDelay?: number;
|
|
17
|
+
readonly decimalNumbers?: boolean;
|
|
18
|
+
readonly [option: string]: unknown;
|
|
19
|
+
}
|
|
7
20
|
export interface MySQLProtocolProviderOptions {
|
|
8
|
-
readonly connection?:
|
|
21
|
+
readonly connection?: object;
|
|
9
22
|
readonly pool?: MySQLProtocolPoolLike;
|
|
10
23
|
}
|
|
11
24
|
export declare abstract class MySQLProtocolProvider implements CoreComputeProvider {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
25
|
+
#private;
|
|
26
|
+
readonly supportsRecursiveCte: boolean;
|
|
27
|
+
abstract readonly kind: 'doris' | 'gbase' | 'maxcompute' | 'mysql' | 'starrocks';
|
|
15
28
|
protected constructor(options?: MySQLProtocolProviderOptions);
|
|
16
29
|
quoteIdentifier(identifier: string): string;
|
|
17
30
|
tableAlias(expression: string, alias: string): string;
|
|
@@ -19,12 +32,14 @@ export declare abstract class MySQLProtocolProvider implements CoreComputeProvid
|
|
|
19
32
|
parameter(index: number, value: unknown): string;
|
|
20
33
|
displayQuery(sql: string, parameters: SqlParameters): string;
|
|
21
34
|
dateBucket(expression: string, level: string): string;
|
|
35
|
+
datePart(expression: string, part: DatePart): string;
|
|
22
36
|
dateShift(expression: string, granularity: string, offset: number): string;
|
|
23
37
|
datePeriodBoundary(expression: string, granularity: string, boundary: 'start' | 'end'): string;
|
|
24
38
|
aggregateFunction(name: string, expression?: string): string;
|
|
25
39
|
stringify(expression: string): string;
|
|
26
40
|
concat(expressions: readonly string[]): string;
|
|
27
41
|
substring(expression: string, start: number, length: number): string;
|
|
42
|
+
stringLength(expression: string): string;
|
|
28
43
|
regex(expression: string, pattern: string, options?: string): string;
|
|
29
44
|
arrayContains(arrayExpression: string, valueExpression: string): string;
|
|
30
45
|
expandArray(arrayExpression: string, alias: string, column: string): {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { MySQLProtocolProvider } from './mysql-protocol-provider';
|
|
2
|
-
import type { MySQLProtocolPoolLike, MySQLProtocolProviderOptions } from './mysql-protocol-provider';
|
|
2
|
+
import type { MySQLProtocolPoolLike, MySQLProtocolConnectionOptions, MySQLProtocolProviderOptions } from './mysql-protocol-provider';
|
|
3
3
|
export type MySQLPoolLike = MySQLProtocolPoolLike;
|
|
4
|
+
export type MySQLConnectionOptions = MySQLProtocolConnectionOptions;
|
|
4
5
|
export type MySQLProviderOptions = MySQLProtocolProviderOptions;
|
|
5
6
|
export declare class MySQLProvider extends MySQLProtocolProvider {
|
|
6
7
|
readonly kind: "mysql";
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type { CoreComputeProvider, DataRow, ProviderExecutionRequest } from './provider';
|
|
1
|
+
import type { CoreComputeProvider, DatePart, DataRow, ProviderExecutionRequest } from './provider';
|
|
3
2
|
type OracleBind = string | number | boolean | Date | Buffer | null;
|
|
4
3
|
export interface OracleConnectionLike {
|
|
5
4
|
execute(sql: string, binds: OracleBind[], options: {
|
|
@@ -14,12 +13,22 @@ export interface OraclePoolLike {
|
|
|
14
13
|
getConnection(): Promise<OracleConnectionLike>;
|
|
15
14
|
close(drainTime?: number): Promise<void>;
|
|
16
15
|
}
|
|
16
|
+
export interface OracleConnectionOptions {
|
|
17
|
+
readonly user?: string;
|
|
18
|
+
readonly password?: string;
|
|
19
|
+
readonly connectString?: string;
|
|
20
|
+
readonly poolMin?: number;
|
|
21
|
+
readonly poolMax?: number;
|
|
22
|
+
readonly poolIncrement?: number;
|
|
23
|
+
readonly poolTimeout?: number;
|
|
24
|
+
readonly [option: string]: unknown;
|
|
25
|
+
}
|
|
17
26
|
export interface OracleDriverLike {
|
|
18
|
-
createPool(options:
|
|
27
|
+
createPool(options: OracleConnectionOptions): Promise<OraclePoolLike>;
|
|
19
28
|
}
|
|
20
29
|
export interface OracleProviderOptions {
|
|
21
30
|
/** Passed to oracledb.createPool(). Thin mode is used unless the caller initialized Thick mode. */
|
|
22
|
-
readonly connection?:
|
|
31
|
+
readonly connection?: object;
|
|
23
32
|
/** Injectable pool for applications that own pool creation or for tests. */
|
|
24
33
|
readonly pool?: OraclePoolLike;
|
|
25
34
|
/** Injectable driver factory used to test lazy pool creation. */
|
|
@@ -37,11 +46,13 @@ export declare class OracleProvider implements CoreComputeProvider {
|
|
|
37
46
|
parameter(index: number, value: unknown): string;
|
|
38
47
|
displayQuery(sql: string, parameters: readonly unknown[]): string;
|
|
39
48
|
dateBucket(expression: string, level: string): string;
|
|
49
|
+
datePart(expression: string, part: DatePart): string;
|
|
40
50
|
dateShift(expression: string, granularity: string, offset: number): string;
|
|
41
51
|
aggregateFunction(name: string, expression?: string): string;
|
|
42
52
|
stringify(expression: string): string;
|
|
43
53
|
concat(expressions: readonly string[]): string;
|
|
44
54
|
substring(expression: string, start: number, length: number): string;
|
|
55
|
+
stringLength(expression: string): string;
|
|
45
56
|
regex(expression: string, pattern: string, options?: string): string;
|
|
46
57
|
arrayContains(arrayExpression: string, valueExpression: string): string;
|
|
47
58
|
expandArray(arrayExpression: string, alias: string, column: string): {
|
|
@@ -1,20 +1,32 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type { CoreComputeProvider, DataRow, ProviderExecutionRequest } from './provider';
|
|
1
|
+
import type { CoreComputeProvider, DatePart, DataRow, ProviderExecutionRequest } from './provider';
|
|
3
2
|
export interface PostgreSQLPoolLike {
|
|
4
3
|
query(sql: string, values: unknown[]): Promise<{
|
|
5
4
|
readonly rows: unknown;
|
|
6
5
|
}>;
|
|
7
6
|
end(): Promise<void>;
|
|
8
7
|
}
|
|
8
|
+
export interface PostgreSQLConnectionOptions {
|
|
9
|
+
readonly connectionString?: string;
|
|
10
|
+
readonly host?: string;
|
|
11
|
+
readonly port?: number;
|
|
12
|
+
readonly user?: string;
|
|
13
|
+
readonly password?: string;
|
|
14
|
+
readonly database?: string;
|
|
15
|
+
readonly ssl?: unknown;
|
|
16
|
+
readonly max?: number;
|
|
17
|
+
readonly idleTimeoutMillis?: number;
|
|
18
|
+
readonly connectionTimeoutMillis?: number;
|
|
19
|
+
readonly [option: string]: unknown;
|
|
20
|
+
}
|
|
9
21
|
export interface PostgreSQLProviderOptions {
|
|
10
|
-
readonly connection?:
|
|
22
|
+
readonly connection?: object;
|
|
11
23
|
readonly pool?: PostgreSQLPoolLike;
|
|
12
24
|
}
|
|
13
25
|
export declare class PostgreSQLProvider implements CoreComputeProvider {
|
|
26
|
+
#private;
|
|
14
27
|
readonly kind: "postgresql";
|
|
15
28
|
readonly supportsHavingAlias = false;
|
|
16
29
|
readonly supportsRecursiveCte = true;
|
|
17
|
-
private readonly pool;
|
|
18
30
|
constructor(options?: PostgreSQLProviderOptions);
|
|
19
31
|
quoteIdentifier(identifier: string): string;
|
|
20
32
|
tableAlias(expression: string, alias: string): string;
|
|
@@ -22,11 +34,13 @@ export declare class PostgreSQLProvider implements CoreComputeProvider {
|
|
|
22
34
|
parameter(index: number, value: unknown): string;
|
|
23
35
|
displayQuery(sql: string, parameters: readonly unknown[]): string;
|
|
24
36
|
dateBucket(expression: string, level: string): string;
|
|
37
|
+
datePart(expression: string, part: DatePart): string;
|
|
25
38
|
dateShift(expression: string, granularity: string, offset: number): string;
|
|
26
39
|
aggregateFunction(name: string, expression?: string): string;
|
|
27
40
|
stringify(expression: string): string;
|
|
28
41
|
concat(expressions: readonly string[]): string;
|
|
29
42
|
substring(expression: string, start: number, length: number): string;
|
|
43
|
+
stringLength(expression: string): string;
|
|
30
44
|
regex(expression: string, pattern: string, options?: string): string;
|
|
31
45
|
arrayContains(arrayExpression: string, valueExpression: string): string;
|
|
32
46
|
expandArray(arrayExpression: string, alias: string, column: string): {
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
export type DataRow = Record<string, unknown>;
|
|
2
2
|
export type SqlParameters = readonly unknown[];
|
|
3
|
+
export type DatePart = 'second' | 'minute' | 'hour' | 'weekday' | 'day' | 'week' | 'month' | 'quarter' | 'year';
|
|
4
|
+
/** Module-augmentation seam for application-owned Provider kinds. */
|
|
5
|
+
export interface ProviderKindExtensions {
|
|
6
|
+
}
|
|
7
|
+
export type ProviderKind = 'clickhouse' | 'databricks' | 'dameng' | 'doris' | 'duckdb' | 'gbase' | 'maxcompute' | 'mysql' | 'oracle' | 'postgresql' | 'snowflake' | 'sqlserver' | 'starrocks' | Extract<keyof ProviderKindExtensions, string>;
|
|
3
8
|
export interface ProviderExecutionRequest {
|
|
4
9
|
readonly sql: string;
|
|
5
10
|
readonly parameters: SqlParameters;
|
|
@@ -12,15 +17,25 @@ export interface SqlRenderCapabilities {
|
|
|
12
17
|
tableAlias(expression: string, alias: string): string;
|
|
13
18
|
paginate(sql: string, pageSize: number, offset: number): string;
|
|
14
19
|
dateBucket(expression: string, level: string): string;
|
|
20
|
+
/** Extract a numeric date component. weekday uses Monday=1 through Sunday=7. */
|
|
21
|
+
datePart(expression: string, part: DatePart): string;
|
|
15
22
|
dateShift(expression: string, granularity: string, offset: number): string;
|
|
16
23
|
datePeriodBoundary?(expression: string, granularity: string, boundary: 'start' | 'end'): string;
|
|
24
|
+
/** Cast a bound literal to the semantic type required by the SQL expression. */
|
|
25
|
+
castValue?(expression: string, type: string): string;
|
|
26
|
+
/** Render a NULL-ignoring scalar extremum without a correlated subquery. */
|
|
27
|
+
scalarExtremum?(operator: 'least' | 'greatest', expressions: readonly string[]): string;
|
|
17
28
|
aggregateFunction(name: string, expression?: string): string;
|
|
18
29
|
stringify(expression: string): string;
|
|
19
30
|
concat(expressions: readonly string[]): string;
|
|
20
31
|
substring(expression: string, start: number, length: number): string;
|
|
32
|
+
/** Return the number of characters in a string expression. */
|
|
33
|
+
stringLength(expression: string): string;
|
|
21
34
|
regex(expression: string, pattern: string, options?: string): string;
|
|
22
35
|
/** Whether the dialect supports a WITH RECURSIVE subquery. */
|
|
23
36
|
readonly supportsRecursiveCte?: boolean;
|
|
37
|
+
/** Recursive-term set operator. Defaults to UNION when omitted. */
|
|
38
|
+
readonly recursiveCteUnion?: 'UNION' | 'UNION ALL';
|
|
24
39
|
arrayContains?(arrayExpression: string, valueExpression: string): string;
|
|
25
40
|
expandArray?(arrayExpression: string, alias: string, column: string): {
|
|
26
41
|
readonly joinSql: string;
|
|
@@ -31,7 +46,7 @@ export interface SqlRenderCapabilities {
|
|
|
31
46
|
* Internal physical database contract used by the compiler and executor.
|
|
32
47
|
*/
|
|
33
48
|
export interface CoreComputeProvider extends SqlRenderCapabilities {
|
|
34
|
-
readonly kind:
|
|
49
|
+
readonly kind: ProviderKind;
|
|
35
50
|
/** Maximum items accepted by one SQL IN expression, when the dialect has a limit. */
|
|
36
51
|
readonly maxInListItems?: number;
|
|
37
52
|
parameter(index: number, value: unknown): string;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type { CoreComputeProvider, DataRow, ProviderExecutionRequest } from './provider';
|
|
1
|
+
import type { CoreComputeProvider, DatePart, DataRow, ProviderExecutionRequest } from './provider';
|
|
3
2
|
type SnowflakeBind = string | number | boolean | null;
|
|
4
3
|
export interface SnowflakeStatementLike {
|
|
5
4
|
cancel(callback?: (error?: Error) => void): void;
|
|
@@ -13,9 +12,20 @@ export interface SnowflakeConnectionLike {
|
|
|
13
12
|
}): SnowflakeStatementLike;
|
|
14
13
|
destroy(callback: (error?: Error) => void): unknown;
|
|
15
14
|
}
|
|
15
|
+
export interface SnowflakeConnectionOptions {
|
|
16
|
+
readonly account?: string;
|
|
17
|
+
readonly username?: string;
|
|
18
|
+
readonly password?: string;
|
|
19
|
+
readonly warehouse?: string;
|
|
20
|
+
readonly database?: string;
|
|
21
|
+
readonly schema?: string;
|
|
22
|
+
readonly role?: string;
|
|
23
|
+
readonly authenticator?: string;
|
|
24
|
+
readonly [option: string]: unknown;
|
|
25
|
+
}
|
|
16
26
|
export interface SnowflakeProviderOptions {
|
|
17
27
|
/** Options passed to snowflake-sdk's createConnection(). */
|
|
18
|
-
readonly connection?:
|
|
28
|
+
readonly connection?: object;
|
|
19
29
|
/** Injectable SDK connection used by tests or caller-managed connection factories. */
|
|
20
30
|
readonly client?: SnowflakeConnectionLike;
|
|
21
31
|
}
|
|
@@ -29,11 +39,13 @@ export declare class SnowflakeProvider implements CoreComputeProvider {
|
|
|
29
39
|
parameter(index: number, value: unknown): string;
|
|
30
40
|
displayQuery(sql: string, parameters: readonly unknown[]): string;
|
|
31
41
|
dateBucket(expression: string, level: string): string;
|
|
42
|
+
datePart(expression: string, part: DatePart): string;
|
|
32
43
|
dateShift(expression: string, granularity: string, offset: number): string;
|
|
33
44
|
aggregateFunction(name: string, expression?: string): string;
|
|
34
45
|
stringify(expression: string): string;
|
|
35
46
|
concat(expressions: readonly string[]): string;
|
|
36
47
|
substring(expression: string, start: number, length: number): string;
|
|
48
|
+
stringLength(expression: string): string;
|
|
37
49
|
regex(expression: string, pattern: string, options?: string): string;
|
|
38
50
|
arrayContains(arrayExpression: string, valueExpression: string): string;
|
|
39
51
|
expandArray(arrayExpression: string, alias: string, column: string): {
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import type { CoreComputeProvider, DataRow, DatePart, ProviderExecutionRequest } from './provider';
|
|
2
|
+
type SQLServerBind = string | number | boolean | Date | Buffer | null;
|
|
3
|
+
export interface SQLServerRequestLike {
|
|
4
|
+
input(name: string, value: SQLServerBind): this;
|
|
5
|
+
query(sql: string): Promise<{
|
|
6
|
+
readonly recordset?: unknown;
|
|
7
|
+
}>;
|
|
8
|
+
cancel(): void;
|
|
9
|
+
}
|
|
10
|
+
export interface SQLServerPoolLike {
|
|
11
|
+
connect(): Promise<unknown>;
|
|
12
|
+
request(): SQLServerRequestLike;
|
|
13
|
+
close(): Promise<void>;
|
|
14
|
+
}
|
|
15
|
+
export interface SQLServerDriverLike {
|
|
16
|
+
readonly ConnectionPool: new (options: object) => SQLServerPoolLike;
|
|
17
|
+
}
|
|
18
|
+
export interface SQLServerConnectionOptions {
|
|
19
|
+
readonly host?: string;
|
|
20
|
+
readonly server?: string;
|
|
21
|
+
readonly port?: number;
|
|
22
|
+
readonly user?: string;
|
|
23
|
+
readonly password?: string;
|
|
24
|
+
readonly database?: string;
|
|
25
|
+
readonly options?: Readonly<Record<string, unknown>>;
|
|
26
|
+
readonly pool?: Readonly<Record<string, unknown>>;
|
|
27
|
+
readonly requestTimeout?: number;
|
|
28
|
+
readonly connectionTimeout?: number;
|
|
29
|
+
readonly [option: string]: unknown;
|
|
30
|
+
}
|
|
31
|
+
export interface SQLServerProviderOptions {
|
|
32
|
+
readonly connection?: SQLServerConnectionOptions;
|
|
33
|
+
readonly pool?: SQLServerPoolLike;
|
|
34
|
+
readonly driver?: SQLServerDriverLike;
|
|
35
|
+
}
|
|
36
|
+
export declare const sqlServerPoolOptions: (connection: SQLServerConnectionOptions) => object;
|
|
37
|
+
export declare class SQLServerProvider implements CoreComputeProvider {
|
|
38
|
+
#private;
|
|
39
|
+
readonly kind: "sqlserver";
|
|
40
|
+
readonly supportsHavingAlias = false;
|
|
41
|
+
constructor(options?: SQLServerProviderOptions);
|
|
42
|
+
quoteIdentifier(identifier: string): string;
|
|
43
|
+
tableAlias(expression: string, alias: string): string;
|
|
44
|
+
paginate(sql: string, pageSize: number, offset: number): string;
|
|
45
|
+
parameter(index: number, value: unknown): string;
|
|
46
|
+
displayQuery(sql: string, parameters: readonly unknown[]): string;
|
|
47
|
+
dateBucket(expression: string, level: string): string;
|
|
48
|
+
datePart(expression: string, part: DatePart): string;
|
|
49
|
+
dateShift(expression: string, granularity: string, offset: number): string;
|
|
50
|
+
castValue(expression: string, type: string): string;
|
|
51
|
+
aggregateFunction(name: string, expression?: string): string;
|
|
52
|
+
stringify(expression: string): string;
|
|
53
|
+
concat(expressions: readonly string[]): string;
|
|
54
|
+
substring(expression: string, start: number, length: number): string;
|
|
55
|
+
stringLength(expression: string): string;
|
|
56
|
+
regex(expression: string, pattern: string, options?: string): string;
|
|
57
|
+
arrayContains(arrayExpression: string, valueExpression: string): string;
|
|
58
|
+
expandArray(arrayExpression: string, alias: string, column: string): {
|
|
59
|
+
readonly joinSql: string;
|
|
60
|
+
readonly valueExpression: string;
|
|
61
|
+
};
|
|
62
|
+
execute(execution: ProviderExecutionRequest): Promise<DataRow[]>;
|
|
63
|
+
close(): Promise<void>;
|
|
64
|
+
}
|
|
65
|
+
export {};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { MySQLProtocolProvider } from './mysql-protocol-provider';
|
|
2
|
-
import type { MySQLProtocolPoolLike, MySQLProtocolProviderOptions } from './mysql-protocol-provider';
|
|
2
|
+
import type { MySQLProtocolPoolLike, MySQLProtocolConnectionOptions, MySQLProtocolProviderOptions } from './mysql-protocol-provider';
|
|
3
3
|
export type StarRocksPoolLike = MySQLProtocolPoolLike;
|
|
4
|
+
export type StarRocksConnectionOptions = MySQLProtocolConnectionOptions;
|
|
4
5
|
export type StarRocksProviderOptions = MySQLProtocolProviderOptions;
|
|
5
6
|
/** StarRocks adapter using its MySQL-compatible protocol and SQL surface. */
|
|
6
7
|
export declare class StarRocksProvider extends MySQLProtocolProvider {
|
|
@@ -2,4 +2,4 @@ import type { OperatorRegistry } from '../operators/index';
|
|
|
2
2
|
import type { CoreComputeProvider } from '../physical/index';
|
|
3
3
|
import type { ResolvedSemanticSchema } from '../semantic-types/index';
|
|
4
4
|
import type { LogicalPlan, QueryLineage } from './types';
|
|
5
|
-
export declare const buildLineage: (plan: LogicalPlan, schema: ResolvedSemanticSchema, provider: CoreComputeProvider, operators?: OperatorRegistry) => QueryLineage;
|
|
5
|
+
export declare const buildLineage: (plan: LogicalPlan, schema: ResolvedSemanticSchema, provider: CoreComputeProvider, operators?: OperatorRegistry, providerForConnection?: (connectionId: string) => CoreComputeProvider) => QueryLineage;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import type { LogicformType } from '../logicform-types';
|
|
2
2
|
import type { OperatorRegistry } from '../operators/index';
|
|
3
3
|
import { SchemaMappingRegistry } from '../schema-mappings/index';
|
|
4
|
+
import type { SchemaMappingSelection } from '../schema-mappings/index';
|
|
5
|
+
import type { SemanticDBPlugin } from '../plugins/index';
|
|
4
6
|
import type { ResolvedSemanticSchema } from '../semantic-types/index';
|
|
5
7
|
import type { ResolvedSemanticProperty } from '../semantic-types/index';
|
|
6
8
|
import { type PlannerSemanticRegistry } from './semantics/index';
|
|
@@ -8,8 +10,13 @@ import type { LogicalPlan } from './types';
|
|
|
8
10
|
export declare const createResultSchema: (plan: LogicalPlan, sourceSchema: ResolvedSemanticSchema) => ResolvedSemanticSchema;
|
|
9
11
|
export declare const createDerivedSourceSchema: (sourcePlan: LogicalPlan, outerSchema: ResolvedSemanticSchema) => ResolvedSemanticSchema;
|
|
10
12
|
export interface CreateLogicalPlanOptions {
|
|
13
|
+
readonly plugins?: readonly SemanticDBPlugin[];
|
|
11
14
|
readonly resolveSchema?: (schemaId: string) => ResolvedSemanticSchema;
|
|
15
|
+
/** Prefer physical mappings colocated with the execution's main connection. */
|
|
16
|
+
readonly preferredConnectionId?: string;
|
|
12
17
|
readonly canUsePropertyRowIdentity?: (schema: ResolvedSemanticSchema, property: ResolvedSemanticProperty) => boolean;
|
|
13
18
|
readonly semanticRegistry?: PlannerSemanticRegistry;
|
|
19
|
+
/** Observe each physical Schema mapping decision made during planning. */
|
|
20
|
+
readonly onSchemaMappingSelection?: (selection: SchemaMappingSelection) => void;
|
|
14
21
|
}
|
|
15
22
|
export declare const createLogicalPlan: (logicform: LogicformType, schema: ResolvedSemanticSchema, operators?: OperatorRegistry, schemaMappings?: SchemaMappingRegistry, options?: CreateLogicalPlanOptions) => LogicalPlan;
|
package/dist/planner/index.d.ts
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
export { buildLineage } from './build-lineage';
|
|
2
2
|
export { createDerivedSourceSchema, createLogicalPlan, createResultSchema } from './create-logical-plan';
|
|
3
3
|
export type { CreateLogicalPlanOptions } from './create-logical-plan';
|
|
4
|
-
export type { Expression, ArrayExpansionPlan, FieldReferencePlan, GroupLimitPlan, JoinPlan, LogicalQuerySubquery,
|
|
5
|
-
export { isLogicalQuerySubquery,
|
|
4
|
+
export type { Expression, ArrayExpansionPlan, EnrichmentJoinPlan, FieldReferencePlan, GroupLimitPlan, JoinPlan, LogicalQuerySubquery, LogicalQueryOperator, LogicalOrdinalQuery, LogicalExpressionQuery, LineageColumnSource, LineageOutput, LogicalPlan, OrderPlan, PaginationPlan, ProjectionPlan, QueryLineage, RowIdentityPlan, PeriodSourcePlan, TemporalJoinConditionPlan, } from './types';
|
|
5
|
+
export { isLogicalQuerySubquery, isLogicalQueryOperator } from './types';
|
|
6
6
|
export { isLogicalOrdinalQuery } from './types';
|
|
7
|
+
export { isLogicalExpressionQuery } from './types';
|
|
7
8
|
export * from './semantics/index';
|
|
9
|
+
export { createPlannerSemanticRegistry } from './semantics/registry-defaults';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { LogicformType } from '../logicform-types';
|
|
2
|
+
import type { SemanticDBPlugin } from '../plugins/index';
|
|
3
|
+
import { type OperatorRegistry } from '../operators/index';
|
|
4
|
+
import { type SchemaMappingDefinition } from '../schema-mappings/index';
|
|
5
|
+
import type { ResolvedSemanticSchema } from '../semantic-types/index';
|
|
6
|
+
/** Checks grouped-source Property coverage and delegates plugin-owned physical grains. */
|
|
7
|
+
export declare const mappingGranularityReason: (logicform: LogicformType, schema: ResolvedSemanticSchema, mapping: SchemaMappingDefinition, resolveSchema?: (schemaId: string) => ResolvedSemanticSchema, plugins?: readonly SemanticDBPlugin[], operators?: OperatorRegistry) => string | undefined;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { LogicformType } from '../logicform-types';
|
|
2
|
+
import type { OperatorRegistry } from '../operators/index';
|
|
3
|
+
/**
|
|
4
|
+
* Lift component inputs into a derived LogicForm so ordinary expression operators can consume
|
|
5
|
+
* their result columns. The inner LogicForm owns source-grain work; the outer LogicForm owns
|
|
6
|
+
* result operations and the expression path above every component.
|
|
7
|
+
*/
|
|
8
|
+
export declare const rewriteNestedComponents: (logicform: LogicformType, operators: OperatorRegistry) => LogicformType | undefined;
|