data-finder-ts 0.1.4 → 0.1.5

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 (58) hide show
  1. package/dist/{chunk-4JVW4TAB.js → chunk-BGEX377Q.js} +58 -8
  2. package/dist/chunk-BGEX377Q.js.map +1 -0
  3. package/dist/chunk-BKPWV3OF.js +962 -0
  4. package/dist/chunk-BKPWV3OF.js.map +1 -0
  5. package/dist/{chunk-PMPLCEWQ.js → chunk-GPHWC533.js} +2 -2
  6. package/dist/{chunk-FJYA2ASS.js → chunk-KAK75RVS.js} +74 -12
  7. package/dist/chunk-KAK75RVS.js.map +1 -0
  8. package/dist/{chunk-4LNZV6EN.js → chunk-MGEL5RWM.js} +206 -78
  9. package/dist/chunk-MGEL5RWM.js.map +1 -0
  10. package/dist/chunk-PF6EJZHB.js +1015 -0
  11. package/dist/chunk-PF6EJZHB.js.map +1 -0
  12. package/dist/datafinder/attribute.cjs +537 -11
  13. package/dist/datafinder/attribute.cjs.map +1 -1
  14. package/dist/datafinder/attribute.d.cts +29 -7
  15. package/dist/datafinder/attribute.d.ts +29 -7
  16. package/dist/datafinder/attribute.js +2 -2
  17. package/dist/datafinder/runner.cjs +1267 -215
  18. package/dist/datafinder/runner.cjs.map +1 -1
  19. package/dist/datafinder/runner.d.cts +28 -5
  20. package/dist/datafinder/runner.d.ts +28 -5
  21. package/dist/datafinder/runner.js +6 -6
  22. package/dist/datafinder/sql-generator.cjs +1203 -206
  23. package/dist/datafinder/sql-generator.cjs.map +1 -1
  24. package/dist/datafinder/sql-generator.d.cts +19 -5
  25. package/dist/datafinder/sql-generator.d.ts +19 -5
  26. package/dist/datafinder/sql-generator.js +9 -5
  27. package/dist/datafinder/typed-attributes.cjs +693 -88
  28. package/dist/datafinder/typed-attributes.cjs.map +1 -1
  29. package/dist/datafinder/typed-attributes.d.cts +3 -242
  30. package/dist/datafinder/typed-attributes.d.ts +3 -242
  31. package/dist/datafinder/typed-attributes.js +3 -3
  32. package/dist/dialect-CogGPm_y.d.cts +38 -0
  33. package/dist/dialect-aaG1bDi5.d.ts +38 -0
  34. package/dist/index.cjs +1677 -408
  35. package/dist/index.cjs.map +1 -1
  36. package/dist/index.d.cts +109 -5
  37. package/dist/index.d.ts +109 -5
  38. package/dist/index.js +321 -11
  39. package/dist/index.js.map +1 -1
  40. package/dist/model/milestoning.cjs +529 -0
  41. package/dist/model/milestoning.cjs.map +1 -1
  42. package/dist/model/milestoning.js +2 -2
  43. package/dist/model/relational.cjs +547 -16
  44. package/dist/model/relational.cjs.map +1 -1
  45. package/dist/model/relational.d.cts +421 -57
  46. package/dist/model/relational.d.ts +421 -57
  47. package/dist/model/relational.js +53 -3
  48. package/dist/typed-attributes-CUTf_6Ru.d.ts +328 -0
  49. package/dist/typed-attributes-CdWXq_78.d.cts +328 -0
  50. package/package.json +3 -2
  51. package/dist/chunk-4JVW4TAB.js.map +0 -1
  52. package/dist/chunk-4LNZV6EN.js.map +0 -1
  53. package/dist/chunk-FJYA2ASS.js.map +0 -1
  54. package/dist/chunk-MH4XMYVB.js +0 -696
  55. package/dist/chunk-MH4XMYVB.js.map +0 -1
  56. package/dist/chunk-UYMOE6YU.js +0 -509
  57. package/dist/chunk-UYMOE6YU.js.map +0 -1
  58. /package/dist/{chunk-PMPLCEWQ.js.map → chunk-GPHWC533.js.map} +0 -0
@@ -0,0 +1,328 @@
1
+ import { Attribute, AttributeValue } from './datafinder/attribute.cjs';
2
+ import { RelationalOperationElement, ScalarFunctionOperation, ConcatPart, ConcatOperation, JoinTreeNodeOperation, ConstantOperation, ComparisonOperation, DateExtractOperation, DateTruncOperation, DateArithmeticOperation, DateDiffOperation, ColumnWithJoin, AggregateOperation, Arithmetic, SortOperation } from './model/relational.cjs';
3
+
4
+ /**
5
+ * Scalar functions as methods, shared by attributes and by the results of other functions, so they chain:
6
+ * `f.name().toUpperCase().length()`.
7
+ *
8
+ * TypeScript has no multiple inheritance, so each group of functions is a class whose methods are mixed into
9
+ * every host with `applyMixins` (the handbook's pattern), the type side being an `interface Host extends Group {}`
10
+ * beside the host. A host provides `functionInput()` and `functionLabel()`: an attribute reads its column and is
11
+ * labelled by its display name; a function result is itself the input and is labelled by its own name.
12
+ */
13
+
14
+ /** Functions of text. */
15
+ declare abstract class StringFunctions {
16
+ /** @internal The expression the function applies to. */
17
+ abstract functionInput(): RelationalOperationElement;
18
+ /** @internal What a function of this is labelled after. */
19
+ abstract functionLabel(): string;
20
+ /** Join text on the end: `f.first().concat(' ', f.last())`. A NULL part makes the whole NULL. */
21
+ concat(...more: ConcatPart[]): ConcatOperation;
22
+ /** Convert every character to uppercase. */
23
+ toUpperCase(): StringFunctionOperation;
24
+ /** Convert every character to lowercase. */
25
+ toLowerCase(): StringFunctionOperation;
26
+ /** Remove leading and trailing whitespace. */
27
+ trim(): StringFunctionOperation;
28
+ /** Remove leading whitespace. */
29
+ trimStart(): StringFunctionOperation;
30
+ /** Remove trailing whitespace. */
31
+ trimEnd(): StringFunctionOperation;
32
+ /** Return the number of characters in the string. */
33
+ length(): NumericFunctionOperation;
34
+ /** Return the string with characters in reverse order. */
35
+ reverse(): StringFunctionOperation;
36
+ /** Return the first `n` characters. */
37
+ left(n: number): StringFunctionOperation;
38
+ /** Return the last `n` characters. */
39
+ right(n: number): StringFunctionOperation;
40
+ /** Return the string repeated `n` times. */
41
+ repeat(n: number): StringFunctionOperation;
42
+ /** Replace all occurrences of `fromStr` with `toStr`. */
43
+ replace(fromStr: string, toStr: string): StringFunctionOperation;
44
+ /**
45
+ * Extract a portion of the string.
46
+ * `start` is zero-based (following Python convention); `length` is optional.
47
+ */
48
+ substring(start: number, length?: number): StringFunctionOperation;
49
+ }
50
+ /** Functions of a number. */
51
+ declare abstract class NumericFunctions {
52
+ /** @internal The expression the function applies to. */
53
+ abstract functionInput(): RelationalOperationElement;
54
+ /** @internal What a function of this is labelled after. */
55
+ abstract functionLabel(): string;
56
+ /** Absolute value (distance from zero, always non-negative). */
57
+ abs(): NumericFunctionOperation;
58
+ /** Round up to the nearest integer. */
59
+ ceil(): NumericFunctionOperation;
60
+ /** Round down to the nearest integer. */
61
+ floor(): NumericFunctionOperation;
62
+ /** Square root. */
63
+ sqrt(): NumericFunctionOperation;
64
+ /** Remainder after dividing by `n`. */
65
+ mod(n: number): NumericFunctionOperation;
66
+ /** Raise to the power of `n`. */
67
+ power(n: number): NumericFunctionOperation;
68
+ /** Round to `d` decimal places, or to the nearest integer when `d` is omitted. */
69
+ round(d?: number): NumericFunctionOperation;
70
+ }
71
+ /** A function result that gives text, which has the string functions too: `f.name().toUpperCase().length()`. */
72
+ declare class StringFunctionOperation extends ScalarFunctionOperation {
73
+ functionInput(): RelationalOperationElement;
74
+ functionLabel(): string;
75
+ }
76
+ interface StringFunctionOperation extends StringFunctions {
77
+ }
78
+ /** A function result that gives a number, which has the numeric functions too. */
79
+ declare class NumericFunctionOperation extends ScalarFunctionOperation {
80
+ functionInput(): RelationalOperationElement;
81
+ functionLabel(): string;
82
+ }
83
+ interface NumericFunctionOperation extends NumericFunctions {
84
+ }
85
+
86
+ /** The smallest and largest value of a group, for a column that can be ordered but not summed. */
87
+ declare abstract class MinMax {
88
+ abstract cwj(): ColumnWithJoin;
89
+ abstract displayName(): string;
90
+ /** Smallest value in the group. */
91
+ min(): AggregateOperation;
92
+ /** Largest value in the group. */
93
+ max(): AggregateOperation;
94
+ }
95
+ declare class StringAttribute extends Attribute {
96
+ constructor(displayName: string, columnName: string, columnDbType: string, owner: string, parent?: JoinTreeNodeOperation, embedded?: Attribute, nullable?: boolean, optional?: boolean);
97
+ protected toConstant(value: AttributeValue): ConstantOperation;
98
+ /**
99
+ * Join the values of a group into one text with `separator` between them. `orderBy` is the order they are
100
+ * joined in (`[f.name().ascending()]`); without it the order is not defined. Missing values are skipped.
101
+ */
102
+ join(separator?: string, orderBy?: SortOperation[]): AggregateOperation;
103
+ /** Filter to rows where this attribute equals `value`. */
104
+ eq(value: string): ComparisonOperation;
105
+ /** Filter to rows where this attribute does not equal `value`. */
106
+ ne(value: string): ComparisonOperation;
107
+ /** Filter to rows where this attribute contains `value` as a substring. */
108
+ contains(value: string): ComparisonOperation;
109
+ /** Filter to rows where this attribute begins with `prefix`. */
110
+ startsWith(prefix: string): ComparisonOperation;
111
+ /** Filter to rows where this attribute ends with `suffix`. */
112
+ endsWith(suffix: string): ComparisonOperation;
113
+ /** Filter to rows where this attribute does not contain `value` as a substring. */
114
+ notContains(value: string): ComparisonOperation;
115
+ }
116
+ interface StringAttribute extends MinMax, StringFunctions {
117
+ }
118
+ declare abstract class NumericAttribute extends Attribute {
119
+ constructor(displayName: string, columnName: string, columnDbType: string, owner: string, parent?: JoinTreeNodeOperation, embedded?: Attribute, nullable?: boolean, optional?: boolean);
120
+ /** Sum of all values in the group. */
121
+ sum(): AggregateOperation;
122
+ /** Arithmetic mean of all values in the group. */
123
+ average(): AggregateOperation;
124
+ /** Standard deviation of the values in the group: the sample one by default, `ddof = 0` for the population one, as `Series.std`. */
125
+ std(ddof?: number): AggregateOperation;
126
+ /** Variance of the values in the group: the sample one by default, `ddof = 0` for the population one, as `Series.var`. */
127
+ var(ddof?: number): AggregateOperation;
128
+ }
129
+ interface NumericAttribute extends MinMax, NumericFunctions, Arithmetic {
130
+ }
131
+ declare class DoubleAttribute extends NumericAttribute {
132
+ constructor(displayName: string, columnName: string, columnDbType: string, owner: string, parent?: JoinTreeNodeOperation, embedded?: Attribute, nullable?: boolean, optional?: boolean);
133
+ protected toConstant(value: AttributeValue): ConstantOperation;
134
+ /** Filter to rows where this attribute equals `value`. */
135
+ eq(value: number): ComparisonOperation;
136
+ /** Filter to rows where this attribute does not equal `value`. */
137
+ ne(value: number): ComparisonOperation;
138
+ /** Filter to rows where this attribute is greater than `value`. */
139
+ gt(value: number): ComparisonOperation;
140
+ /** Filter to rows where this attribute is less than `value`. */
141
+ lt(value: number): ComparisonOperation;
142
+ /** Filter to rows where this attribute is greater than or equal to `value`. */
143
+ gte(value: number): ComparisonOperation;
144
+ /** Filter to rows where this attribute is less than or equal to `value`. */
145
+ lte(value: number): ComparisonOperation;
146
+ }
147
+ declare const FloatAttribute: typeof DoubleAttribute;
148
+ type FloatAttribute = DoubleAttribute;
149
+ declare class DecimalAttribute extends NumericAttribute {
150
+ constructor(displayName: string, columnName: string, columnDbType: string, owner: string, parent?: JoinTreeNodeOperation, embedded?: Attribute, nullable?: boolean, optional?: boolean);
151
+ protected toConstant(value: AttributeValue): ConstantOperation;
152
+ /** Filter to rows where this attribute equals `value`. */
153
+ eq(value: number): ComparisonOperation;
154
+ /** Filter to rows where this attribute does not equal `value`. */
155
+ ne(value: number): ComparisonOperation;
156
+ /** Filter to rows where this attribute is greater than `value`. */
157
+ gt(value: number): ComparisonOperation;
158
+ /** Filter to rows where this attribute is less than `value`. */
159
+ lt(value: number): ComparisonOperation;
160
+ /** Filter to rows where this attribute is greater than or equal to `value`. */
161
+ gte(value: number): ComparisonOperation;
162
+ /** Filter to rows where this attribute is less than or equal to `value`. */
163
+ lte(value: number): ComparisonOperation;
164
+ }
165
+ declare class IntegerAttribute extends NumericAttribute {
166
+ constructor(displayName: string, columnName: string, columnDbType: string, owner: string, parent?: JoinTreeNodeOperation, embedded?: Attribute, nullable?: boolean, optional?: boolean);
167
+ protected toConstant(value: AttributeValue): ConstantOperation;
168
+ /** Filter to rows where this attribute equals `value`. */
169
+ eq(value: number): ComparisonOperation;
170
+ /** Filter to rows where this attribute does not equal `value`. */
171
+ ne(value: number): ComparisonOperation;
172
+ /** Filter to rows where this attribute is greater than `value`. */
173
+ gt(value: number): ComparisonOperation;
174
+ /** Filter to rows where this attribute is less than `value`. */
175
+ lt(value: number): ComparisonOperation;
176
+ /** Filter to rows where this attribute is greater than or equal to `value`. */
177
+ gte(value: number): ComparisonOperation;
178
+ /** Filter to rows where this attribute is less than or equal to `value`. */
179
+ lte(value: number): ComparisonOperation;
180
+ }
181
+ declare class BooleanAttribute extends Attribute {
182
+ constructor(displayName: string, columnName: string, columnDbType: string, owner: string, parent?: JoinTreeNodeOperation, embedded?: Attribute, nullable?: boolean, optional?: boolean);
183
+ protected toConstant(value: AttributeValue): ConstantOperation;
184
+ /** Filter to rows where this attribute equals `value`. */
185
+ eq(value: boolean): ComparisonOperation;
186
+ /** Filter to rows where this attribute is true. */
187
+ isTrue(): ComparisonOperation;
188
+ /** Filter to rows where this attribute is false. */
189
+ isFalse(): ComparisonOperation;
190
+ }
191
+ declare class DateAttribute extends Attribute {
192
+ constructor(displayName: string, columnName: string, columnDbType: string, owner: string, parent?: JoinTreeNodeOperation, embedded?: Attribute, nullable?: boolean, optional?: boolean);
193
+ protected toConstant(value: AttributeValue): ConstantOperation;
194
+ /** Filter to rows where this date equals `value`. */
195
+ eq(value: Date | string): ComparisonOperation;
196
+ /** Filter to rows where this date does not equal `value`. */
197
+ ne(value: Date | string): ComparisonOperation;
198
+ /** Filter to rows where this date is after `value`. */
199
+ gt(value: Date | string): ComparisonOperation;
200
+ /** Filter to rows where this date is before `value`. */
201
+ lt(value: Date | string): ComparisonOperation;
202
+ /** Filter to rows where this date is on or after `value`. */
203
+ gte(value: Date | string): ComparisonOperation;
204
+ /** Filter to rows where this date is on or before `value`. */
205
+ lte(value: Date | string): ComparisonOperation;
206
+ /** Extract the four-digit calendar year. */
207
+ year(): DateExtractOperation;
208
+ /** Extract the month number (1–12). */
209
+ month(): DateExtractOperation;
210
+ /** Extract the day of the month (1–31). */
211
+ day(): DateExtractOperation;
212
+ /** Extract the quarter (1–4). */
213
+ quarter(): DateExtractOperation;
214
+ /** Extract the ISO week number (1–53). */
215
+ week(): DateExtractOperation;
216
+ /** Extract the day of the week (0 = Sunday through 6 = Saturday). */
217
+ dayOfWeek(): DateExtractOperation;
218
+ /** The date of the first day of the week the date falls in (a Monday). */
219
+ firstDayOfWeek(): DateTruncOperation;
220
+ /** The date of the first day of the month the date falls in. */
221
+ firstDayOfMonth(): DateTruncOperation;
222
+ /** The date of the first day of the quarter the date falls in. */
223
+ firstDayOfQuarter(): DateTruncOperation;
224
+ /** The date of the first day of the year the date falls in. */
225
+ firstDayOfYear(): DateTruncOperation;
226
+ /** Add `n` days to this date. */
227
+ addDays(n: number): DateArithmeticOperation;
228
+ /** Add `n` months to this date. */
229
+ addMonths(n: number): DateArithmeticOperation;
230
+ /** Add `n` years to this date. */
231
+ addYears(n: number): DateArithmeticOperation;
232
+ /** Subtract `n` days from this date. */
233
+ subtractDays(n: number): DateArithmeticOperation;
234
+ /** Subtract `n` months from this date. */
235
+ subtractMonths(n: number): DateArithmeticOperation;
236
+ /** Subtract `n` years from this date. */
237
+ subtractYears(n: number): DateArithmeticOperation;
238
+ /** Number of whole days between this date and `other`. */
239
+ diffDays(other: Date): DateDiffOperation;
240
+ /** Number of whole months between this date and `other`. */
241
+ diffMonths(other: Date): DateDiffOperation;
242
+ /** Number of whole years between this date and `other`. */
243
+ diffYears(other: Date): DateDiffOperation;
244
+ }
245
+ interface DateAttribute extends MinMax {
246
+ }
247
+ declare class DateTimeAttribute extends Attribute {
248
+ constructor(displayName: string, columnName: string, columnDbType: string, owner: string, parent?: JoinTreeNodeOperation, embedded?: Attribute, nullable?: boolean, optional?: boolean);
249
+ protected toConstant(value: AttributeValue): ConstantOperation;
250
+ /** Filter to rows where this timestamp equals `value`. */
251
+ eq(value: Date | string): ComparisonOperation;
252
+ /** Filter to rows where this timestamp does not equal `value`. */
253
+ ne(value: Date | string): ComparisonOperation;
254
+ /** Filter to rows where this timestamp is after `value`. */
255
+ gt(value: Date | string): ComparisonOperation;
256
+ /** Filter to rows where this timestamp is before `value`. */
257
+ lt(value: Date | string): ComparisonOperation;
258
+ /** Filter to rows where this timestamp is on or after `value`. */
259
+ gte(value: Date | string): ComparisonOperation;
260
+ /** Filter to rows where this timestamp is on or before `value`. */
261
+ lte(value: Date | string): ComparisonOperation;
262
+ /** Extract the four-digit calendar year. */
263
+ year(): DateExtractOperation;
264
+ /** Extract the month number (1–12). */
265
+ month(): DateExtractOperation;
266
+ /** Extract the day of the month (1–31). */
267
+ day(): DateExtractOperation;
268
+ /** Extract the hour (0–23). */
269
+ hour(): DateExtractOperation;
270
+ /** Extract the minute (0–59). */
271
+ minute(): DateExtractOperation;
272
+ /** Extract the second (0–59). */
273
+ second(): DateExtractOperation;
274
+ /** Extract the quarter (1–4). */
275
+ quarter(): DateExtractOperation;
276
+ /** Extract the ISO week number (1–53). */
277
+ week(): DateExtractOperation;
278
+ /** Extract the day of the week (0 = Sunday through 6 = Saturday). */
279
+ dayOfWeek(): DateExtractOperation;
280
+ /** The date of the first day of the week the date falls in (a Monday). */
281
+ firstDayOfWeek(): DateTruncOperation;
282
+ /** The date of the first day of the month the date falls in. */
283
+ firstDayOfMonth(): DateTruncOperation;
284
+ /** The date of the first day of the quarter the date falls in. */
285
+ firstDayOfQuarter(): DateTruncOperation;
286
+ /** The date of the first day of the year the date falls in. */
287
+ firstDayOfYear(): DateTruncOperation;
288
+ /** Add `n` days to this timestamp. */
289
+ addDays(n: number): DateArithmeticOperation;
290
+ /** Add `n` months to this timestamp. */
291
+ addMonths(n: number): DateArithmeticOperation;
292
+ /** Add `n` years to this timestamp. */
293
+ addYears(n: number): DateArithmeticOperation;
294
+ /** Add `n` hours to this timestamp. */
295
+ addHours(n: number): DateArithmeticOperation;
296
+ /** Add `n` minutes to this timestamp. */
297
+ addMinutes(n: number): DateArithmeticOperation;
298
+ /** Add `n` seconds to this timestamp. */
299
+ addSeconds(n: number): DateArithmeticOperation;
300
+ /** Subtract `n` days from this timestamp. */
301
+ subtractDays(n: number): DateArithmeticOperation;
302
+ /** Subtract `n` months from this timestamp. */
303
+ subtractMonths(n: number): DateArithmeticOperation;
304
+ /** Subtract `n` years from this timestamp. */
305
+ subtractYears(n: number): DateArithmeticOperation;
306
+ /** Subtract `n` hours from this timestamp. */
307
+ subtractHours(n: number): DateArithmeticOperation;
308
+ /** Subtract `n` minutes from this timestamp. */
309
+ subtractMinutes(n: number): DateArithmeticOperation;
310
+ /** Subtract `n` seconds from this timestamp. */
311
+ subtractSeconds(n: number): DateArithmeticOperation;
312
+ /** Number of whole days between this timestamp and `other`. */
313
+ diffDays(other: Date): DateDiffOperation;
314
+ /** Number of whole months between this timestamp and `other`. */
315
+ diffMonths(other: Date): DateDiffOperation;
316
+ /** Number of whole years between this timestamp and `other`. */
317
+ diffYears(other: Date): DateDiffOperation;
318
+ /** Number of whole hours between this timestamp and `other`. */
319
+ diffHours(other: Date): DateDiffOperation;
320
+ /** Number of whole minutes between this timestamp and `other`. */
321
+ diffMinutes(other: Date): DateDiffOperation;
322
+ /** Number of whole seconds between this timestamp and `other`. */
323
+ diffSeconds(other: Date): DateDiffOperation;
324
+ }
325
+ interface DateTimeAttribute extends MinMax {
326
+ }
327
+
328
+ export { BooleanAttribute as B, DateAttribute as D, FloatAttribute as F, IntegerAttribute as I, NumericAttribute as N, StringAttribute as S, DateTimeAttribute as a, DecimalAttribute as b, DoubleAttribute as c, NumericFunctionOperation as d, StringFunctionOperation as e };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "data-finder-ts",
3
- "version": "0.1.4",
3
+ "version": "0.1.5",
4
4
  "description": "TypeScript runtime library for data-finder generated finders",
5
5
  "keywords": [
6
6
  "data",
@@ -77,7 +77,8 @@
77
77
  "generate:dual-assoc": "uv run python example/generate_dual_assoc.py",
78
78
  "generate:examples": "uv run python example/generate_examples.py",
79
79
  "generate:graphql": "uv run python example/generate_graphql_examples.py",
80
- "generate:specs": "uv run python scripts/generate_spec_tests.py"
80
+ "generate:specs": "uv run python scripts/generate_spec_tests.py",
81
+ "check:dialects": "DIALECT_CORPUS=.dialect-corpus.json vitest run tests/dialects.test.ts && uv run python scripts/validate_dialects.py .dialect-corpus.json"
81
82
  },
82
83
  "dependencies": {
83
84
  "vite-tsconfig-paths": "^6.1.1"
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/datafinder/attribute.ts"],"sourcesContent":["import {\n Column,\n AggregateOperation,\n AggregateOperator,\n ColumnWithJoin,\n SortOperation,\n SortDirection,\n IsNullOperation,\n IsNotNullOperation,\n JoinTreeNodeOperation,\n WindowFunction,\n WindowFunctionOperation,\n WindowSpecification,\n} from '../model/relational';\n\nexport abstract class Attribute {\n private readonly _displayName: string;\n private readonly _column: Column;\n private readonly _owner: string;\n private readonly _parent?: JoinTreeNodeOperation;\n private readonly _embedded?: Attribute;\n\n constructor(\n displayName: string,\n columnName: string,\n columnDbType: string,\n owner: string,\n parent?: JoinTreeNodeOperation,\n embedded?: Attribute,\n ) {\n this._displayName = displayName;\n this._column = new Column(columnName, columnDbType, owner);\n this._owner = owner;\n this._parent = parent;\n this._embedded = embedded;\n }\n\n column(): Column { return this._column; }\n owner(): string { return this._owner; }\n parent(): JoinTreeNodeOperation | undefined { return this._parent; }\n displayName(): string { return this._displayName; }\n\n /** Alternate attribute on a flat column of the owning table, used in place of this one when its join is elided. */\n embedded(): Attribute | undefined { return this._embedded; }\n\n cwj(): ColumnWithJoin {\n return new ColumnWithJoin(this._column, this._parent, this._embedded?.cwj());\n }\n\n /** Count the number of non-null values. Use in a projection with `groupByOp` to aggregate per group. */\n count(): AggregateOperation {\n return new AggregateOperation(\n this.cwj(),\n AggregateOperator.COUNT,\n this._displayName + ' Count',\n );\n }\n\n /** Sort this attribute in ascending order. Pass to `orderByOp` or a window function's `orderBy`. */\n ascending(): SortOperation {\n return new SortOperation(this.cwj(), SortDirection.ASC);\n }\n\n /** Sort this attribute in descending order. Pass to `orderByOp` or a window function's `orderBy`. */\n descending(): SortOperation {\n return new SortOperation(this.cwj(), SortDirection.DESC);\n }\n\n /** Filter to rows where this attribute has no value. */\n isNull(): IsNullOperation {\n return new IsNullOperation(this.cwj());\n }\n\n /** Filter to rows where this attribute has a value. */\n isNotNull(): IsNotNullOperation {\n return new IsNotNullOperation(this.cwj());\n }\n\n private _windowSpec(\n partitionBy?: Attribute | ColumnWithJoin | (Attribute | ColumnWithJoin)[],\n orderBy?: SortOperation | SortOperation[],\n ): WindowSpecification {\n const pbArr = partitionBy === undefined ? [] : Array.isArray(partitionBy) ? partitionBy : [partitionBy];\n const pb = pbArr.map(x => x instanceof Attribute ? x.cwj() : x);\n const ob = orderBy === undefined ? [] : Array.isArray(orderBy) ? orderBy : [orderBy];\n return new WindowSpecification(pb, ob);\n }\n\n /**\n * Assign a rank to each row within the ordered window, following pandas `Series.rank` conventions.\n *\n * `method` controls tie-breaking (default `'min'`):\n * - `'min'` — tied rows share the lowest rank; the next rank skips.\n * - `'dense'` — like `'min'` but ranks are contiguous (no gaps).\n * - `'first'` — each row gets a unique sequential integer (no ties).\n * - `'max'` — only meaningful with `pct: true` (see below).\n *\n * When `pct: true` the result is a relative rank between 0 and 1:\n * - `method: 'min'` (default) → fraction of values strictly below this row (PERCENT_RANK).\n * - `method: 'max'` → fraction of values at or below this row (cumulative distribution).\n *\n * `partitionBy` restarts the ranking within each group of distinct values.\n */\n rank(opts: {\n method?: 'min' | 'dense' | 'first' | 'max';\n pct?: boolean;\n partitionBy?: Attribute | ColumnWithJoin | (Attribute | ColumnWithJoin)[];\n orderBy?: SortOperation | SortOperation[];\n } = {}): WindowFunctionOperation {\n const { method = 'min', pct = false, partitionBy, orderBy } = opts;\n let func: WindowFunction;\n let name: string;\n if (pct) {\n if (method === 'max') { func = WindowFunction.CUME_DIST; name = 'Cume Dist'; }\n else { func = WindowFunction.PERCENT_RANK; name = 'Percent Rank'; }\n } else if (method === 'first') { func = WindowFunction.ROW_NUMBER; name = 'Row Number'; }\n else if (method === 'dense') { func = WindowFunction.DENSE_RANK; name = 'Dense Rank'; }\n else { func = WindowFunction.RANK; name = 'Rank'; }\n return new WindowFunctionOperation(null, func, name, undefined, [], this._windowSpec(partitionBy, orderBy));\n }\n\n /**\n * Split rows into `buckets` equal-sized quantile bins ordered by `orderBy`.\n * Each row receives a bucket number from 1 (lowest) to `buckets` (highest).\n * Named after `pandas.qcut`.\n */\n qcut(buckets: number, opts: {\n partitionBy?: Attribute | ColumnWithJoin | (Attribute | ColumnWithJoin)[];\n orderBy?: SortOperation | SortOperation[];\n } = {}): WindowFunctionOperation {\n return new WindowFunctionOperation(null, WindowFunction.NTILE, 'Quantile', buckets, [],\n this._windowSpec(opts.partitionBy, opts.orderBy));\n }\n\n /**\n * Return the value of this attribute from `periods` rows earlier (positive) or later (negative)\n * within the ordered window, following `pandas.Series.shift`.\n * Rows with no neighbour at the given offset return `null` (or `fillValue` if provided).\n */\n shift(periods = 1, opts: {\n fillValue?: string | number;\n partitionBy?: Attribute | ColumnWithJoin | (Attribute | ColumnWithJoin)[];\n orderBy?: SortOperation | SortOperation[];\n } = {}): WindowFunctionOperation {\n const extraArgs: (string | number)[] = opts.fillValue !== undefined ? [opts.fillValue] : [];\n const func = periods >= 0 ? WindowFunction.LAG : WindowFunction.LEAD;\n const label = periods >= 0 ? 'Lag' : 'Lead';\n return new WindowFunctionOperation(\n this.cwj(),\n func,\n label + ' ' + this._displayName,\n Math.abs(periods),\n extraArgs,\n this._windowSpec(opts.partitionBy, opts.orderBy),\n );\n }\n\n /**\n * Return the first value of this attribute in the window frame.\n * Use `partitionBy` to restart the frame for each group.\n */\n first(opts: {\n partitionBy?: Attribute | ColumnWithJoin | (Attribute | ColumnWithJoin)[];\n orderBy?: SortOperation | SortOperation[];\n } = {}): WindowFunctionOperation {\n return new WindowFunctionOperation(\n this.cwj(),\n WindowFunction.FIRST_VALUE,\n 'First ' + this._displayName,\n undefined, [],\n this._windowSpec(opts.partitionBy, opts.orderBy),\n );\n }\n\n /**\n * Return the last value of this attribute in the window frame.\n * Use `partitionBy` to restart the frame for each group.\n */\n last(opts: {\n partitionBy?: Attribute | ColumnWithJoin | (Attribute | ColumnWithJoin)[];\n orderBy?: SortOperation | SortOperation[];\n } = {}): WindowFunctionOperation {\n return new WindowFunctionOperation(\n this.cwj(),\n WindowFunction.LAST_VALUE,\n 'Last ' + this._displayName,\n undefined, [],\n this._windowSpec(opts.partitionBy, opts.orderBy),\n );\n }\n}\n"],"mappings":";;;;;;;;;;;;AAeO,IAAe,YAAf,MAAe,W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Q,MAAM,KAAK;AAAA,MACnB,KAAK,IAAI,OAAO;AAAA,MAChB;AAAA,MACA,KAAK,YAAY,KAAK,aAAa,KAAK,OAAO;AAAA,IACjD;AAAA,EACF;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,MAAM,OAGF,CAAC,GAA4B;AAC/B,WAAO,IAAI;AAAA,MACT,KAAK,IAAI;AAAA;AAAA,MAET,WAAW,KAAK;AAAA,MAChB;AAAA,MAAW,CAAC;AAAA,MACZ,KAAK,YAAY,KAAK,aAAa,KAAK,OAAO;AAAA,IACjD;AAAA,EACF;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,KAAK,OAGD,CAAC,GAA4B;AAC/B,WAAO,IAAI;AAAA,MACT,KAAK,IAAI;AAAA;AAAA,MAET,UAAU,KAAK;AAAA,MACf;AAAA,MAAW,CAAC;AAAA,MACZ,KAAK,YAAY,KAAK,aAAa,KAAK,OAAO;AAAA,IACjD;AAAA,EACF;AACF;","names":[]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/datafinder/typed-attributes.ts"],"sourcesContent":["import { Attribute } from './attribute';\nimport {\n ComparisonOperation,\n ComparisonOperator,\n Operation,\n StringConstantOperation,\n FloatConstantOperation,\n IntegerConstantOperation,\n DateConstantOperation,\n DateTimeConstantOperation,\n BooleanConstantOperation,\n DecimalConstantOperation,\n AggregateOperation,\n AggregateOperator,\n ScalarFunction,\n ScalarFunctionOperation,\n DatePart,\n DateExtractOperation,\n DateArithmeticOperation,\n DateDiffOperation,\n JoinTreeNodeOperation,\n} from '../model/relational';\n\nexport class StringAttribute extends Attribute {\n constructor(\n displayName: string,\n columnName: string,\n columnDbType: string,\n owner: string,\n parent?: JoinTreeNodeOperation,\n embedded?: Attribute,\n ) { super(displayName, columnName, columnDbType, owner, parent, embedded); }\n\n /** Convert every character to uppercase. */\n toUpperCase(): ScalarFunctionOperation {\n return new ScalarFunctionOperation(this.cwj(), ScalarFunction.UPPER, 'Upper ' + this.displayName());\n }\n /** Convert every character to lowercase. */\n toLowerCase(): ScalarFunctionOperation {\n return new ScalarFunctionOperation(this.cwj(), ScalarFunction.LOWER, 'Lower ' + this.displayName());\n }\n /** Remove leading and trailing whitespace. */\n trim(): ScalarFunctionOperation {\n return new ScalarFunctionOperation(this.cwj(), ScalarFunction.TRIM, 'Trim ' + this.displayName());\n }\n /** Remove leading whitespace. */\n trimStart(): ScalarFunctionOperation {\n return new ScalarFunctionOperation(this.cwj(), ScalarFunction.LTRIM, 'Trim Start ' + this.displayName());\n }\n /** Remove trailing whitespace. */\n trimEnd(): ScalarFunctionOperation {\n return new ScalarFunctionOperation(this.cwj(), ScalarFunction.RTRIM, 'Trim End ' + this.displayName());\n }\n /** Return the number of characters in the string. */\n length(): ScalarFunctionOperation {\n return new ScalarFunctionOperation(this.cwj(), ScalarFunction.LENGTH, 'Length ' + this.displayName());\n }\n /** Return the string with characters in reverse order. */\n reverse(): ScalarFunctionOperation {\n return new ScalarFunctionOperation(this.cwj(), ScalarFunction.REVERSE, 'Reverse ' + this.displayName());\n }\n /** Return the first `n` characters. */\n left(n: number): ScalarFunctionOperation {\n return new ScalarFunctionOperation(this.cwj(), ScalarFunction.LEFT, 'Left ' + this.displayName(), n);\n }\n /** Return the last `n` characters. */\n right(n: number): ScalarFunctionOperation {\n return new ScalarFunctionOperation(this.cwj(), ScalarFunction.RIGHT, 'Right ' + this.displayName(), n);\n }\n /** Return the string repeated `n` times. */\n repeat(n: number): ScalarFunctionOperation {\n return new ScalarFunctionOperation(this.cwj(), ScalarFunction.REPEAT, 'Repeat ' + this.displayName(), n);\n }\n /** Replace all occurrences of `fromStr` with `toStr`. */\n replace(fromStr: string, toStr: string): ScalarFunctionOperation {\n return new ScalarFunctionOperation(this.cwj(), ScalarFunction.REPLACE, 'Replace ' + this.displayName(), undefined, [fromStr, toStr]);\n }\n /**\n * Extract a portion of the string.\n * `start` is zero-based (following Python convention); `length` is optional.\n */\n substring(start: number, length?: number): ScalarFunctionOperation {\n // Python convention: 0-based start; SQL SUBSTRING is 1-based, so add 1\n const args: (number)[] = length !== undefined ? [start + 1, length] : [start + 1];\n return new ScalarFunctionOperation(this.cwj(), ScalarFunction.SUBSTRING, 'Substring ' + this.displayName(), undefined, args);\n }\n\n /** Filter to rows where this attribute equals `value`. */\n eq(value: string): Operation {\n return new ComparisonOperation(this.cwj(), ComparisonOperator.EQUAL, new StringConstantOperation(value));\n }\n /** Filter to rows where this attribute does not equal `value`. */\n ne(value: string): Operation {\n return new ComparisonOperation(this.cwj(), ComparisonOperator.NOT_EQUAL, new StringConstantOperation(value));\n }\n /** Filter to rows where this attribute contains `value` as a substring. */\n contains(value: string): Operation {\n return new ComparisonOperation(this.cwj(), ComparisonOperator.LIKE, new StringConstantOperation(`%${value}%`));\n }\n /** Filter to rows where this attribute begins with `prefix`. */\n startsWith(prefix: string): Operation {\n return new ComparisonOperation(this.cwj(), ComparisonOperator.LIKE, new StringConstantOperation(`${prefix}%`));\n }\n /** Filter to rows where this attribute ends with `suffix`. */\n endsWith(suffix: string): Operation {\n return new ComparisonOperation(this.cwj(), ComparisonOperator.LIKE, new StringConstantOperation(`%${suffix}`));\n }\n /** Filter to rows where this attribute does not contain `value` as a substring. */\n notContains(value: string): Operation {\n return new ComparisonOperation(this.cwj(), ComparisonOperator.NOT_LIKE, new StringConstantOperation(`%${value}%`));\n }\n}\n\nexport abstract class NumericAttribute extends Attribute {\n constructor(\n displayName: string,\n columnName: string,\n columnDbType: string,\n owner: string,\n parent?: JoinTreeNodeOperation,\n embedded?: Attribute,\n ) { super(displayName, columnName, columnDbType, owner, parent, embedded); }\n\n /** Sum of all values in the group. */\n sum(): AggregateOperation {\n return new AggregateOperation(this.cwj(), AggregateOperator.SUM, 'Sum ' + this.displayName());\n }\n /** Smallest value in the group. */\n min(): AggregateOperation {\n return new AggregateOperation(this.cwj(), AggregateOperator.MIN, 'Min ' + this.displayName());\n }\n /** Largest value in the group. */\n max(): AggregateOperation {\n return new AggregateOperation(this.cwj(), AggregateOperator.MAX, 'Max ' + this.displayName());\n }\n /** Arithmetic mean of all values in the group. */\n average(): AggregateOperation {\n return new AggregateOperation(this.cwj(), AggregateOperator.AVERAGE, 'Average ' + this.displayName());\n }\n /** Absolute value (distance from zero, always non-negative). */\n abs(): ScalarFunctionOperation {\n return new ScalarFunctionOperation(this.cwj(), ScalarFunction.ABS, 'Abs ' + this.displayName());\n }\n /** Round up to the nearest integer. */\n ceil(): ScalarFunctionOperation {\n return new ScalarFunctionOperation(this.cwj(), ScalarFunction.CEILING, 'Ceil ' + this.displayName());\n }\n /** Round down to the nearest integer. */\n floor(): ScalarFunctionOperation {\n return new ScalarFunctionOperation(this.cwj(), ScalarFunction.FLOOR, 'Floor ' + this.displayName());\n }\n /** Square root. */\n sqrt(): ScalarFunctionOperation {\n return new ScalarFunctionOperation(this.cwj(), ScalarFunction.SQRT, 'Sqrt ' + this.displayName());\n }\n /** Remainder after dividing by `n`. */\n mod(n: number): ScalarFunctionOperation {\n return new ScalarFunctionOperation(this.cwj(), ScalarFunction.MOD, 'Mod ' + this.displayName(), n);\n }\n /** Raise to the power of `n`. */\n power(n: number): ScalarFunctionOperation {\n return new ScalarFunctionOperation(this.cwj(), ScalarFunction.POWER, 'Power ' + this.displayName(), n);\n }\n /** Round to `d` decimal places, or to the nearest integer when `d` is omitted. */\n round(d?: number): ScalarFunctionOperation {\n return new ScalarFunctionOperation(this.cwj(), ScalarFunction.ROUND, 'Round ' + this.displayName(), d);\n }\n}\n\nexport class DoubleAttribute extends NumericAttribute {\n constructor(\n displayName: string,\n columnName: string,\n columnDbType: string,\n owner: string,\n parent?: JoinTreeNodeOperation,\n embedded?: Attribute,\n ) { super(displayName, columnName, columnDbType, owner, parent, embedded); }\n\n /** Filter to rows where this attribute equals `value`. */\n eq(value: number): Operation {\n return new ComparisonOperation(this.cwj(), ComparisonOperator.EQUAL, new FloatConstantOperation(value));\n }\n /** Filter to rows where this attribute does not equal `value`. */\n ne(value: number): Operation {\n return new ComparisonOperation(this.cwj(), ComparisonOperator.NOT_EQUAL, new FloatConstantOperation(value));\n }\n /** Filter to rows where this attribute is greater than `value`. */\n gt(value: number): Operation {\n return new ComparisonOperation(this.cwj(), ComparisonOperator.GREATER_THAN, new FloatConstantOperation(value));\n }\n /** Filter to rows where this attribute is less than `value`. */\n lt(value: number): Operation {\n return new ComparisonOperation(this.cwj(), ComparisonOperator.LESS_THAN, new FloatConstantOperation(value));\n }\n /** Filter to rows where this attribute is greater than or equal to `value`. */\n gte(value: number): Operation {\n return new ComparisonOperation(this.cwj(), ComparisonOperator.GREATER_THAN_OR_EQUAL_TO, new FloatConstantOperation(value));\n }\n /** Filter to rows where this attribute is less than or equal to `value`. */\n lte(value: number): Operation {\n return new ComparisonOperation(this.cwj(), ComparisonOperator.LESS_THAN_OR_EQUAL_TO, new FloatConstantOperation(value));\n }\n}\n\nexport const FloatAttribute = DoubleAttribute;\nexport type FloatAttribute = DoubleAttribute;\n\nexport class DecimalAttribute extends NumericAttribute {\n constructor(\n displayName: string,\n columnName: string,\n columnDbType: string,\n owner: string,\n parent?: JoinTreeNodeOperation,\n embedded?: Attribute,\n ) { super(displayName, columnName, columnDbType, owner, parent, embedded); }\n\n /** Filter to rows where this attribute equals `value`. */\n eq(value: number): Operation {\n return new ComparisonOperation(this.cwj(), ComparisonOperator.EQUAL, new DecimalConstantOperation(value));\n }\n /** Filter to rows where this attribute does not equal `value`. */\n ne(value: number): Operation {\n return new ComparisonOperation(this.cwj(), ComparisonOperator.NOT_EQUAL, new DecimalConstantOperation(value));\n }\n /** Filter to rows where this attribute is greater than `value`. */\n gt(value: number): Operation {\n return new ComparisonOperation(this.cwj(), ComparisonOperator.GREATER_THAN, new DecimalConstantOperation(value));\n }\n /** Filter to rows where this attribute is less than `value`. */\n lt(value: number): Operation {\n return new ComparisonOperation(this.cwj(), ComparisonOperator.LESS_THAN, new DecimalConstantOperation(value));\n }\n /** Filter to rows where this attribute is greater than or equal to `value`. */\n gte(value: number): Operation {\n return new ComparisonOperation(this.cwj(), ComparisonOperator.GREATER_THAN_OR_EQUAL_TO, new DecimalConstantOperation(value));\n }\n /** Filter to rows where this attribute is less than or equal to `value`. */\n lte(value: number): Operation {\n return new ComparisonOperation(this.cwj(), ComparisonOperator.LESS_THAN_OR_EQUAL_TO, new DecimalConstantOperation(value));\n }\n}\n\nexport class IntegerAttribute extends NumericAttribute {\n constructor(\n displayName: string,\n columnName: string,\n columnDbType: string,\n owner: string,\n parent?: JoinTreeNodeOperation,\n embedded?: Attribute,\n ) { super(displayName, columnName, columnDbType, owner, parent, embedded); }\n\n /** Filter to rows where this attribute equals `value`. */\n eq(value: number): Operation {\n return new ComparisonOperation(this.cwj(), ComparisonOperator.EQUAL, new IntegerConstantOperation(value));\n }\n /** Filter to rows where this attribute does not equal `value`. */\n ne(value: number): Operation {\n return new ComparisonOperation(this.cwj(), ComparisonOperator.NOT_EQUAL, new IntegerConstantOperation(value));\n }\n /** Filter to rows where this attribute is greater than `value`. */\n gt(value: number): Operation {\n return new ComparisonOperation(this.cwj(), ComparisonOperator.GREATER_THAN, new IntegerConstantOperation(value));\n }\n /** Filter to rows where this attribute is less than `value`. */\n lt(value: number): Operation {\n return new ComparisonOperation(this.cwj(), ComparisonOperator.LESS_THAN, new IntegerConstantOperation(value));\n }\n /** Filter to rows where this attribute is greater than or equal to `value`. */\n gte(value: number): Operation {\n return new ComparisonOperation(this.cwj(), ComparisonOperator.GREATER_THAN_OR_EQUAL_TO, new IntegerConstantOperation(value));\n }\n /** Filter to rows where this attribute is less than or equal to `value`. */\n lte(value: number): Operation {\n return new ComparisonOperation(this.cwj(), ComparisonOperator.LESS_THAN_OR_EQUAL_TO, new IntegerConstantOperation(value));\n }\n}\n\nexport class BooleanAttribute extends Attribute {\n constructor(\n displayName: string,\n columnName: string,\n columnDbType: string,\n owner: string,\n parent?: JoinTreeNodeOperation,\n embedded?: Attribute,\n ) { super(displayName, columnName, columnDbType, owner, parent, embedded); }\n\n /** Filter to rows where this attribute equals `value`. */\n eq(value: boolean): Operation {\n return new ComparisonOperation(this.cwj(), ComparisonOperator.EQUAL, new BooleanConstantOperation(value));\n }\n /** Filter to rows where this attribute is true. */\n isTrue(): Operation {\n return new ComparisonOperation(this.cwj(), ComparisonOperator.EQUAL, new BooleanConstantOperation(true));\n }\n /** Filter to rows where this attribute is false. */\n isFalse(): Operation {\n return new ComparisonOperation(this.cwj(), ComparisonOperator.EQUAL, new BooleanConstantOperation(false));\n }\n}\n\nfunction parseDate(value: Date | string): Date {\n if (value instanceof Date) return value;\n const d = new Date(value);\n if (isNaN(d.getTime())) throw new Error(`Cannot parse date: ${value}`);\n return d;\n}\n\nexport class DateAttribute extends Attribute {\n constructor(\n displayName: string,\n columnName: string,\n columnDbType: string,\n owner: string,\n parent?: JoinTreeNodeOperation,\n embedded?: Attribute,\n ) { super(displayName, columnName, columnDbType, owner, parent, embedded); }\n\n /** Filter to rows where this date equals `value`. */\n eq(value: Date | string): Operation {\n return new ComparisonOperation(this.cwj(), ComparisonOperator.EQUAL, new DateConstantOperation(parseDate(value)));\n }\n /** Filter to rows where this date does not equal `value`. */\n ne(value: Date | string): Operation {\n return new ComparisonOperation(this.cwj(), ComparisonOperator.NOT_EQUAL, new DateConstantOperation(parseDate(value)));\n }\n /** Filter to rows where this date is after `value`. */\n gt(value: Date | string): Operation {\n return new ComparisonOperation(this.cwj(), ComparisonOperator.GREATER_THAN, new DateConstantOperation(parseDate(value)));\n }\n /** Filter to rows where this date is before `value`. */\n lt(value: Date | string): Operation {\n return new ComparisonOperation(this.cwj(), ComparisonOperator.LESS_THAN, new DateConstantOperation(parseDate(value)));\n }\n /** Filter to rows where this date is on or after `value`. */\n gte(value: Date | string): Operation {\n return new ComparisonOperation(this.cwj(), ComparisonOperator.GREATER_THAN_OR_EQUAL_TO, new DateConstantOperation(parseDate(value)));\n }\n /** Filter to rows where this date is on or before `value`. */\n lte(value: Date | string): Operation {\n return new ComparisonOperation(this.cwj(), ComparisonOperator.LESS_THAN_OR_EQUAL_TO, new DateConstantOperation(parseDate(value)));\n }\n\n /** Extract the four-digit calendar year. */\n year(): DateExtractOperation { return new DateExtractOperation(this.cwj(), DatePart.YEAR, 'Year ' + this.displayName()); }\n /** Extract the month number (1–12). */\n month(): DateExtractOperation { return new DateExtractOperation(this.cwj(), DatePart.MONTH, 'Month ' + this.displayName()); }\n /** Extract the day of the month (1–31). */\n day(): DateExtractOperation { return new DateExtractOperation(this.cwj(), DatePart.DAY, 'Day ' + this.displayName()); }\n /** Extract the quarter (1–4). */\n quarter(): DateExtractOperation { return new DateExtractOperation(this.cwj(), DatePart.QUARTER, 'Quarter ' + this.displayName()); }\n /** Extract the ISO week number (1–53). */\n week(): DateExtractOperation { return new DateExtractOperation(this.cwj(), DatePart.WEEK, 'Week ' + this.displayName()); }\n /** Extract the day of the week (0 = Sunday through 6 = Saturday). */\n dayOfWeek(): DateExtractOperation { return new DateExtractOperation(this.cwj(), DatePart.DOW, 'Day Of Week ' + this.displayName()); }\n\n /** Add `n` days to this date. */\n addDays(n: number): DateArithmeticOperation { return new DateArithmeticOperation(this.cwj(), n, DatePart.DAY, true, 'Add Days ' + this.displayName()); }\n /** Add `n` months to this date. */\n addMonths(n: number): DateArithmeticOperation { return new DateArithmeticOperation(this.cwj(), n, DatePart.MONTH, true, 'Add Months ' + this.displayName()); }\n /** Add `n` years to this date. */\n addYears(n: number): DateArithmeticOperation { return new DateArithmeticOperation(this.cwj(), n, DatePart.YEAR, true, 'Add Years ' + this.displayName()); }\n /** Subtract `n` days from this date. */\n subtractDays(n: number): DateArithmeticOperation { return new DateArithmeticOperation(this.cwj(), n, DatePart.DAY, false, 'Subtract Days ' + this.displayName()); }\n /** Subtract `n` months from this date. */\n subtractMonths(n: number): DateArithmeticOperation { return new DateArithmeticOperation(this.cwj(), n, DatePart.MONTH, false, 'Subtract Months ' + this.displayName()); }\n /** Subtract `n` years from this date. */\n subtractYears(n: number): DateArithmeticOperation { return new DateArithmeticOperation(this.cwj(), n, DatePart.YEAR, false, 'Subtract Years ' + this.displayName()); }\n\n /** Number of whole days between this date and `other`. */\n diffDays(other: Date): DateDiffOperation { return new DateDiffOperation(this.cwj(), other, DatePart.DAY, 'Diff Days ' + this.displayName()); }\n /** Number of whole months between this date and `other`. */\n diffMonths(other: Date): DateDiffOperation { return new DateDiffOperation(this.cwj(), other, DatePart.MONTH, 'Diff Months ' + this.displayName()); }\n /** Number of whole years between this date and `other`. */\n diffYears(other: Date): DateDiffOperation { return new DateDiffOperation(this.cwj(), other, DatePart.YEAR, 'Diff Years ' + this.displayName()); }\n}\n\nexport class DateTimeAttribute extends Attribute {\n constructor(\n displayName: string,\n columnName: string,\n columnDbType: string,\n owner: string,\n parent?: JoinTreeNodeOperation,\n embedded?: Attribute,\n ) { super(displayName, columnName, columnDbType, owner, parent, embedded); }\n\n /** Filter to rows where this timestamp equals `value`. */\n eq(value: Date | string): Operation {\n return new ComparisonOperation(this.cwj(), ComparisonOperator.EQUAL, new DateTimeConstantOperation(parseDate(value)));\n }\n /** Filter to rows where this timestamp does not equal `value`. */\n ne(value: Date | string): Operation {\n return new ComparisonOperation(this.cwj(), ComparisonOperator.NOT_EQUAL, new DateTimeConstantOperation(parseDate(value)));\n }\n /** Filter to rows where this timestamp is after `value`. */\n gt(value: Date | string): Operation {\n return new ComparisonOperation(this.cwj(), ComparisonOperator.GREATER_THAN, new DateTimeConstantOperation(parseDate(value)));\n }\n /** Filter to rows where this timestamp is before `value`. */\n lt(value: Date | string): Operation {\n return new ComparisonOperation(this.cwj(), ComparisonOperator.LESS_THAN, new DateTimeConstantOperation(parseDate(value)));\n }\n /** Filter to rows where this timestamp is on or after `value`. */\n gte(value: Date | string): Operation {\n return new ComparisonOperation(this.cwj(), ComparisonOperator.GREATER_THAN_OR_EQUAL_TO, new DateTimeConstantOperation(parseDate(value)));\n }\n /** Filter to rows where this timestamp is on or before `value`. */\n lte(value: Date | string): Operation {\n return new ComparisonOperation(this.cwj(), ComparisonOperator.LESS_THAN_OR_EQUAL_TO, new DateTimeConstantOperation(parseDate(value)));\n }\n\n /** Extract the four-digit calendar year. */\n year(): DateExtractOperation { return new DateExtractOperation(this.cwj(), DatePart.YEAR, 'Year ' + this.displayName()); }\n /** Extract the month number (1–12). */\n month(): DateExtractOperation { return new DateExtractOperation(this.cwj(), DatePart.MONTH, 'Month ' + this.displayName()); }\n /** Extract the day of the month (1–31). */\n day(): DateExtractOperation { return new DateExtractOperation(this.cwj(), DatePart.DAY, 'Day ' + this.displayName()); }\n /** Extract the hour (0–23). */\n hour(): DateExtractOperation { return new DateExtractOperation(this.cwj(), DatePart.HOUR, 'Hour ' + this.displayName()); }\n /** Extract the minute (0–59). */\n minute(): DateExtractOperation { return new DateExtractOperation(this.cwj(), DatePart.MINUTE, 'Minute ' + this.displayName()); }\n /** Extract the second (0–59). */\n second(): DateExtractOperation { return new DateExtractOperation(this.cwj(), DatePart.SECOND, 'Second ' + this.displayName()); }\n /** Extract the quarter (1–4). */\n quarter(): DateExtractOperation { return new DateExtractOperation(this.cwj(), DatePart.QUARTER, 'Quarter ' + this.displayName()); }\n /** Extract the ISO week number (1–53). */\n week(): DateExtractOperation { return new DateExtractOperation(this.cwj(), DatePart.WEEK, 'Week ' + this.displayName()); }\n /** Extract the day of the week (0 = Sunday through 6 = Saturday). */\n dayOfWeek(): DateExtractOperation { return new DateExtractOperation(this.cwj(), DatePart.DOW, 'Day Of Week ' + this.displayName()); }\n\n /** Add `n` days to this timestamp. */\n addDays(n: number): DateArithmeticOperation { return new DateArithmeticOperation(this.cwj(), n, DatePart.DAY, true, 'Add Days ' + this.displayName()); }\n /** Add `n` months to this timestamp. */\n addMonths(n: number): DateArithmeticOperation { return new DateArithmeticOperation(this.cwj(), n, DatePart.MONTH, true, 'Add Months ' + this.displayName()); }\n /** Add `n` years to this timestamp. */\n addYears(n: number): DateArithmeticOperation { return new DateArithmeticOperation(this.cwj(), n, DatePart.YEAR, true, 'Add Years ' + this.displayName()); }\n /** Add `n` hours to this timestamp. */\n addHours(n: number): DateArithmeticOperation { return new DateArithmeticOperation(this.cwj(), n, DatePart.HOUR, true, 'Add Hours ' + this.displayName()); }\n /** Add `n` minutes to this timestamp. */\n addMinutes(n: number): DateArithmeticOperation { return new DateArithmeticOperation(this.cwj(), n, DatePart.MINUTE, true, 'Add Minutes ' + this.displayName()); }\n /** Add `n` seconds to this timestamp. */\n addSeconds(n: number): DateArithmeticOperation { return new DateArithmeticOperation(this.cwj(), n, DatePart.SECOND, true, 'Add Seconds ' + this.displayName()); }\n /** Subtract `n` days from this timestamp. */\n subtractDays(n: number): DateArithmeticOperation { return new DateArithmeticOperation(this.cwj(), n, DatePart.DAY, false, 'Subtract Days ' + this.displayName()); }\n /** Subtract `n` months from this timestamp. */\n subtractMonths(n: number): DateArithmeticOperation { return new DateArithmeticOperation(this.cwj(), n, DatePart.MONTH, false, 'Subtract Months ' + this.displayName()); }\n /** Subtract `n` years from this timestamp. */\n subtractYears(n: number): DateArithmeticOperation { return new DateArithmeticOperation(this.cwj(), n, DatePart.YEAR, false, 'Subtract Years ' + this.displayName()); }\n /** Subtract `n` hours from this timestamp. */\n subtractHours(n: number): DateArithmeticOperation { return new DateArithmeticOperation(this.cwj(), n, DatePart.HOUR, false, 'Subtract Hours ' + this.displayName()); }\n /** Subtract `n` minutes from this timestamp. */\n subtractMinutes(n: number): DateArithmeticOperation { return new DateArithmeticOperation(this.cwj(), n, DatePart.MINUTE, false, 'Subtract Minutes ' + this.displayName()); }\n /** Subtract `n` seconds from this timestamp. */\n subtractSeconds(n: number): DateArithmeticOperation { return new DateArithmeticOperation(this.cwj(), n, DatePart.SECOND, false, 'Subtract Seconds ' + this.displayName()); }\n\n /** Number of whole days between this timestamp and `other`. */\n diffDays(other: Date): DateDiffOperation { return new DateDiffOperation(this.cwj(), other, DatePart.DAY, 'Diff Days ' + this.displayName()); }\n /** Number of whole months between this timestamp and `other`. */\n diffMonths(other: Date): DateDiffOperation { return new DateDiffOperation(this.cwj(), other, DatePart.MONTH, 'Diff Months ' + this.displayName()); }\n /** Number of whole years between this timestamp and `other`. */\n diffYears(other: Date): DateDiffOperation { return new DateDiffOperation(this.cwj(), other, DatePart.YEAR, 'Diff Years ' + this.displayName()); }\n /** Number of whole hours between this timestamp and `other`. */\n diffHours(other: Date): DateDiffOperation { return new DateDiffOperation(this.cwj(), other, DatePart.HOUR, 'Diff Hours ' + this.displayName()); }\n /** Number of whole minutes between this timestamp and `other`. */\n diffMinutes(other: Date): DateDiffOperation { return new DateDiffOperation(this.cwj(), other, DatePart.MINUTE, 'Diff Minutes ' + this.displayName()); }\n /** Number of whole seconds between this timestamp and `other`. */\n diffSeconds(other: Date): DateDiffOperation { return new DateDiffOperation(this.cwj(), other, DatePart.SECOND, 'Diff Seconds ' + this.displayName()); }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAuBO,IAAM,kBAAN,cAA8B,UAAU;AAAA,EAC7C,YACE,aACA,YACA,cACA,OACA,QACA,UACA;AAAE,UAAM,aAAa,YAAY,cAAc,OAAO,QAAQ,QAAQ;AAAA,EAAG;AAAA;AAAA,EAG3E,cAAuC;AACrC,WAAO,IAAI,wBAAwB,KAAK,IAAI,wBAAyB,WAAW,KAAK,YAAY,CAAC;AAAA,EACpG;AAAA;AAAA,EAEA,cAAuC;AACrC,WAAO,IAAI,wBAAwB,KAAK,IAAI,wBAAyB,WAAW,KAAK,YAAY,CAAC;AAAA,EACpG;AAAA;AAAA,EAEA,OAAgC;AAC9B,WAAO,IAAI,wBAAwB,KAAK,IAAI,sBAAwB,UAAU,KAAK,YAAY,CAAC;AAAA,EAClG;AAAA;AAAA,EAEA,YAAqC;AACnC,WAAO,IAAI,wBAAwB,KAAK,IAAI,wBAAyB,gBAAgB,KAAK,YAAY,CAAC;AAAA,EACzG;AAAA;AAAA,EAEA,UAAmC;AACjC,WAAO,IAAI,wBAAwB,KAAK,IAAI,wBAAyB,cAAc,KAAK,YAAY,CAAC;AAAA,EACvG;AAAA;AAAA,EAEA,SAAkC;AAChC,WAAO,IAAI,wBAA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IAAI,wBAAwB,KAAK,IAAI,GAAG,0BAAoB,OAAO,sBAAsB,KAAK,YAAY,CAAC;AAAA,EAAG;AAAA;AAAA,EAE3K,gBAAgB,GAAoC;AAAE,WAAO,IAAI,wBAAwB,KAAK,IAAI,GAAG,0BAAoB,OAAO,sBAAsB,KAAK,YAAY,CAAC;AAAA,EAAG;AAAA;AAAA,EAG3K,SAAS,OAAgC;AAAE,WAAO,IAAI,kBAAkB,KAAK,IAAI,GAAG,wBAAqB,eAAe,KAAK,YAAY,CAAC;AAAA,EAAG;AAAA;AAAA,EAE7I,WAAW,OAAgC;AAAE,WAAO,IAAI,kBAAkB,KAAK,IAAI,GAAG,4BAAuB,iBAAiB,KAAK,YAAY,CAAC;AAAA,EAAG;AAAA;AAAA,EAEnJ,UAAU,OAAgC;AAAE,WAAO,IAAI,kBAAkB,KAAK,IAAI,GAAG,0BAAsB,gBAAgB,KAAK,YAAY,CAAC;AAAA,EAAG;AAAA;AAAA,EAEhJ,UAAU,OAAgC;AAAE,WAAO,IAAI,kBAAkB,KAAK,IAAI,GAAG,0BAAsB,gBAAgB,KAAK,YAAY,CAAC;AAAA,EAAG;AAAA;AAAA,EAEhJ,YAAY,OAAgC;AAAE,WAAO,IAAI,kBAAkB,KAAK,IAAI,GAAG,8BAAwB,kBAAkB,KAAK,YAAY,CAAC;AAAA,EAAG;AAAA;AAAA,EAEtJ,YAAY,OAAgC;AAAE,WAAO,IAAI,kBAAkB,KAAK,IAAI,GAAG,8BAAwB,kBAAkB,KAAK,YAAY,CAAC;AAAA,EAAG;AACxJ;","names":[]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/datafinder/runner.ts"],"sourcesContent":["import { Attribute } from './attribute';\nimport { toSql } from './sql-generator';\nimport {\n Table,\n Operation,\n SortOperation,\n NoOperation,\n RelationalOperationElement,\n} from '../model/relational';\n\nexport type Row = unknown[];\n\nexport const DEFAULT_TIMEOUT_MS = 60_000;\n\n/** Thrown by a QueryRunner when a query runs longer than the timeout set on its FinderResult. */\nexport class QueryTimeoutError extends Error {\n constructor(readonly timeoutMs: number) {\n super(`Query exceeded ${timeoutMs}ms timeout`);\n this.name = 'QueryTimeoutError';\n }\n}\n\n/** Minimum interface satisfied by both Table (SQL) and GraphQLQuery (GraphQL). */\nexport interface QueryTarget {\n readonly name: string;\n}\n\nexport interface QueryRunner {\n select(\n businessDate: Date | null,\n processingDatetime: Date | null,\n columns: (Attribute | RelationalOperationElement)[],\n table: QueryTarget,\n op: RelationalOperationElement,\n orderBy?: SortOperation[],\n groupBy?: Attribute[],\n limit?: number,\n timeoutMs?: number,\n businessDateTo?: Date | null,\n ): Promise<Row[]>;\n}\n\nlet _runner: QueryRunner | null = null;\n\nexport function registerRunner(runner: QueryRunner): void { _runner = runner; }\nexport function clearRunner(): void { _runner = null; }\nexport function getRunner(): QueryRunner {\n if (!_runner) throw new Error('No query runner registered. Call registerRunner() first.');\n return _runner;\n}\n\nexport class FinderResult {\n private _orderBy: SortOperation[] = [];\n private _groupBy: Attribute[] = [];\n private _limit?: number;\n private _timeoutMs: number = DEFAULT_TIMEOUT_MS;\n\n constructor(\n private readonly _businessDate: Date | null,\n private readonly _processingDatetime: Date | null,\n private readonly _columns: (Attribute | RelationalOperationElement)[],\n private readonly _table: QueryTarget,\n private readonly _op: RelationalOperationElement,\n private readonly _businessDateTo: Date | null = null,\n ) {}\n\n orderByOp(...sorts: SortOperation[]): this {\n this._orderBy = sorts;\n return this;\n }\n\n groupByOp(...attrs: Attribute[]): this {\n this._groupBy = attrs;\n return this;\n }\n\n limit(n: number): this {\n this._limit = n;\n return this;\n }\n\n /** Abort the query and throw QueryTimeoutError if it runs longer than `milliseconds` (default 60000). */\n timeout(milliseconds: number): this {\n this._timeoutMs = milliseconds;\n return this;\n }\n\n toSql(): string {\n return toSql(\n this._businessDate,\n this._processingDatetime,\n this._columns,\n this._table as Table,\n this._op,\n this._orderBy,\n this._groupBy,\n this._limit,\n this._businessDateTo,\n );\n }\n\n async toRows(): Promise<Row[]> {\n return getRunner().select(\n this._businessDate,\n this._processingDatetime,\n this._columns,\n this._table,\n this._op,\n this._orderBy,\n this._groupBy,\n this._limit,\n this._timeoutMs,\n this._businessDateTo,\n );\n }\n}\n\nfunction convertDate(value: Date | string | null): Date | null {\n if (value === null) return null;\n if (value instanceof Date) return value;\n // Zone-less strings (YYYY-MM-DD, or YYYY-MM-DD HH:MM[:SS]) are read as UTC, matching how\n // dates are formatted into SQL, so the value doesn't shift with the machine's timezone.\n let normalized = value;\n if (/^\\d{4}-\\d{2}-\\d{2}$/.test(value)) normalized = value + 'T00:00:00Z';\n else if (/^\\d{4}-\\d{2}-\\d{2}[ T]\\d{2}:\\d{2}(:\\d{2}(\\.\\d+)?)?$/.test(value)) normalized = value.replace(' ', 'T') + 'Z';\n const d = new Date(normalized);\n if (isNaN(d.getTime())) throw new Error(`Cannot parse date: ${value}`);\n return d;\n}\n\nexport function convertInputsAndSelect(\n businessDate: Date | string | null,\n processingDatetime: Date | string | null,\n columns: (Attribute | RelationalOperationElement)[],\n table: QueryTarget,\n op: RelationalOperationElement = new NoOperation(),\n): FinderResult {\n return new FinderResult(\n convertDate(businessDate),\n convertDate(processingDatetime),\n columns,\n table,\n op,\n );\n}\n\nexport function convertInputsAndSelectForDateRange(\n businessDateFrom: Date | string,\n businessDateTo: Date | string,\n processingDatetime: Date | string,\n columns: (Attribute | RelationalOperationElement)[],\n table: QueryTarget,\n op: RelationalOperationElement = new NoOperation(),\n): FinderResult {\n if (businessDateFrom == null) throw new Error('businessDateFrom is required for findForDateRange');\n if (businessDateTo == null) throw new Error('businessDateTo is required for findForDateRange');\n if (processingDatetime == null) throw new Error('processingValidAt is required for findForDateRange');\n return new FinderResult(\n convertDate(businessDateFrom),\n convertDate(processingDatetime),\n columns,\n table,\n op,\n convertDate(businessDateTo),\n );\n}\n"],"mappings":";;;;;;;;AAYO,IAAM,qBAAqB;AAG3B,IAAM,oBAAN,cAAgC,MAAM;AAAA,EAC3C,YAAqB,WAAmB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