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
@@ -1,242 +1,3 @@
1
- import { Attribute } from './attribute.cjs';
2
- import { JoinTreeNodeOperation, Operation, DateExtractOperation, DateArithmeticOperation, DateDiffOperation, AggregateOperation, ScalarFunctionOperation } from '../model/relational.cjs';
3
-
4
- declare class StringAttribute extends Attribute {
5
- constructor(displayName: string, columnName: string, columnDbType: string, owner: string, parent?: JoinTreeNodeOperation, embedded?: Attribute);
6
- /** Convert every character to uppercase. */
7
- toUpperCase(): ScalarFunctionOperation;
8
- /** Convert every character to lowercase. */
9
- toLowerCase(): ScalarFunctionOperation;
10
- /** Remove leading and trailing whitespace. */
11
- trim(): ScalarFunctionOperation;
12
- /** Remove leading whitespace. */
13
- trimStart(): ScalarFunctionOperation;
14
- /** Remove trailing whitespace. */
15
- trimEnd(): ScalarFunctionOperation;
16
- /** Return the number of characters in the string. */
17
- length(): ScalarFunctionOperation;
18
- /** Return the string with characters in reverse order. */
19
- reverse(): ScalarFunctionOperation;
20
- /** Return the first `n` characters. */
21
- left(n: number): ScalarFunctionOperation;
22
- /** Return the last `n` characters. */
23
- right(n: number): ScalarFunctionOperation;
24
- /** Return the string repeated `n` times. */
25
- repeat(n: number): ScalarFunctionOperation;
26
- /** Replace all occurrences of `fromStr` with `toStr`. */
27
- replace(fromStr: string, toStr: string): ScalarFunctionOperation;
28
- /**
29
- * Extract a portion of the string.
30
- * `start` is zero-based (following Python convention); `length` is optional.
31
- */
32
- substring(start: number, length?: number): ScalarFunctionOperation;
33
- /** Filter to rows where this attribute equals `value`. */
34
- eq(value: string): Operation;
35
- /** Filter to rows where this attribute does not equal `value`. */
36
- ne(value: string): Operation;
37
- /** Filter to rows where this attribute contains `value` as a substring. */
38
- contains(value: string): Operation;
39
- /** Filter to rows where this attribute begins with `prefix`. */
40
- startsWith(prefix: string): Operation;
41
- /** Filter to rows where this attribute ends with `suffix`. */
42
- endsWith(suffix: string): Operation;
43
- /** Filter to rows where this attribute does not contain `value` as a substring. */
44
- notContains(value: string): Operation;
45
- }
46
- declare abstract class NumericAttribute extends Attribute {
47
- constructor(displayName: string, columnName: string, columnDbType: string, owner: string, parent?: JoinTreeNodeOperation, embedded?: Attribute);
48
- /** Sum of all values in the group. */
49
- sum(): AggregateOperation;
50
- /** Smallest value in the group. */
51
- min(): AggregateOperation;
52
- /** Largest value in the group. */
53
- max(): AggregateOperation;
54
- /** Arithmetic mean of all values in the group. */
55
- average(): AggregateOperation;
56
- /** Absolute value (distance from zero, always non-negative). */
57
- abs(): ScalarFunctionOperation;
58
- /** Round up to the nearest integer. */
59
- ceil(): ScalarFunctionOperation;
60
- /** Round down to the nearest integer. */
61
- floor(): ScalarFunctionOperation;
62
- /** Square root. */
63
- sqrt(): ScalarFunctionOperation;
64
- /** Remainder after dividing by `n`. */
65
- mod(n: number): ScalarFunctionOperation;
66
- /** Raise to the power of `n`. */
67
- power(n: number): ScalarFunctionOperation;
68
- /** Round to `d` decimal places, or to the nearest integer when `d` is omitted. */
69
- round(d?: number): ScalarFunctionOperation;
70
- }
71
- declare class DoubleAttribute extends NumericAttribute {
72
- constructor(displayName: string, columnName: string, columnDbType: string, owner: string, parent?: JoinTreeNodeOperation, embedded?: Attribute);
73
- /** Filter to rows where this attribute equals `value`. */
74
- eq(value: number): Operation;
75
- /** Filter to rows where this attribute does not equal `value`. */
76
- ne(value: number): Operation;
77
- /** Filter to rows where this attribute is greater than `value`. */
78
- gt(value: number): Operation;
79
- /** Filter to rows where this attribute is less than `value`. */
80
- lt(value: number): Operation;
81
- /** Filter to rows where this attribute is greater than or equal to `value`. */
82
- gte(value: number): Operation;
83
- /** Filter to rows where this attribute is less than or equal to `value`. */
84
- lte(value: number): Operation;
85
- }
86
- declare const FloatAttribute: typeof DoubleAttribute;
87
- type FloatAttribute = DoubleAttribute;
88
- declare class DecimalAttribute extends NumericAttribute {
89
- constructor(displayName: string, columnName: string, columnDbType: string, owner: string, parent?: JoinTreeNodeOperation, embedded?: Attribute);
90
- /** Filter to rows where this attribute equals `value`. */
91
- eq(value: number): Operation;
92
- /** Filter to rows where this attribute does not equal `value`. */
93
- ne(value: number): Operation;
94
- /** Filter to rows where this attribute is greater than `value`. */
95
- gt(value: number): Operation;
96
- /** Filter to rows where this attribute is less than `value`. */
97
- lt(value: number): Operation;
98
- /** Filter to rows where this attribute is greater than or equal to `value`. */
99
- gte(value: number): Operation;
100
- /** Filter to rows where this attribute is less than or equal to `value`. */
101
- lte(value: number): Operation;
102
- }
103
- declare class IntegerAttribute extends NumericAttribute {
104
- constructor(displayName: string, columnName: string, columnDbType: string, owner: string, parent?: JoinTreeNodeOperation, embedded?: Attribute);
105
- /** Filter to rows where this attribute equals `value`. */
106
- eq(value: number): Operation;
107
- /** Filter to rows where this attribute does not equal `value`. */
108
- ne(value: number): Operation;
109
- /** Filter to rows where this attribute is greater than `value`. */
110
- gt(value: number): Operation;
111
- /** Filter to rows where this attribute is less than `value`. */
112
- lt(value: number): Operation;
113
- /** Filter to rows where this attribute is greater than or equal to `value`. */
114
- gte(value: number): Operation;
115
- /** Filter to rows where this attribute is less than or equal to `value`. */
116
- lte(value: number): Operation;
117
- }
118
- declare class BooleanAttribute extends Attribute {
119
- constructor(displayName: string, columnName: string, columnDbType: string, owner: string, parent?: JoinTreeNodeOperation, embedded?: Attribute);
120
- /** Filter to rows where this attribute equals `value`. */
121
- eq(value: boolean): Operation;
122
- /** Filter to rows where this attribute is true. */
123
- isTrue(): Operation;
124
- /** Filter to rows where this attribute is false. */
125
- isFalse(): Operation;
126
- }
127
- declare class DateAttribute extends Attribute {
128
- constructor(displayName: string, columnName: string, columnDbType: string, owner: string, parent?: JoinTreeNodeOperation, embedded?: Attribute);
129
- /** Filter to rows where this date equals `value`. */
130
- eq(value: Date | string): Operation;
131
- /** Filter to rows where this date does not equal `value`. */
132
- ne(value: Date | string): Operation;
133
- /** Filter to rows where this date is after `value`. */
134
- gt(value: Date | string): Operation;
135
- /** Filter to rows where this date is before `value`. */
136
- lt(value: Date | string): Operation;
137
- /** Filter to rows where this date is on or after `value`. */
138
- gte(value: Date | string): Operation;
139
- /** Filter to rows where this date is on or before `value`. */
140
- lte(value: Date | string): Operation;
141
- /** Extract the four-digit calendar year. */
142
- year(): DateExtractOperation;
143
- /** Extract the month number (1–12). */
144
- month(): DateExtractOperation;
145
- /** Extract the day of the month (1–31). */
146
- day(): DateExtractOperation;
147
- /** Extract the quarter (1–4). */
148
- quarter(): DateExtractOperation;
149
- /** Extract the ISO week number (1–53). */
150
- week(): DateExtractOperation;
151
- /** Extract the day of the week (0 = Sunday through 6 = Saturday). */
152
- dayOfWeek(): DateExtractOperation;
153
- /** Add `n` days to this date. */
154
- addDays(n: number): DateArithmeticOperation;
155
- /** Add `n` months to this date. */
156
- addMonths(n: number): DateArithmeticOperation;
157
- /** Add `n` years to this date. */
158
- addYears(n: number): DateArithmeticOperation;
159
- /** Subtract `n` days from this date. */
160
- subtractDays(n: number): DateArithmeticOperation;
161
- /** Subtract `n` months from this date. */
162
- subtractMonths(n: number): DateArithmeticOperation;
163
- /** Subtract `n` years from this date. */
164
- subtractYears(n: number): DateArithmeticOperation;
165
- /** Number of whole days between this date and `other`. */
166
- diffDays(other: Date): DateDiffOperation;
167
- /** Number of whole months between this date and `other`. */
168
- diffMonths(other: Date): DateDiffOperation;
169
- /** Number of whole years between this date and `other`. */
170
- diffYears(other: Date): DateDiffOperation;
171
- }
172
- declare class DateTimeAttribute extends Attribute {
173
- constructor(displayName: string, columnName: string, columnDbType: string, owner: string, parent?: JoinTreeNodeOperation, embedded?: Attribute);
174
- /** Filter to rows where this timestamp equals `value`. */
175
- eq(value: Date | string): Operation;
176
- /** Filter to rows where this timestamp does not equal `value`. */
177
- ne(value: Date | string): Operation;
178
- /** Filter to rows where this timestamp is after `value`. */
179
- gt(value: Date | string): Operation;
180
- /** Filter to rows where this timestamp is before `value`. */
181
- lt(value: Date | string): Operation;
182
- /** Filter to rows where this timestamp is on or after `value`. */
183
- gte(value: Date | string): Operation;
184
- /** Filter to rows where this timestamp is on or before `value`. */
185
- lte(value: Date | string): Operation;
186
- /** Extract the four-digit calendar year. */
187
- year(): DateExtractOperation;
188
- /** Extract the month number (1–12). */
189
- month(): DateExtractOperation;
190
- /** Extract the day of the month (1–31). */
191
- day(): DateExtractOperation;
192
- /** Extract the hour (0–23). */
193
- hour(): DateExtractOperation;
194
- /** Extract the minute (0–59). */
195
- minute(): DateExtractOperation;
196
- /** Extract the second (0–59). */
197
- second(): DateExtractOperation;
198
- /** Extract the quarter (1–4). */
199
- quarter(): DateExtractOperation;
200
- /** Extract the ISO week number (1–53). */
201
- week(): DateExtractOperation;
202
- /** Extract the day of the week (0 = Sunday through 6 = Saturday). */
203
- dayOfWeek(): DateExtractOperation;
204
- /** Add `n` days to this timestamp. */
205
- addDays(n: number): DateArithmeticOperation;
206
- /** Add `n` months to this timestamp. */
207
- addMonths(n: number): DateArithmeticOperation;
208
- /** Add `n` years to this timestamp. */
209
- addYears(n: number): DateArithmeticOperation;
210
- /** Add `n` hours to this timestamp. */
211
- addHours(n: number): DateArithmeticOperation;
212
- /** Add `n` minutes to this timestamp. */
213
- addMinutes(n: number): DateArithmeticOperation;
214
- /** Add `n` seconds to this timestamp. */
215
- addSeconds(n: number): DateArithmeticOperation;
216
- /** Subtract `n` days from this timestamp. */
217
- subtractDays(n: number): DateArithmeticOperation;
218
- /** Subtract `n` months from this timestamp. */
219
- subtractMonths(n: number): DateArithmeticOperation;
220
- /** Subtract `n` years from this timestamp. */
221
- subtractYears(n: number): DateArithmeticOperation;
222
- /** Subtract `n` hours from this timestamp. */
223
- subtractHours(n: number): DateArithmeticOperation;
224
- /** Subtract `n` minutes from this timestamp. */
225
- subtractMinutes(n: number): DateArithmeticOperation;
226
- /** Subtract `n` seconds from this timestamp. */
227
- subtractSeconds(n: number): DateArithmeticOperation;
228
- /** Number of whole days between this timestamp and `other`. */
229
- diffDays(other: Date): DateDiffOperation;
230
- /** Number of whole months between this timestamp and `other`. */
231
- diffMonths(other: Date): DateDiffOperation;
232
- /** Number of whole years between this timestamp and `other`. */
233
- diffYears(other: Date): DateDiffOperation;
234
- /** Number of whole hours between this timestamp and `other`. */
235
- diffHours(other: Date): DateDiffOperation;
236
- /** Number of whole minutes between this timestamp and `other`. */
237
- diffMinutes(other: Date): DateDiffOperation;
238
- /** Number of whole seconds between this timestamp and `other`. */
239
- diffSeconds(other: Date): DateDiffOperation;
240
- }
241
-
242
- export { BooleanAttribute, DateAttribute, DateTimeAttribute, DecimalAttribute, DoubleAttribute, FloatAttribute, IntegerAttribute, NumericAttribute, StringAttribute };
1
+ import './attribute.cjs';
2
+ export { B as BooleanAttribute, D as DateAttribute, a as DateTimeAttribute, b as DecimalAttribute, c as DoubleAttribute, F as FloatAttribute, I as IntegerAttribute, N as NumericAttribute, S as StringAttribute } from '../typed-attributes-CdWXq_78.cjs';
3
+ import '../model/relational.cjs';
@@ -1,242 +1,3 @@
1
- import { Attribute } from './attribute.js';
2
- import { JoinTreeNodeOperation, Operation, DateExtractOperation, DateArithmeticOperation, DateDiffOperation, AggregateOperation, ScalarFunctionOperation } from '../model/relational.js';
3
-
4
- declare class StringAttribute extends Attribute {
5
- constructor(displayName: string, columnName: string, columnDbType: string, owner: string, parent?: JoinTreeNodeOperation, embedded?: Attribute);
6
- /** Convert every character to uppercase. */
7
- toUpperCase(): ScalarFunctionOperation;
8
- /** Convert every character to lowercase. */
9
- toLowerCase(): ScalarFunctionOperation;
10
- /** Remove leading and trailing whitespace. */
11
- trim(): ScalarFunctionOperation;
12
- /** Remove leading whitespace. */
13
- trimStart(): ScalarFunctionOperation;
14
- /** Remove trailing whitespace. */
15
- trimEnd(): ScalarFunctionOperation;
16
- /** Return the number of characters in the string. */
17
- length(): ScalarFunctionOperation;
18
- /** Return the string with characters in reverse order. */
19
- reverse(): ScalarFunctionOperation;
20
- /** Return the first `n` characters. */
21
- left(n: number): ScalarFunctionOperation;
22
- /** Return the last `n` characters. */
23
- right(n: number): ScalarFunctionOperation;
24
- /** Return the string repeated `n` times. */
25
- repeat(n: number): ScalarFunctionOperation;
26
- /** Replace all occurrences of `fromStr` with `toStr`. */
27
- replace(fromStr: string, toStr: string): ScalarFunctionOperation;
28
- /**
29
- * Extract a portion of the string.
30
- * `start` is zero-based (following Python convention); `length` is optional.
31
- */
32
- substring(start: number, length?: number): ScalarFunctionOperation;
33
- /** Filter to rows where this attribute equals `value`. */
34
- eq(value: string): Operation;
35
- /** Filter to rows where this attribute does not equal `value`. */
36
- ne(value: string): Operation;
37
- /** Filter to rows where this attribute contains `value` as a substring. */
38
- contains(value: string): Operation;
39
- /** Filter to rows where this attribute begins with `prefix`. */
40
- startsWith(prefix: string): Operation;
41
- /** Filter to rows where this attribute ends with `suffix`. */
42
- endsWith(suffix: string): Operation;
43
- /** Filter to rows where this attribute does not contain `value` as a substring. */
44
- notContains(value: string): Operation;
45
- }
46
- declare abstract class NumericAttribute extends Attribute {
47
- constructor(displayName: string, columnName: string, columnDbType: string, owner: string, parent?: JoinTreeNodeOperation, embedded?: Attribute);
48
- /** Sum of all values in the group. */
49
- sum(): AggregateOperation;
50
- /** Smallest value in the group. */
51
- min(): AggregateOperation;
52
- /** Largest value in the group. */
53
- max(): AggregateOperation;
54
- /** Arithmetic mean of all values in the group. */
55
- average(): AggregateOperation;
56
- /** Absolute value (distance from zero, always non-negative). */
57
- abs(): ScalarFunctionOperation;
58
- /** Round up to the nearest integer. */
59
- ceil(): ScalarFunctionOperation;
60
- /** Round down to the nearest integer. */
61
- floor(): ScalarFunctionOperation;
62
- /** Square root. */
63
- sqrt(): ScalarFunctionOperation;
64
- /** Remainder after dividing by `n`. */
65
- mod(n: number): ScalarFunctionOperation;
66
- /** Raise to the power of `n`. */
67
- power(n: number): ScalarFunctionOperation;
68
- /** Round to `d` decimal places, or to the nearest integer when `d` is omitted. */
69
- round(d?: number): ScalarFunctionOperation;
70
- }
71
- declare class DoubleAttribute extends NumericAttribute {
72
- constructor(displayName: string, columnName: string, columnDbType: string, owner: string, parent?: JoinTreeNodeOperation, embedded?: Attribute);
73
- /** Filter to rows where this attribute equals `value`. */
74
- eq(value: number): Operation;
75
- /** Filter to rows where this attribute does not equal `value`. */
76
- ne(value: number): Operation;
77
- /** Filter to rows where this attribute is greater than `value`. */
78
- gt(value: number): Operation;
79
- /** Filter to rows where this attribute is less than `value`. */
80
- lt(value: number): Operation;
81
- /** Filter to rows where this attribute is greater than or equal to `value`. */
82
- gte(value: number): Operation;
83
- /** Filter to rows where this attribute is less than or equal to `value`. */
84
- lte(value: number): Operation;
85
- }
86
- declare const FloatAttribute: typeof DoubleAttribute;
87
- type FloatAttribute = DoubleAttribute;
88
- declare class DecimalAttribute extends NumericAttribute {
89
- constructor(displayName: string, columnName: string, columnDbType: string, owner: string, parent?: JoinTreeNodeOperation, embedded?: Attribute);
90
- /** Filter to rows where this attribute equals `value`. */
91
- eq(value: number): Operation;
92
- /** Filter to rows where this attribute does not equal `value`. */
93
- ne(value: number): Operation;
94
- /** Filter to rows where this attribute is greater than `value`. */
95
- gt(value: number): Operation;
96
- /** Filter to rows where this attribute is less than `value`. */
97
- lt(value: number): Operation;
98
- /** Filter to rows where this attribute is greater than or equal to `value`. */
99
- gte(value: number): Operation;
100
- /** Filter to rows where this attribute is less than or equal to `value`. */
101
- lte(value: number): Operation;
102
- }
103
- declare class IntegerAttribute extends NumericAttribute {
104
- constructor(displayName: string, columnName: string, columnDbType: string, owner: string, parent?: JoinTreeNodeOperation, embedded?: Attribute);
105
- /** Filter to rows where this attribute equals `value`. */
106
- eq(value: number): Operation;
107
- /** Filter to rows where this attribute does not equal `value`. */
108
- ne(value: number): Operation;
109
- /** Filter to rows where this attribute is greater than `value`. */
110
- gt(value: number): Operation;
111
- /** Filter to rows where this attribute is less than `value`. */
112
- lt(value: number): Operation;
113
- /** Filter to rows where this attribute is greater than or equal to `value`. */
114
- gte(value: number): Operation;
115
- /** Filter to rows where this attribute is less than or equal to `value`. */
116
- lte(value: number): Operation;
117
- }
118
- declare class BooleanAttribute extends Attribute {
119
- constructor(displayName: string, columnName: string, columnDbType: string, owner: string, parent?: JoinTreeNodeOperation, embedded?: Attribute);
120
- /** Filter to rows where this attribute equals `value`. */
121
- eq(value: boolean): Operation;
122
- /** Filter to rows where this attribute is true. */
123
- isTrue(): Operation;
124
- /** Filter to rows where this attribute is false. */
125
- isFalse(): Operation;
126
- }
127
- declare class DateAttribute extends Attribute {
128
- constructor(displayName: string, columnName: string, columnDbType: string, owner: string, parent?: JoinTreeNodeOperation, embedded?: Attribute);
129
- /** Filter to rows where this date equals `value`. */
130
- eq(value: Date | string): Operation;
131
- /** Filter to rows where this date does not equal `value`. */
132
- ne(value: Date | string): Operation;
133
- /** Filter to rows where this date is after `value`. */
134
- gt(value: Date | string): Operation;
135
- /** Filter to rows where this date is before `value`. */
136
- lt(value: Date | string): Operation;
137
- /** Filter to rows where this date is on or after `value`. */
138
- gte(value: Date | string): Operation;
139
- /** Filter to rows where this date is on or before `value`. */
140
- lte(value: Date | string): Operation;
141
- /** Extract the four-digit calendar year. */
142
- year(): DateExtractOperation;
143
- /** Extract the month number (1–12). */
144
- month(): DateExtractOperation;
145
- /** Extract the day of the month (1–31). */
146
- day(): DateExtractOperation;
147
- /** Extract the quarter (1–4). */
148
- quarter(): DateExtractOperation;
149
- /** Extract the ISO week number (1–53). */
150
- week(): DateExtractOperation;
151
- /** Extract the day of the week (0 = Sunday through 6 = Saturday). */
152
- dayOfWeek(): DateExtractOperation;
153
- /** Add `n` days to this date. */
154
- addDays(n: number): DateArithmeticOperation;
155
- /** Add `n` months to this date. */
156
- addMonths(n: number): DateArithmeticOperation;
157
- /** Add `n` years to this date. */
158
- addYears(n: number): DateArithmeticOperation;
159
- /** Subtract `n` days from this date. */
160
- subtractDays(n: number): DateArithmeticOperation;
161
- /** Subtract `n` months from this date. */
162
- subtractMonths(n: number): DateArithmeticOperation;
163
- /** Subtract `n` years from this date. */
164
- subtractYears(n: number): DateArithmeticOperation;
165
- /** Number of whole days between this date and `other`. */
166
- diffDays(other: Date): DateDiffOperation;
167
- /** Number of whole months between this date and `other`. */
168
- diffMonths(other: Date): DateDiffOperation;
169
- /** Number of whole years between this date and `other`. */
170
- diffYears(other: Date): DateDiffOperation;
171
- }
172
- declare class DateTimeAttribute extends Attribute {
173
- constructor(displayName: string, columnName: string, columnDbType: string, owner: string, parent?: JoinTreeNodeOperation, embedded?: Attribute);
174
- /** Filter to rows where this timestamp equals `value`. */
175
- eq(value: Date | string): Operation;
176
- /** Filter to rows where this timestamp does not equal `value`. */
177
- ne(value: Date | string): Operation;
178
- /** Filter to rows where this timestamp is after `value`. */
179
- gt(value: Date | string): Operation;
180
- /** Filter to rows where this timestamp is before `value`. */
181
- lt(value: Date | string): Operation;
182
- /** Filter to rows where this timestamp is on or after `value`. */
183
- gte(value: Date | string): Operation;
184
- /** Filter to rows where this timestamp is on or before `value`. */
185
- lte(value: Date | string): Operation;
186
- /** Extract the four-digit calendar year. */
187
- year(): DateExtractOperation;
188
- /** Extract the month number (1–12). */
189
- month(): DateExtractOperation;
190
- /** Extract the day of the month (1–31). */
191
- day(): DateExtractOperation;
192
- /** Extract the hour (0–23). */
193
- hour(): DateExtractOperation;
194
- /** Extract the minute (0–59). */
195
- minute(): DateExtractOperation;
196
- /** Extract the second (0–59). */
197
- second(): DateExtractOperation;
198
- /** Extract the quarter (1–4). */
199
- quarter(): DateExtractOperation;
200
- /** Extract the ISO week number (1–53). */
201
- week(): DateExtractOperation;
202
- /** Extract the day of the week (0 = Sunday through 6 = Saturday). */
203
- dayOfWeek(): DateExtractOperation;
204
- /** Add `n` days to this timestamp. */
205
- addDays(n: number): DateArithmeticOperation;
206
- /** Add `n` months to this timestamp. */
207
- addMonths(n: number): DateArithmeticOperation;
208
- /** Add `n` years to this timestamp. */
209
- addYears(n: number): DateArithmeticOperation;
210
- /** Add `n` hours to this timestamp. */
211
- addHours(n: number): DateArithmeticOperation;
212
- /** Add `n` minutes to this timestamp. */
213
- addMinutes(n: number): DateArithmeticOperation;
214
- /** Add `n` seconds to this timestamp. */
215
- addSeconds(n: number): DateArithmeticOperation;
216
- /** Subtract `n` days from this timestamp. */
217
- subtractDays(n: number): DateArithmeticOperation;
218
- /** Subtract `n` months from this timestamp. */
219
- subtractMonths(n: number): DateArithmeticOperation;
220
- /** Subtract `n` years from this timestamp. */
221
- subtractYears(n: number): DateArithmeticOperation;
222
- /** Subtract `n` hours from this timestamp. */
223
- subtractHours(n: number): DateArithmeticOperation;
224
- /** Subtract `n` minutes from this timestamp. */
225
- subtractMinutes(n: number): DateArithmeticOperation;
226
- /** Subtract `n` seconds from this timestamp. */
227
- subtractSeconds(n: number): DateArithmeticOperation;
228
- /** Number of whole days between this timestamp and `other`. */
229
- diffDays(other: Date): DateDiffOperation;
230
- /** Number of whole months between this timestamp and `other`. */
231
- diffMonths(other: Date): DateDiffOperation;
232
- /** Number of whole years between this timestamp and `other`. */
233
- diffYears(other: Date): DateDiffOperation;
234
- /** Number of whole hours between this timestamp and `other`. */
235
- diffHours(other: Date): DateDiffOperation;
236
- /** Number of whole minutes between this timestamp and `other`. */
237
- diffMinutes(other: Date): DateDiffOperation;
238
- /** Number of whole seconds between this timestamp and `other`. */
239
- diffSeconds(other: Date): DateDiffOperation;
240
- }
241
-
242
- export { BooleanAttribute, DateAttribute, DateTimeAttribute, DecimalAttribute, DoubleAttribute, FloatAttribute, IntegerAttribute, NumericAttribute, StringAttribute };
1
+ import './attribute.js';
2
+ export { B as BooleanAttribute, D as DateAttribute, a as DateTimeAttribute, b as DecimalAttribute, c as DoubleAttribute, F as FloatAttribute, I as IntegerAttribute, N as NumericAttribute, S as StringAttribute } from '../typed-attributes-CUTf_6Ru.js';
3
+ import '../model/relational.js';
@@ -8,9 +8,9 @@ import {
8
8
  IntegerAttribute,
9
9
  NumericAttribute,
10
10
  StringAttribute
11
- } from "../chunk-4LNZV6EN.js";
12
- import "../chunk-4JVW4TAB.js";
13
- import "../chunk-UYMOE6YU.js";
11
+ } from "../chunk-MGEL5RWM.js";
12
+ import "../chunk-BGEX377Q.js";
13
+ import "../chunk-PF6EJZHB.js";
14
14
  export {
15
15
  BooleanAttribute,
16
16
  DateAttribute,
@@ -0,0 +1,38 @@
1
+ import { SortDirection, DatePart } from './model/relational.cjs';
2
+
3
+ /**
4
+ * The SQL a query is written in. The generator writes Postgres by default; a dialect says where another database
5
+ * differs, so the same query can be sent to DuckDB or Databricks.
6
+ *
7
+ * Only what differs is here. Everything the databases share (joins, CASE, window functions, COUNT(DISTINCT), LIKE ...
8
+ * ESCAPE, `||`, typed date literals, `INTERVAL '7' DAY`, ...) is written once by the generator.
9
+ */
10
+
11
+ type DialectName = 'postgres' | 'duckdb' | 'databricks';
12
+ interface SqlDialect {
13
+ readonly name: DialectName;
14
+ /** A name as an identifier, used for the names of the result's columns. */
15
+ quoteIdentifier(name: string): string;
16
+ /** A string as a literal that can never end early, whatever it holds. */
17
+ stringLiteral(value: string): string;
18
+ /**
19
+ * ` ASC` or ` DESC`, with the null placement spelled out where the database's default differs from Postgres
20
+ * (nulls last when ascending, first when descending), so a sort gives the same order everywhere.
21
+ */
22
+ orderDirection(direction: SortDirection): string;
23
+ /** The type a float constant is cast to, so it comes back as a double and not a decimal. */
24
+ readonly doubleType: string;
25
+ /** The day of the week of a date or timestamp, 0 = Sunday through 6 = Saturday. */
26
+ dayOfWeek(expression: string): string;
27
+ /** Whole `unit`s from `from` to `to`; both are SQL expressions. */
28
+ dateDiff(unit: DatePart, from: string, to: string): string;
29
+ /** The values of a group joined with `separator` (an SQL literal), in the order given (each with its direction). */
30
+ stringAgg(expression: string, separator: string, orderBy: string[]): string;
31
+ }
32
+ declare const POSTGRES: SqlDialect;
33
+ declare const DUCKDB: SqlDialect;
34
+ declare const DATABRICKS: SqlDialect;
35
+ /** A dialect by name, or as given. */
36
+ declare function dialectOf(dialect: DialectName | SqlDialect): SqlDialect;
37
+
38
+ export { DATABRICKS as D, POSTGRES as P, type SqlDialect as S, DUCKDB as a, type DialectName as b, dialectOf as d };
@@ -0,0 +1,38 @@
1
+ import { SortDirection, DatePart } from './model/relational.js';
2
+
3
+ /**
4
+ * The SQL a query is written in. The generator writes Postgres by default; a dialect says where another database
5
+ * differs, so the same query can be sent to DuckDB or Databricks.
6
+ *
7
+ * Only what differs is here. Everything the databases share (joins, CASE, window functions, COUNT(DISTINCT), LIKE ...
8
+ * ESCAPE, `||`, typed date literals, `INTERVAL '7' DAY`, ...) is written once by the generator.
9
+ */
10
+
11
+ type DialectName = 'postgres' | 'duckdb' | 'databricks';
12
+ interface SqlDialect {
13
+ readonly name: DialectName;
14
+ /** A name as an identifier, used for the names of the result's columns. */
15
+ quoteIdentifier(name: string): string;
16
+ /** A string as a literal that can never end early, whatever it holds. */
17
+ stringLiteral(value: string): string;
18
+ /**
19
+ * ` ASC` or ` DESC`, with the null placement spelled out where the database's default differs from Postgres
20
+ * (nulls last when ascending, first when descending), so a sort gives the same order everywhere.
21
+ */
22
+ orderDirection(direction: SortDirection): string;
23
+ /** The type a float constant is cast to, so it comes back as a double and not a decimal. */
24
+ readonly doubleType: string;
25
+ /** The day of the week of a date or timestamp, 0 = Sunday through 6 = Saturday. */
26
+ dayOfWeek(expression: string): string;
27
+ /** Whole `unit`s from `from` to `to`; both are SQL expressions. */
28
+ dateDiff(unit: DatePart, from: string, to: string): string;
29
+ /** The values of a group joined with `separator` (an SQL literal), in the order given (each with its direction). */
30
+ stringAgg(expression: string, separator: string, orderBy: string[]): string;
31
+ }
32
+ declare const POSTGRES: SqlDialect;
33
+ declare const DUCKDB: SqlDialect;
34
+ declare const DATABRICKS: SqlDialect;
35
+ /** A dialect by name, or as given. */
36
+ declare function dialectOf(dialect: DialectName | SqlDialect): SqlDialect;
37
+
38
+ export { DATABRICKS as D, POSTGRES as P, type SqlDialect as S, DUCKDB as a, type DialectName as b, dialectOf as d };