semanticdb-v2 2.0.0-alpha.5 → 2.0.0-alpha.7
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 +272 -7
- 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/executor/connection-registry.d.ts +1 -12
- 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 +3 -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 +33 -4
- package/dist/index.d.ts +9 -7
- package/dist/logicform-types.d.ts +44 -12
- package/dist/normalizer/core.d.ts +9 -0
- package/dist/normalizer/pred-expression.d.ts +6 -0
- package/dist/operators/builtins/query-expression.d.ts +3 -0
- package/dist/operators/index.d.ts +1 -1
- package/dist/operators/types.d.ts +39 -8
- package/dist/physical/clickhouse-provider.d.ts +20 -2
- package/dist/physical/connection-registry.d.ts +13 -0
- package/dist/physical/connection.d.ts +57 -15
- package/dist/physical/dameng-provider.d.ts +66 -0
- package/dist/physical/databricks-provider.d.ts +88 -0
- package/dist/physical/db-connector.d.ts +23 -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 +24 -9
- package/dist/physical/load-driver.d.ts +1 -0
- package/dist/physical/maxcompute-provider.d.ts +44 -0
- package/dist/physical/mysql-protocol-provider.d.ts +24 -6
- package/dist/physical/mysql-provider.d.ts +2 -1
- package/dist/physical/oracle-provider.d.ts +20 -4
- package/dist/physical/postgresql-provider.d.ts +23 -4
- package/dist/physical/provider.d.ts +57 -1
- package/dist/physical/snowflake-provider.d.ts +19 -3
- package/dist/physical/sqlserver-provider.d.ts +69 -0
- package/dist/physical/starrocks-provider.d.ts +2 -1
- package/dist/physical/table-description.d.ts +5 -0
- package/dist/physical/table-discovery.d.ts +10 -0
- 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 -4
- 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 +71 -34
- 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/{planner/semantics → plugins}/observation/periods.d.ts +2 -3
- 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/{planner/semantics → plugins}/validity/index.d.ts +9 -0
- package/dist/{planner/semantics → plugins}/validity/periods.d.ts +2 -3
- package/dist/{planner/semantics → plugins}/validity/query-policy.d.ts +1 -2
- package/dist/{planner/semantics → plugins}/validity/rule.d.ts +1 -1
- package/dist/plugins/validity/semantic-types.d.ts +3 -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 +0 -14
- package/dist/semantic-types/validate-resolved-schema.d.ts +2 -5
- package/dist/semanticdb.esm.js +5 -3
- package/dist/semanticdb.js +5 -3
- package/package.json +46 -5
- package/dist/planner/semantics/annual-periods.d.ts +0 -11
- package/dist/planner/semantics/lifecycle/classification.d.ts +0 -5
- package/dist/planner/semantics/lifecycle/index.d.ts +0 -3
- package/dist/planner/semantics/lifecycle/query-policy.d.ts +0 -2
- package/dist/planner/semantics/lifecycle/rule.d.ts +0 -2
- package/dist/planner/semantics/observation/index.d.ts +0 -6
- package/dist/planner/semantics/validity/classification.d.ts +0 -14
- package/dist/semantic-types/builtins/end-date.d.ts +0 -2
- package/dist/semantic-types/builtins/start-date.d.ts +0 -2
|
@@ -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,33 @@
|
|
|
1
1
|
/** Internal physical adapters selected from the public database connection configuration. */
|
|
2
|
-
export type { CoreComputeProvider, DataRow, ProviderExecutionRequest, SqlRenderCapabilities, SqlParameters, } from './provider';
|
|
3
|
-
export {
|
|
4
|
-
export
|
|
2
|
+
export type { CoreComputeProvider, DatePart, DataRow, DatabaseTable, SQLResult, TableListRequest, DescribeTableRequest, DatabaseColumn, TableDescription, ProviderExecutionRequest, ProviderKind, ProviderKindExtensions, SqlRenderCapabilities, SqlParameters, } from './provider';
|
|
3
|
+
export { ConnectionRegistry, getConnectionProvider, closeConnections } from './connection-registry';
|
|
4
|
+
export { DBConnector } from './db-connector';
|
|
5
|
+
export type { DBConnectorOptions, RunSQLOptions, GetTableListOptions, DescribeTableOptions } from './db-connector';
|
|
6
|
+
export { builtinProviderDefinitions, createProvider, defaultProviderRegistry, ProviderRegistry, } from './connection';
|
|
7
|
+
export type { BuiltinDatabaseConnection, DatabaseConnection, DatabaseConnectionBase, DatabaseConnectionExtensions, ProviderDefinition, } from './connection';
|
|
8
|
+
export { DuckDBCoordinatorProvider } from './duckdb-coordinator-provider';
|
|
9
|
+
export type { DuckDBCoordinatorColumn, DuckDBCoordinatorColumnKind, } from './duckdb-coordinator-provider';
|
|
5
10
|
export { ClickHouseProvider, } from './clickhouse-provider';
|
|
6
11
|
export type { ClickHouseClientLike, ClickHouseProviderOptions, } from './clickhouse-provider';
|
|
12
|
+
export { DatabricksProvider } from './databricks-provider';
|
|
13
|
+
export type { DatabricksClientLike, DatabricksConnectionBase, DatabricksConnectionOptions, DatabricksAccessTokenAuth, DatabricksOAuthAuth, DatabricksProviderOptions, DatabricksSessionLike, DatabricksOperationLike, } from './databricks-provider';
|
|
14
|
+
export { DamengProvider } from './dameng-provider';
|
|
15
|
+
export type { DamengConnectionLike, DamengConnectionOptions, DamengDriverLike, DamengPoolLike, DamengPoolOptions, DamengProviderOptions, } from './dameng-provider';
|
|
7
16
|
export { DorisProvider } from './doris-provider';
|
|
8
|
-
export type { DorisPoolLike, DorisProviderOptions } from './doris-provider';
|
|
17
|
+
export type { DorisConnectionOptions, DorisPoolLike, DorisProviderOptions } from './doris-provider';
|
|
18
|
+
export { GBaseProvider } from './gbase-provider';
|
|
19
|
+
export type { GBaseConnectionOptions, GBasePoolLike, GBaseProviderOptions } from './gbase-provider';
|
|
20
|
+
export { MaxComputeProvider } from './maxcompute-provider';
|
|
21
|
+
export type { MaxComputeClientLike, MaxComputeConnectionOptions, MaxComputeProviderOptions, } from './maxcompute-provider';
|
|
9
22
|
export { MySQLProvider } from './mysql-provider';
|
|
10
|
-
export type { MySQLPoolLike, MySQLProviderOptions } from './mysql-provider';
|
|
23
|
+
export type { MySQLConnectionOptions, MySQLPoolLike, MySQLProviderOptions } from './mysql-provider';
|
|
11
24
|
export { OracleProvider } from './oracle-provider';
|
|
12
|
-
export type { OracleConnectionLike, OracleDriverLike, OraclePoolLike, OracleProviderOptions, } from './oracle-provider';
|
|
25
|
+
export type { OracleConnectionLike, OracleConnectionOptions, OracleDriverLike, OraclePoolLike, OracleProviderOptions, } from './oracle-provider';
|
|
13
26
|
export { PostgreSQLProvider } from './postgresql-provider';
|
|
14
|
-
export type { PostgreSQLPoolLike, PostgreSQLProviderOptions, } from './postgresql-provider';
|
|
27
|
+
export type { PostgreSQLPoolLike, PostgreSQLConnectionOptions, PostgreSQLProviderOptions, } from './postgresql-provider';
|
|
15
28
|
export { SnowflakeProvider } from './snowflake-provider';
|
|
16
|
-
export type { SnowflakeConnectionLike, SnowflakeProviderOptions, SnowflakeStatementLike, } from './snowflake-provider';
|
|
29
|
+
export type { SnowflakeConnectionLike, SnowflakeConnectionOptions, SnowflakeProviderOptions, SnowflakeStatementLike, } from './snowflake-provider';
|
|
30
|
+
export { SQLServerProvider, sqlServerPoolOptions } from './sqlserver-provider';
|
|
31
|
+
export type { SQLServerConnectionOptions, SQLServerDriverLike, SQLServerPoolLike, SQLServerProviderOptions, SQLServerRequestLike, } from './sqlserver-provider';
|
|
17
32
|
export { StarRocksProvider } from './starrocks-provider';
|
|
18
|
-
export type { StarRocksPoolLike, StarRocksProviderOptions, } from './starrocks-provider';
|
|
33
|
+
export type { StarRocksPoolLike, StarRocksConnectionOptions, StarRocksProviderOptions, } from './starrocks-provider';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const driverLoadError: (packageName: string, cause: unknown) => Error;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import type { CoreComputeProvider, DataRow, DatePart, ProviderExecutionRequest, SqlParameters, SQLResult, DatabaseTable, TableListRequest, DescribeTableRequest, TableDescription } 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
|
+
/** Optional command metadata and project/schema-aware discovery extensions. */
|
|
9
|
+
runSQL?(request: ProviderExecutionRequest): Promise<SQLResult>;
|
|
10
|
+
getTableList?(request: TableListRequest): Promise<DatabaseTable[]>;
|
|
11
|
+
describeTable?(request: DescribeTableRequest): Promise<TableDescription>;
|
|
12
|
+
close(): Promise<void>;
|
|
13
|
+
}
|
|
14
|
+
export interface MaxComputeConnectionOptions {
|
|
15
|
+
readonly client: MaxComputeClientLike;
|
|
16
|
+
}
|
|
17
|
+
export type MaxComputeProviderOptions = MaxComputeConnectionOptions;
|
|
18
|
+
/** MaxCompute SQL dialect backed by a caller-owned parameterized execution client. */
|
|
19
|
+
export declare class MaxComputeProvider implements CoreComputeProvider {
|
|
20
|
+
#private;
|
|
21
|
+
readonly kind: "maxcompute";
|
|
22
|
+
readonly supportsRecursiveCte = false;
|
|
23
|
+
constructor(options: MaxComputeProviderOptions);
|
|
24
|
+
quoteIdentifier(identifier: string): string;
|
|
25
|
+
tableAlias(expression: string, alias: string): string;
|
|
26
|
+
paginate(sql: string, pageSize: number, offset: number): string;
|
|
27
|
+
parameter(index: number, value: unknown): string;
|
|
28
|
+
displayQuery(sql: string, parameters: SqlParameters): string;
|
|
29
|
+
dateBucket(expression: string, level: string): string;
|
|
30
|
+
datePart(expression: string, part: DatePart): string;
|
|
31
|
+
dateShift(expression: string, granularity: string, offset: number): string;
|
|
32
|
+
datePeriodBoundary(expression: string, granularity: string, boundary: 'start' | 'end'): string;
|
|
33
|
+
aggregateFunction(name: string, expression?: string): string;
|
|
34
|
+
stringify(expression: string): string;
|
|
35
|
+
concat(expressions: readonly string[]): string;
|
|
36
|
+
substring(expression: string, start: number, length: number): string;
|
|
37
|
+
stringLength(expression: string): string;
|
|
38
|
+
regex(expression: string, pattern: string, options?: string): string;
|
|
39
|
+
execute(request: ProviderExecutionRequest): Promise<DataRow[]>;
|
|
40
|
+
runSQL(request: ProviderExecutionRequest): Promise<SQLResult>;
|
|
41
|
+
getTableList(request: TableListRequest): Promise<DatabaseTable[]>;
|
|
42
|
+
close(): Promise<void>;
|
|
43
|
+
describeTable(request: DescribeTableRequest): Promise<TableDescription>;
|
|
44
|
+
}
|
|
@@ -1,17 +1,30 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type { CoreComputeProvider, DataRow, ProviderExecutionRequest, SqlParameters } from './provider';
|
|
1
|
+
import type { CoreComputeProvider, DatePart, DataRow, ProviderExecutionRequest, SqlParameters, SQLResult, DatabaseTable, TableListRequest, DescribeTableRequest, TableDescription } 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): {
|
|
@@ -32,5 +47,8 @@ export declare abstract class MySQLProtocolProvider implements CoreComputeProvid
|
|
|
32
47
|
readonly valueExpression: string;
|
|
33
48
|
};
|
|
34
49
|
execute(request: ProviderExecutionRequest): Promise<DataRow[]>;
|
|
50
|
+
runSQL(request: ProviderExecutionRequest): Promise<SQLResult>;
|
|
51
|
+
getTableList(request: TableListRequest): Promise<DatabaseTable[]>;
|
|
52
|
+
describeTable(request: DescribeTableRequest): Promise<TableDescription>;
|
|
35
53
|
close(): Promise<void>;
|
|
36
54
|
}
|
|
@@ -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,11 +1,12 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type { CoreComputeProvider, DataRow, ProviderExecutionRequest } from './provider';
|
|
1
|
+
import type { CoreComputeProvider, DatePart, DataRow, ProviderExecutionRequest, SQLResult, DatabaseTable, TableListRequest, DescribeTableRequest, TableDescription } 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: {
|
|
6
5
|
readonly outFormat: number;
|
|
6
|
+
readonly autoCommit?: boolean;
|
|
7
7
|
}): Promise<{
|
|
8
8
|
readonly rows?: unknown[] | undefined;
|
|
9
|
+
readonly rowsAffected?: number | undefined;
|
|
9
10
|
}>;
|
|
10
11
|
break(): Promise<void>;
|
|
11
12
|
close(): Promise<void>;
|
|
@@ -14,12 +15,22 @@ export interface OraclePoolLike {
|
|
|
14
15
|
getConnection(): Promise<OracleConnectionLike>;
|
|
15
16
|
close(drainTime?: number): Promise<void>;
|
|
16
17
|
}
|
|
18
|
+
export interface OracleConnectionOptions {
|
|
19
|
+
readonly user?: string;
|
|
20
|
+
readonly password?: string;
|
|
21
|
+
readonly connectString?: string;
|
|
22
|
+
readonly poolMin?: number;
|
|
23
|
+
readonly poolMax?: number;
|
|
24
|
+
readonly poolIncrement?: number;
|
|
25
|
+
readonly poolTimeout?: number;
|
|
26
|
+
readonly [option: string]: unknown;
|
|
27
|
+
}
|
|
17
28
|
export interface OracleDriverLike {
|
|
18
|
-
createPool(options:
|
|
29
|
+
createPool(options: OracleConnectionOptions): Promise<OraclePoolLike>;
|
|
19
30
|
}
|
|
20
31
|
export interface OracleProviderOptions {
|
|
21
32
|
/** Passed to oracledb.createPool(). Thin mode is used unless the caller initialized Thick mode. */
|
|
22
|
-
readonly connection?:
|
|
33
|
+
readonly connection?: object;
|
|
23
34
|
/** Injectable pool for applications that own pool creation or for tests. */
|
|
24
35
|
readonly pool?: OraclePoolLike;
|
|
25
36
|
/** Injectable driver factory used to test lazy pool creation. */
|
|
@@ -37,11 +48,13 @@ export declare class OracleProvider implements CoreComputeProvider {
|
|
|
37
48
|
parameter(index: number, value: unknown): string;
|
|
38
49
|
displayQuery(sql: string, parameters: readonly unknown[]): string;
|
|
39
50
|
dateBucket(expression: string, level: string): string;
|
|
51
|
+
datePart(expression: string, part: DatePart): string;
|
|
40
52
|
dateShift(expression: string, granularity: string, offset: number): string;
|
|
41
53
|
aggregateFunction(name: string, expression?: string): string;
|
|
42
54
|
stringify(expression: string): string;
|
|
43
55
|
concat(expressions: readonly string[]): string;
|
|
44
56
|
substring(expression: string, start: number, length: number): string;
|
|
57
|
+
stringLength(expression: string): string;
|
|
45
58
|
regex(expression: string, pattern: string, options?: string): string;
|
|
46
59
|
arrayContains(arrayExpression: string, valueExpression: string): string;
|
|
47
60
|
expandArray(arrayExpression: string, alias: string, column: string): {
|
|
@@ -49,6 +62,9 @@ export declare class OracleProvider implements CoreComputeProvider {
|
|
|
49
62
|
valueExpression: string;
|
|
50
63
|
};
|
|
51
64
|
execute(request: ProviderExecutionRequest): Promise<DataRow[]>;
|
|
65
|
+
runSQL(request: ProviderExecutionRequest): Promise<SQLResult>;
|
|
66
|
+
getTableList(request: TableListRequest): Promise<DatabaseTable[]>;
|
|
67
|
+
describeTable(request: DescribeTableRequest): Promise<TableDescription>;
|
|
52
68
|
close(): Promise<void>;
|
|
53
69
|
}
|
|
54
70
|
export {};
|
|
@@ -1,20 +1,34 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type { CoreComputeProvider, DataRow, ProviderExecutionRequest } from './provider';
|
|
1
|
+
import type { CoreComputeProvider, DatePart, DataRow, ProviderExecutionRequest, SQLResult, DatabaseTable, TableListRequest, DescribeTableRequest, TableDescription } from './provider';
|
|
3
2
|
export interface PostgreSQLPoolLike {
|
|
4
3
|
query(sql: string, values: unknown[]): Promise<{
|
|
5
4
|
readonly rows: unknown;
|
|
5
|
+
readonly rowCount?: number | null;
|
|
6
|
+
readonly command?: string;
|
|
6
7
|
}>;
|
|
7
8
|
end(): Promise<void>;
|
|
8
9
|
}
|
|
10
|
+
export interface PostgreSQLConnectionOptions {
|
|
11
|
+
readonly connectionString?: string;
|
|
12
|
+
readonly host?: string;
|
|
13
|
+
readonly port?: number;
|
|
14
|
+
readonly user?: string;
|
|
15
|
+
readonly password?: string;
|
|
16
|
+
readonly database?: string;
|
|
17
|
+
readonly ssl?: unknown;
|
|
18
|
+
readonly max?: number;
|
|
19
|
+
readonly idleTimeoutMillis?: number;
|
|
20
|
+
readonly connectionTimeoutMillis?: number;
|
|
21
|
+
readonly [option: string]: unknown;
|
|
22
|
+
}
|
|
9
23
|
export interface PostgreSQLProviderOptions {
|
|
10
|
-
readonly connection?:
|
|
24
|
+
readonly connection?: object;
|
|
11
25
|
readonly pool?: PostgreSQLPoolLike;
|
|
12
26
|
}
|
|
13
27
|
export declare class PostgreSQLProvider implements CoreComputeProvider {
|
|
28
|
+
#private;
|
|
14
29
|
readonly kind: "postgresql";
|
|
15
30
|
readonly supportsHavingAlias = false;
|
|
16
31
|
readonly supportsRecursiveCte = true;
|
|
17
|
-
private readonly pool;
|
|
18
32
|
constructor(options?: PostgreSQLProviderOptions);
|
|
19
33
|
quoteIdentifier(identifier: string): string;
|
|
20
34
|
tableAlias(expression: string, alias: string): string;
|
|
@@ -22,11 +36,13 @@ export declare class PostgreSQLProvider implements CoreComputeProvider {
|
|
|
22
36
|
parameter(index: number, value: unknown): string;
|
|
23
37
|
displayQuery(sql: string, parameters: readonly unknown[]): string;
|
|
24
38
|
dateBucket(expression: string, level: string): string;
|
|
39
|
+
datePart(expression: string, part: DatePart): string;
|
|
25
40
|
dateShift(expression: string, granularity: string, offset: number): string;
|
|
26
41
|
aggregateFunction(name: string, expression?: string): string;
|
|
27
42
|
stringify(expression: string): string;
|
|
28
43
|
concat(expressions: readonly string[]): string;
|
|
29
44
|
substring(expression: string, start: number, length: number): string;
|
|
45
|
+
stringLength(expression: string): string;
|
|
30
46
|
regex(expression: string, pattern: string, options?: string): string;
|
|
31
47
|
arrayContains(arrayExpression: string, valueExpression: string): string;
|
|
32
48
|
expandArray(arrayExpression: string, alias: string, column: string): {
|
|
@@ -34,5 +50,8 @@ export declare class PostgreSQLProvider implements CoreComputeProvider {
|
|
|
34
50
|
valueExpression: string;
|
|
35
51
|
};
|
|
36
52
|
execute(request: ProviderExecutionRequest): Promise<DataRow[]>;
|
|
53
|
+
getTableList(request: TableListRequest): Promise<DatabaseTable[]>;
|
|
54
|
+
describeTable(request: DescribeTableRequest): Promise<TableDescription>;
|
|
55
|
+
runSQL(request: ProviderExecutionRequest): Promise<SQLResult>;
|
|
37
56
|
close(): Promise<void>;
|
|
38
57
|
}
|
|
@@ -1,10 +1,55 @@
|
|
|
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;
|
|
6
11
|
readonly signal?: AbortSignal;
|
|
7
12
|
}
|
|
13
|
+
/** Native SQL results, without semantic hydration or generated row identities. */
|
|
14
|
+
export interface SQLResult {
|
|
15
|
+
readonly rows: DataRow[];
|
|
16
|
+
/** Omitted when the driver does not report an affected-row count. */
|
|
17
|
+
readonly affectedRows?: number;
|
|
18
|
+
}
|
|
19
|
+
export interface DatabaseTable {
|
|
20
|
+
readonly name: string;
|
|
21
|
+
readonly database?: string;
|
|
22
|
+
readonly schema?: string;
|
|
23
|
+
readonly type: 'table' | 'view';
|
|
24
|
+
}
|
|
25
|
+
export interface TableListRequest {
|
|
26
|
+
/** Database/catalog override; unsupported scopes are rejected, not ignored. */
|
|
27
|
+
readonly database?: string;
|
|
28
|
+
readonly schema?: string;
|
|
29
|
+
readonly signal?: AbortSignal;
|
|
30
|
+
}
|
|
31
|
+
export interface DescribeTableRequest extends TableListRequest {
|
|
32
|
+
/** Literal, unqualified physical table name; use database/schema for its namespace. */
|
|
33
|
+
readonly table: string;
|
|
34
|
+
/** Read one example row by default. Disable to inspect metadata only. */
|
|
35
|
+
readonly includeSample?: boolean;
|
|
36
|
+
}
|
|
37
|
+
export interface DatabaseColumn {
|
|
38
|
+
readonly name: string;
|
|
39
|
+
/** Native database type, including size/precision where available. */
|
|
40
|
+
readonly type: string;
|
|
41
|
+
readonly comment: string;
|
|
42
|
+
/** Omitted if the database/adapter cannot report primary-key membership. */
|
|
43
|
+
readonly primaryKey?: boolean;
|
|
44
|
+
/** Omitted for empty tables, disabled sampling, or a failed sample query. */
|
|
45
|
+
readonly exampleValue?: unknown;
|
|
46
|
+
}
|
|
47
|
+
export interface TableDescription {
|
|
48
|
+
readonly columns: DatabaseColumn[];
|
|
49
|
+
readonly tableInfo: DatabaseTable & {
|
|
50
|
+
readonly comment: string;
|
|
51
|
+
};
|
|
52
|
+
}
|
|
8
53
|
export interface SqlRenderCapabilities {
|
|
9
54
|
/** Whether HAVING may reference an alias declared in the same SELECT list. */
|
|
10
55
|
readonly supportsHavingAlias?: boolean;
|
|
@@ -12,6 +57,8 @@ export interface SqlRenderCapabilities {
|
|
|
12
57
|
tableAlias(expression: string, alias: string): string;
|
|
13
58
|
paginate(sql: string, pageSize: number, offset: number): string;
|
|
14
59
|
dateBucket(expression: string, level: string): string;
|
|
60
|
+
/** Extract a numeric date component. weekday uses Monday=1 through Sunday=7. */
|
|
61
|
+
datePart(expression: string, part: DatePart): string;
|
|
15
62
|
dateShift(expression: string, granularity: string, offset: number): string;
|
|
16
63
|
datePeriodBoundary?(expression: string, granularity: string, boundary: 'start' | 'end'): string;
|
|
17
64
|
/** Cast a bound literal to the semantic type required by the SQL expression. */
|
|
@@ -22,9 +69,13 @@ export interface SqlRenderCapabilities {
|
|
|
22
69
|
stringify(expression: string): string;
|
|
23
70
|
concat(expressions: readonly string[]): string;
|
|
24
71
|
substring(expression: string, start: number, length: number): string;
|
|
72
|
+
/** Return the number of characters in a string expression. */
|
|
73
|
+
stringLength(expression: string): string;
|
|
25
74
|
regex(expression: string, pattern: string, options?: string): string;
|
|
26
75
|
/** Whether the dialect supports a WITH RECURSIVE subquery. */
|
|
27
76
|
readonly supportsRecursiveCte?: boolean;
|
|
77
|
+
/** Recursive-term set operator. Defaults to UNION when omitted. */
|
|
78
|
+
readonly recursiveCteUnion?: 'UNION' | 'UNION ALL';
|
|
28
79
|
arrayContains?(arrayExpression: string, valueExpression: string): string;
|
|
29
80
|
expandArray?(arrayExpression: string, alias: string, column: string): {
|
|
30
81
|
readonly joinSql: string;
|
|
@@ -35,12 +86,17 @@ export interface SqlRenderCapabilities {
|
|
|
35
86
|
* Internal physical database contract used by the compiler and executor.
|
|
36
87
|
*/
|
|
37
88
|
export interface CoreComputeProvider extends SqlRenderCapabilities {
|
|
38
|
-
readonly kind:
|
|
89
|
+
readonly kind: ProviderKind;
|
|
39
90
|
/** Maximum items accepted by one SQL IN expression, when the dialect has a limit. */
|
|
40
91
|
readonly maxInListItems?: number;
|
|
41
92
|
parameter(index: number, value: unknown): string;
|
|
42
93
|
/** Render bound parameters for diagnostics only; this SQL is never executed by SemanticDB. */
|
|
43
94
|
displayQuery(sql: string, parameters: SqlParameters): string;
|
|
44
95
|
execute(request: ProviderExecutionRequest): Promise<DataRow[]>;
|
|
96
|
+
/** Optional native-SQL capability; execute retains its row-query contract. */
|
|
97
|
+
runSQL?(request: ProviderExecutionRequest): Promise<SQLResult>;
|
|
98
|
+
/** Optional physical metadata capability, independent of semantic Schemas. */
|
|
99
|
+
getTableList?(request: TableListRequest): Promise<DatabaseTable[]>;
|
|
100
|
+
describeTable?(request: DescribeTableRequest): Promise<TableDescription>;
|
|
45
101
|
close(): Promise<void>;
|
|
46
102
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type { CoreComputeProvider, DataRow, ProviderExecutionRequest } from './provider';
|
|
1
|
+
import type { CoreComputeProvider, DatePart, DataRow, ProviderExecutionRequest, SQLResult, DatabaseTable, TableListRequest, DescribeTableRequest, TableDescription } from './provider';
|
|
3
2
|
type SnowflakeBind = string | number | boolean | null;
|
|
4
3
|
export interface SnowflakeStatementLike {
|
|
5
4
|
cancel(callback?: (error?: Error) => void): void;
|
|
5
|
+
getNumUpdatedRows?(): number | undefined;
|
|
6
6
|
}
|
|
7
7
|
export interface SnowflakeConnectionLike {
|
|
8
8
|
connect(callback: (error?: Error) => void): unknown;
|
|
@@ -13,9 +13,20 @@ export interface SnowflakeConnectionLike {
|
|
|
13
13
|
}): SnowflakeStatementLike;
|
|
14
14
|
destroy(callback: (error?: Error) => void): unknown;
|
|
15
15
|
}
|
|
16
|
+
export interface SnowflakeConnectionOptions {
|
|
17
|
+
readonly account?: string;
|
|
18
|
+
readonly username?: string;
|
|
19
|
+
readonly password?: string;
|
|
20
|
+
readonly warehouse?: string;
|
|
21
|
+
readonly database?: string;
|
|
22
|
+
readonly schema?: string;
|
|
23
|
+
readonly role?: string;
|
|
24
|
+
readonly authenticator?: string;
|
|
25
|
+
readonly [option: string]: unknown;
|
|
26
|
+
}
|
|
16
27
|
export interface SnowflakeProviderOptions {
|
|
17
28
|
/** Options passed to snowflake-sdk's createConnection(). */
|
|
18
|
-
readonly connection?:
|
|
29
|
+
readonly connection?: object;
|
|
19
30
|
/** Injectable SDK connection used by tests or caller-managed connection factories. */
|
|
20
31
|
readonly client?: SnowflakeConnectionLike;
|
|
21
32
|
}
|
|
@@ -29,11 +40,13 @@ export declare class SnowflakeProvider implements CoreComputeProvider {
|
|
|
29
40
|
parameter(index: number, value: unknown): string;
|
|
30
41
|
displayQuery(sql: string, parameters: readonly unknown[]): string;
|
|
31
42
|
dateBucket(expression: string, level: string): string;
|
|
43
|
+
datePart(expression: string, part: DatePart): string;
|
|
32
44
|
dateShift(expression: string, granularity: string, offset: number): string;
|
|
33
45
|
aggregateFunction(name: string, expression?: string): string;
|
|
34
46
|
stringify(expression: string): string;
|
|
35
47
|
concat(expressions: readonly string[]): string;
|
|
36
48
|
substring(expression: string, start: number, length: number): string;
|
|
49
|
+
stringLength(expression: string): string;
|
|
37
50
|
regex(expression: string, pattern: string, options?: string): string;
|
|
38
51
|
arrayContains(arrayExpression: string, valueExpression: string): string;
|
|
39
52
|
expandArray(arrayExpression: string, alias: string, column: string): {
|
|
@@ -41,6 +54,9 @@ export declare class SnowflakeProvider implements CoreComputeProvider {
|
|
|
41
54
|
valueExpression: string;
|
|
42
55
|
};
|
|
43
56
|
execute(request: ProviderExecutionRequest): Promise<DataRow[]>;
|
|
57
|
+
runSQL(request: ProviderExecutionRequest): Promise<SQLResult>;
|
|
58
|
+
getTableList(request: TableListRequest): Promise<DatabaseTable[]>;
|
|
59
|
+
describeTable(request: DescribeTableRequest): Promise<TableDescription>;
|
|
44
60
|
close(): Promise<void>;
|
|
45
61
|
}
|
|
46
62
|
export {};
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import type { CoreComputeProvider, DataRow, DatePart, ProviderExecutionRequest, SQLResult, DatabaseTable, TableListRequest, DescribeTableRequest, TableDescription } 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
|
+
readonly rowsAffected?: readonly number[];
|
|
8
|
+
}>;
|
|
9
|
+
cancel(): void;
|
|
10
|
+
}
|
|
11
|
+
export interface SQLServerPoolLike {
|
|
12
|
+
connect(): Promise<unknown>;
|
|
13
|
+
request(): SQLServerRequestLike;
|
|
14
|
+
close(): Promise<void>;
|
|
15
|
+
}
|
|
16
|
+
export interface SQLServerDriverLike {
|
|
17
|
+
readonly ConnectionPool: new (options: object) => SQLServerPoolLike;
|
|
18
|
+
}
|
|
19
|
+
export interface SQLServerConnectionOptions {
|
|
20
|
+
readonly host?: string;
|
|
21
|
+
readonly server?: string;
|
|
22
|
+
readonly port?: number;
|
|
23
|
+
readonly user?: string;
|
|
24
|
+
readonly password?: string;
|
|
25
|
+
readonly database?: string;
|
|
26
|
+
readonly options?: Readonly<Record<string, unknown>>;
|
|
27
|
+
readonly pool?: Readonly<Record<string, unknown>>;
|
|
28
|
+
readonly requestTimeout?: number;
|
|
29
|
+
readonly connectionTimeout?: number;
|
|
30
|
+
readonly [option: string]: unknown;
|
|
31
|
+
}
|
|
32
|
+
export interface SQLServerProviderOptions {
|
|
33
|
+
readonly connection?: SQLServerConnectionOptions;
|
|
34
|
+
readonly pool?: SQLServerPoolLike;
|
|
35
|
+
readonly driver?: SQLServerDriverLike;
|
|
36
|
+
}
|
|
37
|
+
export declare const sqlServerPoolOptions: (connection: SQLServerConnectionOptions) => object;
|
|
38
|
+
export declare class SQLServerProvider implements CoreComputeProvider {
|
|
39
|
+
#private;
|
|
40
|
+
readonly kind: "sqlserver";
|
|
41
|
+
readonly supportsHavingAlias = false;
|
|
42
|
+
constructor(options?: SQLServerProviderOptions);
|
|
43
|
+
quoteIdentifier(identifier: string): string;
|
|
44
|
+
tableAlias(expression: string, alias: string): string;
|
|
45
|
+
paginate(sql: string, pageSize: number, offset: number): string;
|
|
46
|
+
parameter(index: number, value: unknown): string;
|
|
47
|
+
displayQuery(sql: string, parameters: readonly unknown[]): string;
|
|
48
|
+
dateBucket(expression: string, level: string): string;
|
|
49
|
+
datePart(expression: string, part: DatePart): string;
|
|
50
|
+
dateShift(expression: string, granularity: string, offset: number): string;
|
|
51
|
+
castValue(expression: string, type: string): string;
|
|
52
|
+
aggregateFunction(name: string, expression?: string): string;
|
|
53
|
+
stringify(expression: string): string;
|
|
54
|
+
concat(expressions: readonly string[]): string;
|
|
55
|
+
substring(expression: string, start: number, length: number): string;
|
|
56
|
+
stringLength(expression: string): string;
|
|
57
|
+
regex(expression: string, pattern: string, options?: string): string;
|
|
58
|
+
arrayContains(arrayExpression: string, valueExpression: string): string;
|
|
59
|
+
expandArray(arrayExpression: string, alias: string, column: string): {
|
|
60
|
+
readonly joinSql: string;
|
|
61
|
+
readonly valueExpression: string;
|
|
62
|
+
};
|
|
63
|
+
execute(execution: ProviderExecutionRequest): Promise<DataRow[]>;
|
|
64
|
+
runSQL(execution: ProviderExecutionRequest): Promise<SQLResult>;
|
|
65
|
+
getTableList(request: TableListRequest): Promise<DatabaseTable[]>;
|
|
66
|
+
describeTable(request: DescribeTableRequest): Promise<TableDescription>;
|
|
67
|
+
close(): Promise<void>;
|
|
68
|
+
}
|
|
69
|
+
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 {
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { CoreComputeProvider, DataRow, DescribeTableRequest, TableDescription } from './provider';
|
|
2
|
+
export declare const validateDescribeTable: (request: DescribeTableRequest) => void;
|
|
3
|
+
/** INFORMATION_SCHEMA/Oracle expose size separately; PostgreSQL/MySQL already format native types. */
|
|
4
|
+
export declare const columnType: (row: DataRow) => string;
|
|
5
|
+
export declare const describePhysicalTable: (provider: CoreComputeProvider, request: DescribeTableRequest) => Promise<TableDescription>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { CoreComputeProvider, DatabaseTable, DataRow, TableListRequest } from './provider';
|
|
2
|
+
export declare const validateTableScope: (request: TableListRequest) => void;
|
|
3
|
+
export declare const rejectTableScope: (provider: CoreComputeProvider, field: "database" | "schema") => never;
|
|
4
|
+
/** Drivers differ in alias casing; never silently discard malformed metadata rows. */
|
|
5
|
+
export declare const metadataValue: (row: DataRow, field: string) => unknown;
|
|
6
|
+
export declare const metadataString: (row: DataRow, field: string) => string;
|
|
7
|
+
export declare const normalizeTableRow: (row: DataRow) => DatabaseTable;
|
|
8
|
+
export declare const normalizeTableMetadata: (rows: DataRow[]) => DatabaseTable[];
|
|
9
|
+
/** Physical metadata SQL only; no semantic Schema resolution belongs here. */
|
|
10
|
+
export declare const discoverTables: (provider: CoreComputeProvider, request: TableListRequest) => Promise<DatabaseTable[]>;
|
|
@@ -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;
|