data-finder-ts 0.1.3 → 0.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +17 -55
- package/dist/{chunk-V647VNMY.js → chunk-4JVW4TAB.js} +59 -14
- package/dist/chunk-4JVW4TAB.js.map +1 -0
- package/dist/{chunk-5K2Z3YDY.js → chunk-4LNZV6EN.js} +138 -31
- package/dist/chunk-4LNZV6EN.js.map +1 -0
- package/dist/{chunk-6QTCGJWX.js → chunk-FJYA2ASS.js} +46 -8
- package/dist/chunk-FJYA2ASS.js.map +1 -0
- package/dist/{chunk-DFYZVBII.js → chunk-MH4XMYVB.js} +186 -142
- package/dist/chunk-MH4XMYVB.js.map +1 -0
- package/dist/{chunk-EYXBYV2X.js → chunk-PMPLCEWQ.js} +2 -2
- package/dist/{chunk-3SSWFES4.js → chunk-UYMOE6YU.js} +64 -3
- package/dist/chunk-UYMOE6YU.js.map +1 -0
- package/dist/datafinder/attribute.cjs +64 -13
- package/dist/datafinder/attribute.cjs.map +1 -1
- package/dist/datafinder/attribute.d.cts +48 -7
- package/dist/datafinder/attribute.d.ts +48 -7
- package/dist/datafinder/attribute.js +2 -2
- package/dist/datafinder/runner.cjs +389 -140
- package/dist/datafinder/runner.cjs.map +1 -1
- package/dist/datafinder/runner.d.cts +14 -3
- package/dist/datafinder/runner.d.ts +14 -3
- package/dist/datafinder/runner.js +12 -6
- package/dist/datafinder/sql-generator.cjs +344 -138
- package/dist/datafinder/sql-generator.cjs.map +1 -1
- package/dist/datafinder/sql-generator.d.cts +4 -13
- package/dist/datafinder/sql-generator.d.ts +4 -13
- package/dist/datafinder/sql-generator.js +5 -7
- package/dist/datafinder/typed-attributes.cjs +199 -41
- package/dist/datafinder/typed-attributes.cjs.map +1 -1
- package/dist/datafinder/typed-attributes.d.cts +120 -13
- package/dist/datafinder/typed-attributes.d.ts +120 -13
- package/dist/datafinder/typed-attributes.js +3 -3
- package/dist/index.cjs +507 -176
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +16 -15
- package/dist/index.d.ts +16 -15
- package/dist/index.js +49 -9
- package/dist/index.js.map +1 -1
- package/dist/model/milestoning.cjs.map +1 -1
- package/dist/model/milestoning.js +2 -2
- package/dist/model/relational.cjs +66 -1
- package/dist/model/relational.cjs.map +1 -1
- package/dist/model/relational.d.cts +47 -2
- package/dist/model/relational.d.ts +47 -2
- package/dist/model/relational.js +9 -1
- package/package.json +4 -2
- package/dist/chunk-3SSWFES4.js.map +0 -1
- package/dist/chunk-5K2Z3YDY.js.map +0 -1
- package/dist/chunk-6QTCGJWX.js.map +0 -1
- package/dist/chunk-DFYZVBII.js.map +0 -1
- package/dist/chunk-V647VNMY.js.map +0 -1
- /package/dist/{chunk-EYXBYV2X.js.map → chunk-PMPLCEWQ.js.map} +0 -0
|
@@ -2,133 +2,240 @@ import { Attribute } from './attribute.js';
|
|
|
2
2
|
import { JoinTreeNodeOperation, Operation, DateExtractOperation, DateArithmeticOperation, DateDiffOperation, AggregateOperation, ScalarFunctionOperation } from '../model/relational.js';
|
|
3
3
|
|
|
4
4
|
declare class StringAttribute extends Attribute {
|
|
5
|
-
constructor(displayName: string, columnName: string, columnDbType: string, owner: string, parent?: JoinTreeNodeOperation);
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
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. */
|
|
11
17
|
length(): ScalarFunctionOperation;
|
|
18
|
+
/** Return the string with characters in reverse order. */
|
|
12
19
|
reverse(): ScalarFunctionOperation;
|
|
20
|
+
/** Return the first `n` characters. */
|
|
13
21
|
left(n: number): ScalarFunctionOperation;
|
|
22
|
+
/** Return the last `n` characters. */
|
|
14
23
|
right(n: number): ScalarFunctionOperation;
|
|
24
|
+
/** Return the string repeated `n` times. */
|
|
15
25
|
repeat(n: number): ScalarFunctionOperation;
|
|
26
|
+
/** Replace all occurrences of `fromStr` with `toStr`. */
|
|
16
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
|
+
*/
|
|
17
32
|
substring(start: number, length?: number): ScalarFunctionOperation;
|
|
33
|
+
/** Filter to rows where this attribute equals `value`. */
|
|
18
34
|
eq(value: string): Operation;
|
|
35
|
+
/** Filter to rows where this attribute does not equal `value`. */
|
|
19
36
|
ne(value: string): Operation;
|
|
37
|
+
/** Filter to rows where this attribute contains `value` as a substring. */
|
|
20
38
|
contains(value: string): Operation;
|
|
39
|
+
/** Filter to rows where this attribute begins with `prefix`. */
|
|
21
40
|
startsWith(prefix: string): Operation;
|
|
41
|
+
/** Filter to rows where this attribute ends with `suffix`. */
|
|
22
42
|
endsWith(suffix: string): Operation;
|
|
43
|
+
/** Filter to rows where this attribute does not contain `value` as a substring. */
|
|
23
44
|
notContains(value: string): Operation;
|
|
24
45
|
}
|
|
25
46
|
declare abstract class NumericAttribute extends Attribute {
|
|
26
|
-
constructor(displayName: string, columnName: string, columnDbType: string, owner: string, parent?: JoinTreeNodeOperation);
|
|
47
|
+
constructor(displayName: string, columnName: string, columnDbType: string, owner: string, parent?: JoinTreeNodeOperation, embedded?: Attribute);
|
|
48
|
+
/** Sum of all values in the group. */
|
|
27
49
|
sum(): AggregateOperation;
|
|
50
|
+
/** Smallest value in the group. */
|
|
28
51
|
min(): AggregateOperation;
|
|
52
|
+
/** Largest value in the group. */
|
|
29
53
|
max(): AggregateOperation;
|
|
54
|
+
/** Arithmetic mean of all values in the group. */
|
|
30
55
|
average(): AggregateOperation;
|
|
56
|
+
/** Absolute value (distance from zero, always non-negative). */
|
|
31
57
|
abs(): ScalarFunctionOperation;
|
|
58
|
+
/** Round up to the nearest integer. */
|
|
32
59
|
ceil(): ScalarFunctionOperation;
|
|
60
|
+
/** Round down to the nearest integer. */
|
|
33
61
|
floor(): ScalarFunctionOperation;
|
|
62
|
+
/** Square root. */
|
|
34
63
|
sqrt(): ScalarFunctionOperation;
|
|
64
|
+
/** Remainder after dividing by `n`. */
|
|
35
65
|
mod(n: number): ScalarFunctionOperation;
|
|
66
|
+
/** Raise to the power of `n`. */
|
|
36
67
|
power(n: number): ScalarFunctionOperation;
|
|
68
|
+
/** Round to `d` decimal places, or to the nearest integer when `d` is omitted. */
|
|
37
69
|
round(d?: number): ScalarFunctionOperation;
|
|
38
70
|
}
|
|
39
71
|
declare class DoubleAttribute extends NumericAttribute {
|
|
40
|
-
constructor(displayName: string, columnName: string, columnDbType: string, owner: string, parent?: JoinTreeNodeOperation);
|
|
72
|
+
constructor(displayName: string, columnName: string, columnDbType: string, owner: string, parent?: JoinTreeNodeOperation, embedded?: Attribute);
|
|
73
|
+
/** Filter to rows where this attribute equals `value`. */
|
|
41
74
|
eq(value: number): Operation;
|
|
75
|
+
/** Filter to rows where this attribute does not equal `value`. */
|
|
42
76
|
ne(value: number): Operation;
|
|
77
|
+
/** Filter to rows where this attribute is greater than `value`. */
|
|
43
78
|
gt(value: number): Operation;
|
|
79
|
+
/** Filter to rows where this attribute is less than `value`. */
|
|
44
80
|
lt(value: number): Operation;
|
|
81
|
+
/** Filter to rows where this attribute is greater than or equal to `value`. */
|
|
45
82
|
gte(value: number): Operation;
|
|
83
|
+
/** Filter to rows where this attribute is less than or equal to `value`. */
|
|
46
84
|
lte(value: number): Operation;
|
|
47
85
|
}
|
|
48
86
|
declare const FloatAttribute: typeof DoubleAttribute;
|
|
49
87
|
type FloatAttribute = DoubleAttribute;
|
|
50
88
|
declare class DecimalAttribute extends NumericAttribute {
|
|
51
|
-
constructor(displayName: string, columnName: string, columnDbType: string, owner: string, parent?: JoinTreeNodeOperation);
|
|
89
|
+
constructor(displayName: string, columnName: string, columnDbType: string, owner: string, parent?: JoinTreeNodeOperation, embedded?: Attribute);
|
|
90
|
+
/** Filter to rows where this attribute equals `value`. */
|
|
52
91
|
eq(value: number): Operation;
|
|
92
|
+
/** Filter to rows where this attribute does not equal `value`. */
|
|
53
93
|
ne(value: number): Operation;
|
|
94
|
+
/** Filter to rows where this attribute is greater than `value`. */
|
|
54
95
|
gt(value: number): Operation;
|
|
96
|
+
/** Filter to rows where this attribute is less than `value`. */
|
|
55
97
|
lt(value: number): Operation;
|
|
98
|
+
/** Filter to rows where this attribute is greater than or equal to `value`. */
|
|
56
99
|
gte(value: number): Operation;
|
|
100
|
+
/** Filter to rows where this attribute is less than or equal to `value`. */
|
|
57
101
|
lte(value: number): Operation;
|
|
58
102
|
}
|
|
59
103
|
declare class IntegerAttribute extends NumericAttribute {
|
|
60
|
-
constructor(displayName: string, columnName: string, columnDbType: string, owner: string, parent?: JoinTreeNodeOperation);
|
|
104
|
+
constructor(displayName: string, columnName: string, columnDbType: string, owner: string, parent?: JoinTreeNodeOperation, embedded?: Attribute);
|
|
105
|
+
/** Filter to rows where this attribute equals `value`. */
|
|
61
106
|
eq(value: number): Operation;
|
|
107
|
+
/** Filter to rows where this attribute does not equal `value`. */
|
|
62
108
|
ne(value: number): Operation;
|
|
109
|
+
/** Filter to rows where this attribute is greater than `value`. */
|
|
63
110
|
gt(value: number): Operation;
|
|
111
|
+
/** Filter to rows where this attribute is less than `value`. */
|
|
64
112
|
lt(value: number): Operation;
|
|
113
|
+
/** Filter to rows where this attribute is greater than or equal to `value`. */
|
|
65
114
|
gte(value: number): Operation;
|
|
115
|
+
/** Filter to rows where this attribute is less than or equal to `value`. */
|
|
66
116
|
lte(value: number): Operation;
|
|
67
117
|
}
|
|
68
118
|
declare class BooleanAttribute extends Attribute {
|
|
69
|
-
constructor(displayName: string, columnName: string, columnDbType: string, owner: string, parent?: JoinTreeNodeOperation);
|
|
119
|
+
constructor(displayName: string, columnName: string, columnDbType: string, owner: string, parent?: JoinTreeNodeOperation, embedded?: Attribute);
|
|
120
|
+
/** Filter to rows where this attribute equals `value`. */
|
|
70
121
|
eq(value: boolean): Operation;
|
|
122
|
+
/** Filter to rows where this attribute is true. */
|
|
71
123
|
isTrue(): Operation;
|
|
124
|
+
/** Filter to rows where this attribute is false. */
|
|
72
125
|
isFalse(): Operation;
|
|
73
126
|
}
|
|
74
127
|
declare class DateAttribute extends Attribute {
|
|
75
|
-
constructor(displayName: string, columnName: string, columnDbType: string, owner: string, parent?: JoinTreeNodeOperation);
|
|
128
|
+
constructor(displayName: string, columnName: string, columnDbType: string, owner: string, parent?: JoinTreeNodeOperation, embedded?: Attribute);
|
|
129
|
+
/** Filter to rows where this date equals `value`. */
|
|
76
130
|
eq(value: Date | string): Operation;
|
|
131
|
+
/** Filter to rows where this date does not equal `value`. */
|
|
77
132
|
ne(value: Date | string): Operation;
|
|
133
|
+
/** Filter to rows where this date is after `value`. */
|
|
78
134
|
gt(value: Date | string): Operation;
|
|
135
|
+
/** Filter to rows where this date is before `value`. */
|
|
79
136
|
lt(value: Date | string): Operation;
|
|
137
|
+
/** Filter to rows where this date is on or after `value`. */
|
|
80
138
|
gte(value: Date | string): Operation;
|
|
139
|
+
/** Filter to rows where this date is on or before `value`. */
|
|
81
140
|
lte(value: Date | string): Operation;
|
|
141
|
+
/** Extract the four-digit calendar year. */
|
|
82
142
|
year(): DateExtractOperation;
|
|
143
|
+
/** Extract the month number (1–12). */
|
|
83
144
|
month(): DateExtractOperation;
|
|
145
|
+
/** Extract the day of the month (1–31). */
|
|
84
146
|
day(): DateExtractOperation;
|
|
147
|
+
/** Extract the quarter (1–4). */
|
|
85
148
|
quarter(): DateExtractOperation;
|
|
149
|
+
/** Extract the ISO week number (1–53). */
|
|
86
150
|
week(): DateExtractOperation;
|
|
151
|
+
/** Extract the day of the week (0 = Sunday through 6 = Saturday). */
|
|
87
152
|
dayOfWeek(): DateExtractOperation;
|
|
153
|
+
/** Add `n` days to this date. */
|
|
88
154
|
addDays(n: number): DateArithmeticOperation;
|
|
155
|
+
/** Add `n` months to this date. */
|
|
89
156
|
addMonths(n: number): DateArithmeticOperation;
|
|
157
|
+
/** Add `n` years to this date. */
|
|
90
158
|
addYears(n: number): DateArithmeticOperation;
|
|
159
|
+
/** Subtract `n` days from this date. */
|
|
91
160
|
subtractDays(n: number): DateArithmeticOperation;
|
|
161
|
+
/** Subtract `n` months from this date. */
|
|
92
162
|
subtractMonths(n: number): DateArithmeticOperation;
|
|
163
|
+
/** Subtract `n` years from this date. */
|
|
93
164
|
subtractYears(n: number): DateArithmeticOperation;
|
|
165
|
+
/** Number of whole days between this date and `other`. */
|
|
94
166
|
diffDays(other: Date): DateDiffOperation;
|
|
167
|
+
/** Number of whole months between this date and `other`. */
|
|
95
168
|
diffMonths(other: Date): DateDiffOperation;
|
|
169
|
+
/** Number of whole years between this date and `other`. */
|
|
96
170
|
diffYears(other: Date): DateDiffOperation;
|
|
97
171
|
}
|
|
98
172
|
declare class DateTimeAttribute extends Attribute {
|
|
99
|
-
constructor(displayName: string, columnName: string, columnDbType: string, owner: string, parent?: JoinTreeNodeOperation);
|
|
173
|
+
constructor(displayName: string, columnName: string, columnDbType: string, owner: string, parent?: JoinTreeNodeOperation, embedded?: Attribute);
|
|
174
|
+
/** Filter to rows where this timestamp equals `value`. */
|
|
100
175
|
eq(value: Date | string): Operation;
|
|
176
|
+
/** Filter to rows where this timestamp does not equal `value`. */
|
|
101
177
|
ne(value: Date | string): Operation;
|
|
178
|
+
/** Filter to rows where this timestamp is after `value`. */
|
|
102
179
|
gt(value: Date | string): Operation;
|
|
180
|
+
/** Filter to rows where this timestamp is before `value`. */
|
|
103
181
|
lt(value: Date | string): Operation;
|
|
182
|
+
/** Filter to rows where this timestamp is on or after `value`. */
|
|
104
183
|
gte(value: Date | string): Operation;
|
|
184
|
+
/** Filter to rows where this timestamp is on or before `value`. */
|
|
105
185
|
lte(value: Date | string): Operation;
|
|
186
|
+
/** Extract the four-digit calendar year. */
|
|
106
187
|
year(): DateExtractOperation;
|
|
188
|
+
/** Extract the month number (1–12). */
|
|
107
189
|
month(): DateExtractOperation;
|
|
190
|
+
/** Extract the day of the month (1–31). */
|
|
108
191
|
day(): DateExtractOperation;
|
|
192
|
+
/** Extract the hour (0–23). */
|
|
109
193
|
hour(): DateExtractOperation;
|
|
194
|
+
/** Extract the minute (0–59). */
|
|
110
195
|
minute(): DateExtractOperation;
|
|
196
|
+
/** Extract the second (0–59). */
|
|
111
197
|
second(): DateExtractOperation;
|
|
198
|
+
/** Extract the quarter (1–4). */
|
|
112
199
|
quarter(): DateExtractOperation;
|
|
200
|
+
/** Extract the ISO week number (1–53). */
|
|
113
201
|
week(): DateExtractOperation;
|
|
202
|
+
/** Extract the day of the week (0 = Sunday through 6 = Saturday). */
|
|
114
203
|
dayOfWeek(): DateExtractOperation;
|
|
204
|
+
/** Add `n` days to this timestamp. */
|
|
115
205
|
addDays(n: number): DateArithmeticOperation;
|
|
206
|
+
/** Add `n` months to this timestamp. */
|
|
116
207
|
addMonths(n: number): DateArithmeticOperation;
|
|
208
|
+
/** Add `n` years to this timestamp. */
|
|
117
209
|
addYears(n: number): DateArithmeticOperation;
|
|
210
|
+
/** Add `n` hours to this timestamp. */
|
|
118
211
|
addHours(n: number): DateArithmeticOperation;
|
|
212
|
+
/** Add `n` minutes to this timestamp. */
|
|
119
213
|
addMinutes(n: number): DateArithmeticOperation;
|
|
214
|
+
/** Add `n` seconds to this timestamp. */
|
|
120
215
|
addSeconds(n: number): DateArithmeticOperation;
|
|
216
|
+
/** Subtract `n` days from this timestamp. */
|
|
121
217
|
subtractDays(n: number): DateArithmeticOperation;
|
|
218
|
+
/** Subtract `n` months from this timestamp. */
|
|
122
219
|
subtractMonths(n: number): DateArithmeticOperation;
|
|
220
|
+
/** Subtract `n` years from this timestamp. */
|
|
123
221
|
subtractYears(n: number): DateArithmeticOperation;
|
|
222
|
+
/** Subtract `n` hours from this timestamp. */
|
|
124
223
|
subtractHours(n: number): DateArithmeticOperation;
|
|
224
|
+
/** Subtract `n` minutes from this timestamp. */
|
|
125
225
|
subtractMinutes(n: number): DateArithmeticOperation;
|
|
226
|
+
/** Subtract `n` seconds from this timestamp. */
|
|
126
227
|
subtractSeconds(n: number): DateArithmeticOperation;
|
|
228
|
+
/** Number of whole days between this timestamp and `other`. */
|
|
127
229
|
diffDays(other: Date): DateDiffOperation;
|
|
230
|
+
/** Number of whole months between this timestamp and `other`. */
|
|
128
231
|
diffMonths(other: Date): DateDiffOperation;
|
|
232
|
+
/** Number of whole years between this timestamp and `other`. */
|
|
129
233
|
diffYears(other: Date): DateDiffOperation;
|
|
234
|
+
/** Number of whole hours between this timestamp and `other`. */
|
|
130
235
|
diffHours(other: Date): DateDiffOperation;
|
|
236
|
+
/** Number of whole minutes between this timestamp and `other`. */
|
|
131
237
|
diffMinutes(other: Date): DateDiffOperation;
|
|
238
|
+
/** Number of whole seconds between this timestamp and `other`. */
|
|
132
239
|
diffSeconds(other: Date): DateDiffOperation;
|
|
133
240
|
}
|
|
134
241
|
|
|
@@ -8,9 +8,9 @@ import {
|
|
|
8
8
|
IntegerAttribute,
|
|
9
9
|
NumericAttribute,
|
|
10
10
|
StringAttribute
|
|
11
|
-
} from "../chunk-
|
|
12
|
-
import "../chunk-
|
|
13
|
-
import "../chunk-
|
|
11
|
+
} from "../chunk-4LNZV6EN.js";
|
|
12
|
+
import "../chunk-4JVW4TAB.js";
|
|
13
|
+
import "../chunk-UYMOE6YU.js";
|
|
14
14
|
export {
|
|
15
15
|
BooleanAttribute,
|
|
16
16
|
DateAttribute,
|