semanticdb-v2 2.0.0-alpha.1 → 2.0.0-alpha.11

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.
Files changed (278) hide show
  1. package/README.md +346 -46
  2. package/dist/cache/index.d.ts +2 -1
  3. package/dist/cache/manager.d.ts +5 -0
  4. package/dist/cache/registry.d.ts +14 -0
  5. package/dist/cache/types.d.ts +17 -0
  6. package/dist/close.d.ts +1 -0
  7. package/dist/compatibility/index.d.ts +2 -2
  8. package/dist/compatibility/logicform.d.ts +1 -7
  9. package/dist/compiler/compile-cte.d.ts +17 -2
  10. package/dist/compiler/index.d.ts +2 -1
  11. package/dist/compiler/shorten-sql.d.ts +1 -1
  12. package/dist/errors.d.ts +3 -0
  13. package/dist/executor/compatibility.d.ts +13 -0
  14. package/dist/executor/components.d.ts +8 -3
  15. package/dist/executor/connection-registry.d.ts +1 -12
  16. package/dist/executor/execute-query.d.ts +8 -2
  17. package/dist/executor/execute.d.ts +1 -1
  18. package/dist/executor/federated-execution.d.ts +39 -0
  19. package/dist/executor/fetch-entities.d.ts +7 -1
  20. package/dist/executor/index.d.ts +1 -1
  21. package/dist/executor/partition.d.ts +17 -0
  22. package/dist/executor/result-hydrator/types.d.ts +2 -0
  23. package/dist/executor/row-identity.d.ts +2 -1
  24. package/dist/executor/total.d.ts +11 -0
  25. package/dist/executor/types.d.ts +70 -21
  26. package/dist/i18n/index.d.ts +4 -0
  27. package/dist/i18n/locales/en-US.d.ts +2 -0
  28. package/dist/i18n/locales/zh-CN.d.ts +2 -0
  29. package/dist/i18n/registry.d.ts +13 -0
  30. package/dist/i18n/types.d.ts +9 -0
  31. package/dist/index.d.ts +18 -16
  32. package/dist/logicform/dimensions.d.ts +16 -0
  33. package/dist/logicform/index.d.ts +2 -0
  34. package/dist/logicform-types.d.ts +56 -36
  35. package/dist/normalizer/core.d.ts +17 -3
  36. package/dist/normalizer/default-pred-name.d.ts +2 -0
  37. package/dist/normalizer/index.d.ts +1 -0
  38. package/dist/normalizer/pred-expression.d.ts +6 -0
  39. package/dist/normalizer/property-resolve.d.ts +6 -0
  40. package/dist/operators/builtins/constant.d.ts +2 -0
  41. package/dist/operators/builtins/period-name.d.ts +2 -1
  42. package/dist/operators/builtins/period-value.d.ts +2 -0
  43. package/dist/operators/builtins/query-expression.d.ts +3 -0
  44. package/dist/operators/builtins/scalar-extremum.d.ts +3 -0
  45. package/dist/operators/index.d.ts +2 -1
  46. package/dist/operators/registry.d.ts +5 -3
  47. package/dist/operators/resolve.d.ts +3 -0
  48. package/dist/operators/types.d.ts +110 -50
  49. package/dist/physical/clickhouse-provider.d.ts +29 -2
  50. package/dist/physical/connection-registry.d.ts +13 -0
  51. package/dist/physical/connection.d.ts +57 -15
  52. package/dist/physical/dameng-provider.d.ts +66 -0
  53. package/dist/physical/databricks-provider.d.ts +88 -0
  54. package/dist/physical/db-connector.d.ts +23 -0
  55. package/dist/physical/display-query.d.ts +3 -0
  56. package/dist/physical/doris-provider.d.ts +7 -1
  57. package/dist/physical/duckdb-coordinator-provider.d.ts +37 -0
  58. package/dist/physical/gbase-provider.d.ts +11 -0
  59. package/dist/physical/index.d.ts +24 -9
  60. package/dist/physical/load-driver.d.ts +1 -0
  61. package/dist/physical/maxcompute-provider.d.ts +44 -0
  62. package/dist/physical/mysql-protocol-provider.d.ts +27 -7
  63. package/dist/physical/mysql-provider.d.ts +2 -1
  64. package/dist/physical/oracle-provider.d.ts +21 -4
  65. package/dist/physical/postgresql-provider.d.ts +25 -4
  66. package/dist/physical/provider.d.ts +66 -2
  67. package/dist/physical/snowflake-provider.d.ts +20 -3
  68. package/dist/physical/sqlserver-provider.d.ts +69 -0
  69. package/dist/physical/starrocks-provider.d.ts +7 -1
  70. package/dist/physical/table-description.d.ts +5 -0
  71. package/dist/physical/table-discovery.d.ts +10 -0
  72. package/dist/planner/build-lineage.d.ts +1 -1
  73. package/dist/planner/build-mapping-source-plan.d.ts +6 -0
  74. package/dist/planner/create-logical-plan.d.ts +11 -0
  75. package/dist/planner/index.d.ts +4 -2
  76. package/dist/planner/mapping-granularity.d.ts +7 -0
  77. package/dist/planner/rewrite-nested-components.d.ts +8 -0
  78. package/dist/planner/select-schema-mapping.d.ts +19 -2
  79. package/dist/planner/semantics/index.d.ts +0 -3
  80. package/dist/planner/semantics/periods.d.ts +13 -0
  81. package/dist/planner/semantics/registry-defaults.d.ts +2 -1
  82. package/dist/planner/semantics/registry.d.ts +2 -1
  83. package/dist/planner/types.d.ts +106 -14
  84. package/dist/plugins/hierarchy/index.d.ts +1 -1
  85. package/dist/plugins/hierarchy/mapping-granularity.d.ts +4 -0
  86. package/dist/plugins/hierarchy/types.d.ts +20 -2
  87. package/dist/plugins/index.d.ts +10 -1
  88. package/dist/{planner/semantics → plugins}/observation/classification.d.ts +1 -1
  89. package/dist/plugins/observation/index.d.ts +17 -0
  90. package/dist/{planner/semantics → plugins}/observation/operator-policy.d.ts +4 -5
  91. package/dist/plugins/observation/periods.d.ts +18 -0
  92. package/dist/{planner/semantics → plugins}/observation/rule.d.ts +1 -1
  93. package/dist/plugins/observation/types.d.ts +3 -0
  94. package/dist/plugins/property-hierarchy/index.d.ts +11 -0
  95. package/dist/plugins/recursive/index.d.ts +26 -0
  96. package/dist/plugins/temporal/index.d.ts +13 -0
  97. package/dist/plugins/types.d.ts +165 -1
  98. package/dist/plugins/validity/classification.d.ts +5 -0
  99. package/dist/plugins/validity/index.d.ts +15 -0
  100. package/dist/plugins/validity/periods.d.ts +15 -0
  101. package/dist/plugins/validity/query-policy.d.ts +3 -0
  102. package/dist/plugins/validity/rule.d.ts +2 -0
  103. package/dist/plugins/validity/semantic-types.d.ts +3 -0
  104. package/dist/schema/dependent-projection.d.ts +8 -0
  105. package/dist/schema/entity-identity.d.ts +1 -1
  106. package/dist/schema/index.d.ts +1 -0
  107. package/dist/schema-mappings/freshness.d.ts +1 -1
  108. package/dist/schema-mappings/granularity.d.ts +5 -0
  109. package/dist/schema-mappings/index.d.ts +5 -1
  110. package/dist/schema-mappings/registry.d.ts +7 -3
  111. package/dist/schema-mappings/supported-dimensions.d.ts +10 -0
  112. package/dist/schema-mappings/types.d.ts +59 -9
  113. package/dist/schema-mappings/yiask.d.ts +27 -0
  114. package/dist/semantic-types/builtins/tag.d.ts +2 -0
  115. package/dist/semantic-types/index.d.ts +5 -3
  116. package/dist/semantic-types/registry.d.ts +2 -0
  117. package/dist/semantic-types/resolve-schema.d.ts +1 -1
  118. package/dist/semantic-types/types.d.ts +51 -11
  119. package/dist/semantic-types/validate-resolved-schema.d.ts +2 -5
  120. package/dist/semanticdb.esm.js +5 -0
  121. package/dist/semanticdb.js +5 -0
  122. package/package.json +49 -17
  123. package/dist/cache/expiry.js +0 -1
  124. package/dist/cache/identity.js +0 -1
  125. package/dist/cache/redis-query-cache.js +0 -1
  126. package/dist/cache/serialization.js +0 -1
  127. package/dist/calendar/constants.d.ts +0 -7
  128. package/dist/calendar/constants.js +0 -1
  129. package/dist/calendar/index.d.ts +0 -6
  130. package/dist/calendar/provider-relation-store.d.ts +0 -9
  131. package/dist/calendar/provider-relation-store.js +0 -1
  132. package/dist/calendar/resolver.d.ts +0 -10
  133. package/dist/calendar/resolver.js +0 -1
  134. package/dist/calendar/system-schemas.d.ts +0 -3
  135. package/dist/calendar/system-schemas.js +0 -1
  136. package/dist/calendar/types.d.ts +0 -31
  137. package/dist/compatibility/logicform.js +0 -1
  138. package/dist/compiler/compile-cte.js +0 -1
  139. package/dist/compiler/compile-plan.js +0 -1
  140. package/dist/compiler/shorten-sql.js +0 -2
  141. package/dist/custom-functions/custom-functions.d.ts +0 -6
  142. package/dist/custom-functions/custom-functions.js +0 -1
  143. package/dist/custom-functions/index.d.ts +0 -3
  144. package/dist/custom-functions/operator-adapter.d.ts +0 -12
  145. package/dist/custom-functions/operator-adapter.js +0 -1
  146. package/dist/custom-functions/types.d.ts +0 -62
  147. package/dist/errors.js +0 -1
  148. package/dist/executor/compatibility.js +0 -1
  149. package/dist/executor/components.js +0 -1
  150. package/dist/executor/connection-registry.js +0 -1
  151. package/dist/executor/evaluate.js +0 -1
  152. package/dist/executor/execute-query.js +0 -1
  153. package/dist/executor/execute.js +0 -1
  154. package/dist/executor/fetch-entities.js +0 -1
  155. package/dist/executor/result-hydrator/entity-loader.js +0 -1
  156. package/dist/executor/result-hydrator/format-values.js +0 -1
  157. package/dist/executor/result-hydrator/hydrate-result.js +0 -1
  158. package/dist/executor/result-hydrator/missing-entity.js +0 -1
  159. package/dist/executor/result-hydrator/populate-entities.js +0 -1
  160. package/dist/executor/row-identity.js +0 -1
  161. package/dist/index.js +0 -1
  162. package/dist/logicform-types.js +0 -1
  163. package/dist/normalizer/core.js +0 -1
  164. package/dist/normalizer/default-pred-name.js +0 -1
  165. package/dist/normalizer/entity-id.js +0 -1
  166. package/dist/normalizer/groupby.js +0 -1
  167. package/dist/normalizer/normalize-logicform.js +0 -1
  168. package/dist/normalizer/pagination.js +0 -1
  169. package/dist/normalizer/pred-query-name.js +0 -1
  170. package/dist/normalizer/preds.js +0 -1
  171. package/dist/normalizer/query.js +0 -1
  172. package/dist/normalizer/version.js +0 -1
  173. package/dist/operators/builtins/abs.js +0 -1
  174. package/dist/operators/builtins/accumulate.js +0 -1
  175. package/dist/operators/builtins/add.js +0 -1
  176. package/dist/operators/builtins/arithmetic.js +0 -1
  177. package/dist/operators/builtins/average-per-period.js +0 -1
  178. package/dist/operators/builtins/avg.js +0 -1
  179. package/dist/operators/builtins/case.js +0 -1
  180. package/dist/operators/builtins/concat.js +0 -1
  181. package/dist/operators/builtins/count-distinct.js +0 -1
  182. package/dist/operators/builtins/count.js +0 -1
  183. package/dist/operators/builtins/date-bucket.js +0 -1
  184. package/dist/operators/builtins/divide.js +0 -1
  185. package/dist/operators/builtins/index.js +0 -1
  186. package/dist/operators/builtins/max.js +0 -1
  187. package/dist/operators/builtins/min.js +0 -1
  188. package/dist/operators/builtins/multiply.js +0 -1
  189. package/dist/operators/builtins/newly.js +0 -1
  190. package/dist/operators/builtins/period-boundary.js +0 -1
  191. package/dist/operators/builtins/period-difference.js +0 -1
  192. package/dist/operators/builtins/period-growth.js +0 -1
  193. package/dist/operators/builtins/period-name.js +0 -1
  194. package/dist/operators/builtins/period-shift.js +0 -1
  195. package/dist/operators/builtins/rank.js +0 -1
  196. package/dist/operators/builtins/row-number.js +0 -1
  197. package/dist/operators/builtins/share-of-total.js +0 -1
  198. package/dist/operators/builtins/sql.js +0 -1
  199. package/dist/operators/builtins/substring.js +0 -1
  200. package/dist/operators/builtins/subtract.js +0 -1
  201. package/dist/operators/builtins/sum.js +0 -1
  202. package/dist/operators/builtins/time-range.js +0 -1
  203. package/dist/operators/groupby.js +0 -1
  204. package/dist/operators/index.js +0 -1
  205. package/dist/operators/registry.js +0 -1
  206. package/dist/operators/sql-expression.js +0 -1
  207. package/dist/permissions/permissions.js +0 -1
  208. package/dist/physical/clickhouse-provider.js +0 -1
  209. package/dist/physical/connection.js +0 -1
  210. package/dist/physical/display-query.js +0 -1
  211. package/dist/physical/doris-provider.js +0 -1
  212. package/dist/physical/mysql-compatible-sql.js +0 -1
  213. package/dist/physical/mysql-protocol-provider.js +0 -1
  214. package/dist/physical/mysql-provider.js +0 -1
  215. package/dist/physical/oracle-provider.js +0 -1
  216. package/dist/physical/postgresql-provider.js +0 -1
  217. package/dist/physical/snowflake-provider.js +0 -1
  218. package/dist/physical/starrocks-provider.js +0 -1
  219. package/dist/planner/build-lineage.js +0 -1
  220. package/dist/planner/create-logical-plan.js +0 -1
  221. package/dist/planner/select-schema-mapping.js +0 -1
  222. package/dist/planner/semantics/lifecycle/classification.d.ts +0 -7
  223. package/dist/planner/semantics/lifecycle/classification.js +0 -1
  224. package/dist/planner/semantics/lifecycle/index.d.ts +0 -3
  225. package/dist/planner/semantics/lifecycle/query-policy.d.ts +0 -3
  226. package/dist/planner/semantics/lifecycle/query-policy.js +0 -1
  227. package/dist/planner/semantics/lifecycle/rule.d.ts +0 -2
  228. package/dist/planner/semantics/lifecycle/rule.js +0 -1
  229. package/dist/planner/semantics/observation/classification.js +0 -1
  230. package/dist/planner/semantics/observation/index.d.ts +0 -4
  231. package/dist/planner/semantics/observation/operator-policy.js +0 -1
  232. package/dist/planner/semantics/observation/rule.js +0 -1
  233. package/dist/planner/semantics/observation/types.d.ts +0 -3
  234. package/dist/planner/semantics/registry-defaults.js +0 -1
  235. package/dist/planner/semantics/registry.js +0 -1
  236. package/dist/planner/types.js +0 -1
  237. package/dist/plugins/hierarchy/compatibility.js +0 -1
  238. package/dist/plugins/hierarchy/entity-identity.js +0 -1
  239. package/dist/plugins/hierarchy/index.js +0 -1
  240. package/dist/plugins/hierarchy/operator.js +0 -1
  241. package/dist/plugins/hierarchy/resolve-schema.js +0 -1
  242. package/dist/plugins/index.js +0 -1
  243. package/dist/schema/entity-identity.js +0 -1
  244. package/dist/schema/resolve-property-path.js +0 -1
  245. package/dist/schema/schema-registry.js +0 -1
  246. package/dist/schema-mappings/freshness.js +0 -1
  247. package/dist/schema-mappings/registry.js +0 -1
  248. package/dist/semantic-types/builtins/boolean.js +0 -1
  249. package/dist/semantic-types/builtins/category.js +0 -1
  250. package/dist/semantic-types/builtins/currency.js +0 -1
  251. package/dist/semantic-types/builtins/date.js +0 -1
  252. package/dist/semantic-types/builtins/duration.js +0 -1
  253. package/dist/semantic-types/builtins/end-date.d.ts +0 -2
  254. package/dist/semantic-types/builtins/end-date.js +0 -1
  255. package/dist/semantic-types/builtins/entity.js +0 -1
  256. package/dist/semantic-types/builtins/file.js +0 -1
  257. package/dist/semantic-types/builtins/human-name.js +0 -1
  258. package/dist/semantic-types/builtins/id.js +0 -1
  259. package/dist/semantic-types/builtins/image.js +0 -1
  260. package/dist/semantic-types/builtins/index.js +0 -1
  261. package/dist/semantic-types/builtins/int.js +0 -1
  262. package/dist/semantic-types/builtins/name.js +0 -1
  263. package/dist/semantic-types/builtins/number.js +0 -1
  264. package/dist/semantic-types/builtins/object.js +0 -1
  265. package/dist/semantic-types/builtins/order.js +0 -1
  266. package/dist/semantic-types/builtins/percentage.js +0 -1
  267. package/dist/semantic-types/builtins/start-date.d.ts +0 -2
  268. package/dist/semantic-types/builtins/start-date.js +0 -1
  269. package/dist/semantic-types/builtins/string.js +0 -1
  270. package/dist/semantic-types/builtins/timestamp.js +0 -1
  271. package/dist/semantic-types/index.js +0 -1
  272. package/dist/semantic-types/primal-types/date.js +0 -1
  273. package/dist/semantic-types/primal-types/index.js +0 -1
  274. package/dist/semantic-types/registry.js +0 -1
  275. package/dist/semantic-types/resolve-schema.js +0 -1
  276. package/dist/semantic-types/validate-resolved-schema.js +0 -1
  277. package/dist/utils/clone.js +0 -1
  278. /package/dist/operators/builtins/{period-boundary.d.ts → period-boundary-expression.d.ts} +0 -0
@@ -1,11 +1,12 @@
1
- import type { PoolAttributes } from 'oracledb';
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: PoolAttributes): Promise<OraclePoolLike>;
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?: PoolAttributes;
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,10 +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;
54
+ stringify(expression: string): string;
42
55
  concat(expressions: readonly string[]): string;
43
56
  substring(expression: string, start: number, length: number): string;
57
+ stringLength(expression: string): string;
44
58
  regex(expression: string, pattern: string, options?: string): string;
45
59
  arrayContains(arrayExpression: string, valueExpression: string): string;
46
60
  expandArray(arrayExpression: string, alias: string, column: string): {
@@ -48,6 +62,9 @@ export declare class OracleProvider implements CoreComputeProvider {
48
62
  valueExpression: string;
49
63
  };
50
64
  execute(request: ProviderExecutionRequest): Promise<DataRow[]>;
65
+ runSQL(request: ProviderExecutionRequest): Promise<SQLResult>;
66
+ getTableList(request: TableListRequest): Promise<DatabaseTable[]>;
67
+ describeTable(request: DescribeTableRequest): Promise<TableDescription>;
51
68
  close(): Promise<void>;
52
69
  }
53
70
  export {};
@@ -1,20 +1,34 @@
1
- import type { PoolConfig } from 'pg';
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?: PoolConfig;
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,16 +36,23 @@ 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;
42
+ stringify(expression: string): string;
27
43
  concat(expressions: readonly string[]): string;
28
44
  substring(expression: string, start: number, length: number): string;
45
+ stringLength(expression: string): string;
29
46
  regex(expression: string, pattern: string, options?: string): string;
30
47
  arrayContains(arrayExpression: string, valueExpression: string): string;
48
+ normalizeStringArray(expression: string): string;
31
49
  expandArray(arrayExpression: string, alias: string, column: string): {
32
50
  joinSql: string;
33
51
  valueExpression: string;
34
52
  };
35
53
  execute(request: ProviderExecutionRequest): Promise<DataRow[]>;
54
+ getTableList(request: TableListRequest): Promise<DatabaseTable[]>;
55
+ describeTable(request: DescribeTableRequest): Promise<TableDescription>;
56
+ runSQL(request: ProviderExecutionRequest): Promise<SQLResult>;
36
57
  close(): Promise<void>;
37
58
  }
@@ -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,15 +57,29 @@ 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;
63
+ datePeriodBoundary?(expression: string, granularity: string, boundary: 'start' | 'end'): string;
64
+ /** Cast a bound literal to the semantic type required by the SQL expression. */
65
+ castValue?(expression: string, type: string): string;
66
+ /** Render a NULL-ignoring scalar extremum without a correlated subquery. */
67
+ scalarExtremum?(operator: 'least' | 'greatest', expressions: readonly string[]): string;
16
68
  aggregateFunction(name: string, expression?: string): string;
69
+ stringify(expression: string): string;
17
70
  concat(expressions: readonly string[]): string;
18
71
  substring(expression: string, start: number, length: number): string;
72
+ /** Return the number of characters in a string expression. */
73
+ stringLength(expression: string): string;
19
74
  regex(expression: string, pattern: string, options?: string): string;
20
75
  /** Whether the dialect supports a WITH RECURSIVE subquery. */
21
76
  readonly supportsRecursiveCte?: boolean;
77
+ /** Recursive-term set operator. Defaults to UNION when omitted. */
78
+ readonly recursiveCteUnion?: 'UNION' | 'UNION ALL';
22
79
  arrayContains?(arrayExpression: string, valueExpression: string): string;
23
- expandArray?(arrayExpression: string, alias: string, column: string): {
80
+ /** Coerce a native text array, JSON array, or scalar text value to a text array. */
81
+ normalizeStringArray?(expression: string): string;
82
+ expandArray?(arrayExpression: string, alias: string, column: string, elementType?: 'string'): {
24
83
  readonly joinSql: string;
25
84
  readonly valueExpression: string;
26
85
  };
@@ -29,12 +88,17 @@ export interface SqlRenderCapabilities {
29
88
  * Internal physical database contract used by the compiler and executor.
30
89
  */
31
90
  export interface CoreComputeProvider extends SqlRenderCapabilities {
32
- readonly kind: 'clickhouse' | 'doris' | 'mysql' | 'oracle' | 'postgresql' | 'snowflake' | 'starrocks';
91
+ readonly kind: ProviderKind;
33
92
  /** Maximum items accepted by one SQL IN expression, when the dialect has a limit. */
34
93
  readonly maxInListItems?: number;
35
94
  parameter(index: number, value: unknown): string;
36
95
  /** Render bound parameters for diagnostics only; this SQL is never executed by SemanticDB. */
37
96
  displayQuery(sql: string, parameters: SqlParameters): string;
38
97
  execute(request: ProviderExecutionRequest): Promise<DataRow[]>;
98
+ /** Optional native-SQL capability; execute retains its row-query contract. */
99
+ runSQL?(request: ProviderExecutionRequest): Promise<SQLResult>;
100
+ /** Optional physical metadata capability, independent of semantic Schemas. */
101
+ getTableList?(request: TableListRequest): Promise<DatabaseTable[]>;
102
+ describeTable?(request: DescribeTableRequest): Promise<TableDescription>;
39
103
  close(): Promise<void>;
40
104
  }
@@ -1,8 +1,8 @@
1
- import type { ConnectionOptions } from 'snowflake-sdk';
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?: ConnectionOptions;
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,10 +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;
46
+ stringify(expression: string): string;
34
47
  concat(expressions: readonly string[]): string;
35
48
  substring(expression: string, start: number, length: number): string;
49
+ stringLength(expression: string): string;
36
50
  regex(expression: string, pattern: string, options?: string): string;
37
51
  arrayContains(arrayExpression: string, valueExpression: string): string;
38
52
  expandArray(arrayExpression: string, alias: string, column: string): {
@@ -40,6 +54,9 @@ export declare class SnowflakeProvider implements CoreComputeProvider {
40
54
  valueExpression: string;
41
55
  };
42
56
  execute(request: ProviderExecutionRequest): Promise<DataRow[]>;
57
+ runSQL(request: ProviderExecutionRequest): Promise<SQLResult>;
58
+ getTableList(request: TableListRequest): Promise<DatabaseTable[]>;
59
+ describeTable(request: DescribeTableRequest): Promise<TableDescription>;
43
60
  close(): Promise<void>;
44
61
  }
45
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,9 +1,15 @@
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 {
7
8
  readonly kind: "starrocks";
8
9
  constructor(options?: StarRocksProviderOptions);
10
+ arrayContains(arrayExpression: string, valueExpression: string): string;
11
+ expandArray(arrayExpression: string, alias: string, column: string): {
12
+ readonly joinSql: string;
13
+ readonly valueExpression: string;
14
+ };
9
15
  }
@@ -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;
@@ -0,0 +1,6 @@
1
+ import type { SemanticDBPlugin } from '../plugins/index';
2
+ import type { SchemaMappingDefinition } from '../schema-mappings/index';
3
+ import type { ResolvedSemanticSchema } from '../semantic-types/index';
4
+ import type { LogicalPlan } from './types';
5
+ /** Materialize physical Mapping outputs before evaluating Schema UDFs. */
6
+ export declare const buildMappingSourcePlan: (schema: ResolvedSemanticSchema, mapping: SchemaMappingDefinition, plugins?: readonly SemanticDBPlugin[]) => LogicalPlan;
@@ -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,17 @@ 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
+ /** Normalized nested LogicForms whose asynchronous partition plans were prepared by the executor. */
14
+ readonly preplannedPartitions?: ReadonlyMap<string, LogicalPlan>;
15
+ /** Restrict the root physical Schema to one candidate during partition planning. */
16
+ readonly mappingCandidates?: readonly string[];
17
+ readonly plugins?: readonly SemanticDBPlugin[];
11
18
  readonly resolveSchema?: (schemaId: string) => ResolvedSemanticSchema;
19
+ /** Prefer physical mappings colocated with the execution's main connection. */
20
+ readonly preferredConnectionId?: string;
12
21
  readonly canUsePropertyRowIdentity?: (schema: ResolvedSemanticSchema, property: ResolvedSemanticProperty) => boolean;
13
22
  readonly semanticRegistry?: PlannerSemanticRegistry;
23
+ /** Observe each physical Schema mapping decision made during planning. */
24
+ readonly onSchemaMappingSelection?: (selection: SchemaMappingSelection) => void;
14
25
  }
15
26
  export declare const createLogicalPlan: (logicform: LogicformType, schema: ResolvedSemanticSchema, operators?: OperatorRegistry, schemaMappings?: SchemaMappingRegistry, options?: CreateLogicalPlanOptions) => LogicalPlan;
@@ -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, LogicalRecursiveQuery, LogicalOrdinalQuery, LineageColumnSource, LineageOutput, LogicalPlan, OrderPlan, PaginationPlan, ProjectionPlan, QueryLineage, RowIdentityPlan, } from './types';
5
- export { isLogicalQuerySubquery, isLogicalRecursiveQuery } from './types';
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;
@@ -1,6 +1,8 @@
1
1
  import type { LogicformType } from '../logicform-types';
2
- import type { SchemaMappingDefinition, SchemaMappingRegistry } from '../schema-mappings/index';
2
+ import type { SemanticDBPlugin } from '../plugins/index';
3
+ import type { SchemaMappingDefinition, SchemaMappingRegistry, SchemaMappingSelection } from '../schema-mappings/index';
3
4
  import type { ResolvedSemanticSchema } from '../semantic-types/index';
5
+ import { type OperatorRegistry } from '../operators/index';
4
6
  export interface PredMappingRewrite {
5
7
  readonly predIndex: number;
6
8
  readonly column: string;
@@ -9,6 +11,21 @@ export interface SelectedSchemaMapping {
9
11
  readonly mapping: SchemaMappingDefinition;
10
12
  readonly logicform: LogicformType;
11
13
  readonly predRewrites: readonly PredMappingRewrite[];
14
+ readonly selection: SchemaMappingSelection;
12
15
  }
16
+ export interface MappedPropertySource {
17
+ readonly column: string;
18
+ readonly sourceRef?: string;
19
+ readonly sql?: string;
20
+ }
21
+ export declare const hasPropertySql: (mapping: SchemaMappingDefinition) => boolean;
13
22
  export declare const mappedPropertyColumn: (mapping: SchemaMappingDefinition, schema: ResolvedSemanticSchema, reference: string) => string | undefined;
14
- export declare const selectSchemaMapping: (logicform: LogicformType, schema: ResolvedSemanticSchema, mappings: SchemaMappingRegistry) => SelectedSchemaMapping;
23
+ export declare const mappedPropertySource: (mapping: SchemaMappingDefinition, schema: ResolvedSemanticSchema, reference: string) => MappedPropertySource | undefined;
24
+ export declare const selectSchemaMapping: (logicform: LogicformType, schema: ResolvedSemanticSchema, mappings: SchemaMappingRegistry, options?: {
25
+ readonly mappingCandidates?: readonly string[];
26
+ readonly preferredConnectionId?: string;
27
+ readonly resolveSchema?: (schemaId: string) => ResolvedSemanticSchema;
28
+ /** Extra plugins used by this execution; must also be supplied when registering plugin grains. */
29
+ readonly plugins?: readonly SemanticDBPlugin[];
30
+ readonly operators?: OperatorRegistry;
31
+ }) => SelectedSchemaMapping;
@@ -1,5 +1,2 @@
1
- export * from './observation/index';
2
- export * from './lifecycle/index';
3
1
  export { PlannerSemanticRegistry } from './registry';
4
2
  export type { PlannerSemanticResolution, PlannerSemanticQueryContext, PlannerSemanticRule, PlannerSemanticRuleContext, } from './registry';
5
- export { createPlannerSemanticRegistry } from './registry-defaults';
@@ -0,0 +1,13 @@
1
+ import type { TimeGranularity } from '../../semantic-types/index';
2
+ export interface Period {
3
+ readonly label: string;
4
+ readonly start: string;
5
+ readonly end: string;
6
+ }
7
+ export interface PeriodErrorContext {
8
+ readonly codePrefix: string;
9
+ readonly label: string;
10
+ }
11
+ export declare const isTimeGranularity: (value: unknown) => value is TimeGranularity;
12
+ /** Expand one bounded time condition into natural boundaries at the requested granularity. */
13
+ export declare const resolvePeriods: (condition: unknown, granularity: TimeGranularity, context: PeriodErrorContext) => readonly Period[];
@@ -1,2 +1,3 @@
1
1
  import { PlannerSemanticRegistry } from './registry';
2
- export declare const createPlannerSemanticRegistry: () => PlannerSemanticRegistry;
2
+ import type { SemanticDBPlugin } from '../../plugins/index';
3
+ export declare const createPlannerSemanticRegistry: (plugins?: readonly SemanticDBPlugin[]) => PlannerSemanticRegistry;
@@ -1,13 +1,14 @@
1
1
  import type { PredItemType } from '../../logicform-types';
2
2
  import type { LogicformType, QueryType } from '../../logicform-types';
3
3
  import type { ResolvedSemanticProperty, ResolvedSemanticSchema } from '../../semantic-types/index';
4
- import type { OperatorDefinition, ResultProperty } from '../../operators/index';
4
+ import type { OperatorDefinition, OperatorExecutionContext, ResultProperty } from '../../operators/index';
5
5
  export interface PlannerSemanticRuleContext {
6
6
  readonly pred: PredItemType;
7
7
  readonly schema: ResolvedSemanticSchema;
8
8
  readonly sourceProperty?: ResolvedSemanticProperty;
9
9
  readonly outputProperty: ResultProperty;
10
10
  readonly operator?: OperatorDefinition;
11
+ readonly executionContext?: OperatorExecutionContext;
11
12
  }
12
13
  export interface PlannerSemanticQueryContext {
13
14
  readonly logicform: LogicformType;