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.
- package/dist/{chunk-4JVW4TAB.js → chunk-BGEX377Q.js} +58 -8
- package/dist/chunk-BGEX377Q.js.map +1 -0
- package/dist/chunk-BKPWV3OF.js +962 -0
- package/dist/chunk-BKPWV3OF.js.map +1 -0
- package/dist/{chunk-PMPLCEWQ.js → chunk-GPHWC533.js} +2 -2
- package/dist/{chunk-FJYA2ASS.js → chunk-KAK75RVS.js} +74 -12
- package/dist/chunk-KAK75RVS.js.map +1 -0
- package/dist/{chunk-4LNZV6EN.js → chunk-MGEL5RWM.js} +206 -78
- package/dist/chunk-MGEL5RWM.js.map +1 -0
- package/dist/chunk-PF6EJZHB.js +1015 -0
- package/dist/chunk-PF6EJZHB.js.map +1 -0
- package/dist/datafinder/attribute.cjs +537 -11
- package/dist/datafinder/attribute.cjs.map +1 -1
- package/dist/datafinder/attribute.d.cts +29 -7
- package/dist/datafinder/attribute.d.ts +29 -7
- package/dist/datafinder/attribute.js +2 -2
- package/dist/datafinder/runner.cjs +1267 -215
- package/dist/datafinder/runner.cjs.map +1 -1
- package/dist/datafinder/runner.d.cts +28 -5
- package/dist/datafinder/runner.d.ts +28 -5
- package/dist/datafinder/runner.js +6 -6
- package/dist/datafinder/sql-generator.cjs +1203 -206
- package/dist/datafinder/sql-generator.cjs.map +1 -1
- package/dist/datafinder/sql-generator.d.cts +19 -5
- package/dist/datafinder/sql-generator.d.ts +19 -5
- package/dist/datafinder/sql-generator.js +9 -5
- package/dist/datafinder/typed-attributes.cjs +693 -88
- package/dist/datafinder/typed-attributes.cjs.map +1 -1
- package/dist/datafinder/typed-attributes.d.cts +3 -242
- package/dist/datafinder/typed-attributes.d.ts +3 -242
- package/dist/datafinder/typed-attributes.js +3 -3
- package/dist/dialect-CogGPm_y.d.cts +38 -0
- package/dist/dialect-aaG1bDi5.d.ts +38 -0
- package/dist/index.cjs +1677 -408
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +109 -5
- package/dist/index.d.ts +109 -5
- package/dist/index.js +321 -11
- package/dist/index.js.map +1 -1
- package/dist/model/milestoning.cjs +529 -0
- package/dist/model/milestoning.cjs.map +1 -1
- package/dist/model/milestoning.js +2 -2
- package/dist/model/relational.cjs +547 -16
- package/dist/model/relational.cjs.map +1 -1
- package/dist/model/relational.d.cts +421 -57
- package/dist/model/relational.d.ts +421 -57
- package/dist/model/relational.js +53 -3
- package/dist/typed-attributes-CUTf_6Ru.d.ts +328 -0
- package/dist/typed-attributes-CdWXq_78.d.cts +328 -0
- package/package.json +3 -2
- package/dist/chunk-4JVW4TAB.js.map +0 -1
- package/dist/chunk-4LNZV6EN.js.map +0 -1
- package/dist/chunk-FJYA2ASS.js.map +0 -1
- package/dist/chunk-MH4XMYVB.js +0 -696
- package/dist/chunk-MH4XMYVB.js.map +0 -1
- package/dist/chunk-UYMOE6YU.js +0 -509
- package/dist/chunk-UYMOE6YU.js.map +0 -1
- /package/dist/{chunk-PMPLCEWQ.js.map → chunk-GPHWC533.js.map} +0 -0
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Attribute } from './attribute.cjs';
|
|
2
|
-
import {
|
|
2
|
+
import { b as DialectName, S as SqlDialect } from '../dialect-CogGPm_y.cjs';
|
|
3
|
+
import { RelationalOperationElement, SortOperation, Operation } from '../model/relational.cjs';
|
|
3
4
|
|
|
4
5
|
type Row = unknown[];
|
|
5
6
|
declare const DEFAULT_TIMEOUT_MS = 60000;
|
|
@@ -13,7 +14,9 @@ interface QueryTarget {
|
|
|
13
14
|
readonly name: string;
|
|
14
15
|
}
|
|
15
16
|
interface QueryRunner {
|
|
16
|
-
|
|
17
|
+
/** The SQL a runner that executes SQL sends: `toSql()` writes it for this dialect. Postgres when absent. */
|
|
18
|
+
readonly dialect?: DialectName | SqlDialect;
|
|
19
|
+
select(businessDate: Date | null, processingDatetime: Date | null, columns: (Attribute | RelationalOperationElement)[], table: QueryTarget, op: RelationalOperationElement, orderBy?: SortOperation[], groupBy?: Attribute[], limit?: number, timeoutMs?: number, businessDateTo?: Date | null, distinct?: boolean, offset?: number, having?: Operation): Promise<Row[]>;
|
|
17
20
|
}
|
|
18
21
|
declare function registerRunner(runner: QueryRunner): void;
|
|
19
22
|
declare function clearRunner(): void;
|
|
@@ -28,14 +31,34 @@ declare class FinderResult {
|
|
|
28
31
|
private _orderBy;
|
|
29
32
|
private _groupBy;
|
|
30
33
|
private _limit?;
|
|
34
|
+
private _distinct;
|
|
35
|
+
private _offset?;
|
|
36
|
+
private _having?;
|
|
31
37
|
private _timeoutMs;
|
|
32
38
|
constructor(_businessDate: Date | null, _processingDatetime: Date | null, _columns: (Attribute | RelationalOperationElement)[], _table: QueryTarget, _op: RelationalOperationElement, _businessDateTo?: Date | null);
|
|
33
|
-
|
|
34
|
-
|
|
39
|
+
/**
|
|
40
|
+
* Order the rows. Calls accumulate: the sorts of the latest call take priority and earlier ones order the
|
|
41
|
+
* rows it leaves tied, as in a chain of `sortBy` calls. Sorting a column again replaces its earlier direction.
|
|
42
|
+
*/
|
|
43
|
+
orderBy(...sorts: SortOperation[]): this;
|
|
44
|
+
groupBy(...attrs: Attribute[]): this;
|
|
35
45
|
limit(n: number): this;
|
|
46
|
+
/** Skip the first `n` rows. Sort the rows first: without an order, which rows are first is not defined. */
|
|
47
|
+
offset(n: number): this;
|
|
48
|
+
/** Rows `start` up to but not including `stop`, counting from 0: `offset(start).limit(stop - start)`. */
|
|
49
|
+
slice(start: number, stop: number): this;
|
|
50
|
+
/**
|
|
51
|
+
* Keep the groups for which every condition holds: `HAVING`. A condition tests an aggregate or a grouping column:
|
|
52
|
+
* `f.findAll(null, null, [f.category(), countAll()]).groupBy(f.category()).having(countAll().gt(1))`.
|
|
53
|
+
* Calls accumulate, as `and` does.
|
|
54
|
+
*/
|
|
55
|
+
having(...conditions: Operation[]): this;
|
|
56
|
+
/** Return each distinct row once: `SELECT DISTINCT`. A sort on a distinct query has to use a selected column. */
|
|
57
|
+
distinct(): this;
|
|
36
58
|
/** Abort the query and throw QueryTimeoutError if it runs longer than `milliseconds` (default 60000). */
|
|
37
59
|
timeout(milliseconds: number): this;
|
|
38
|
-
toSql()
|
|
60
|
+
/** The query as SQL, in Postgres unless a dialect is given: `toSql('databricks')`. Nothing is run. */
|
|
61
|
+
toSql(dialect?: DialectName | SqlDialect): string;
|
|
39
62
|
toRows(): Promise<Row[]>;
|
|
40
63
|
}
|
|
41
64
|
declare function convertInputsAndSelect(businessDate: Date | string | null, processingDatetime: Date | string | null, columns: (Attribute | RelationalOperationElement)[], table: QueryTarget, op?: RelationalOperationElement): FinderResult;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Attribute } from './attribute.js';
|
|
2
|
-
import {
|
|
2
|
+
import { b as DialectName, S as SqlDialect } from '../dialect-aaG1bDi5.js';
|
|
3
|
+
import { RelationalOperationElement, SortOperation, Operation } from '../model/relational.js';
|
|
3
4
|
|
|
4
5
|
type Row = unknown[];
|
|
5
6
|
declare const DEFAULT_TIMEOUT_MS = 60000;
|
|
@@ -13,7 +14,9 @@ interface QueryTarget {
|
|
|
13
14
|
readonly name: string;
|
|
14
15
|
}
|
|
15
16
|
interface QueryRunner {
|
|
16
|
-
|
|
17
|
+
/** The SQL a runner that executes SQL sends: `toSql()` writes it for this dialect. Postgres when absent. */
|
|
18
|
+
readonly dialect?: DialectName | SqlDialect;
|
|
19
|
+
select(businessDate: Date | null, processingDatetime: Date | null, columns: (Attribute | RelationalOperationElement)[], table: QueryTarget, op: RelationalOperationElement, orderBy?: SortOperation[], groupBy?: Attribute[], limit?: number, timeoutMs?: number, businessDateTo?: Date | null, distinct?: boolean, offset?: number, having?: Operation): Promise<Row[]>;
|
|
17
20
|
}
|
|
18
21
|
declare function registerRunner(runner: QueryRunner): void;
|
|
19
22
|
declare function clearRunner(): void;
|
|
@@ -28,14 +31,34 @@ declare class FinderResult {
|
|
|
28
31
|
private _orderBy;
|
|
29
32
|
private _groupBy;
|
|
30
33
|
private _limit?;
|
|
34
|
+
private _distinct;
|
|
35
|
+
private _offset?;
|
|
36
|
+
private _having?;
|
|
31
37
|
private _timeoutMs;
|
|
32
38
|
constructor(_businessDate: Date | null, _processingDatetime: Date | null, _columns: (Attribute | RelationalOperationElement)[], _table: QueryTarget, _op: RelationalOperationElement, _businessDateTo?: Date | null);
|
|
33
|
-
|
|
34
|
-
|
|
39
|
+
/**
|
|
40
|
+
* Order the rows. Calls accumulate: the sorts of the latest call take priority and earlier ones order the
|
|
41
|
+
* rows it leaves tied, as in a chain of `sortBy` calls. Sorting a column again replaces its earlier direction.
|
|
42
|
+
*/
|
|
43
|
+
orderBy(...sorts: SortOperation[]): this;
|
|
44
|
+
groupBy(...attrs: Attribute[]): this;
|
|
35
45
|
limit(n: number): this;
|
|
46
|
+
/** Skip the first `n` rows. Sort the rows first: without an order, which rows are first is not defined. */
|
|
47
|
+
offset(n: number): this;
|
|
48
|
+
/** Rows `start` up to but not including `stop`, counting from 0: `offset(start).limit(stop - start)`. */
|
|
49
|
+
slice(start: number, stop: number): this;
|
|
50
|
+
/**
|
|
51
|
+
* Keep the groups for which every condition holds: `HAVING`. A condition tests an aggregate or a grouping column:
|
|
52
|
+
* `f.findAll(null, null, [f.category(), countAll()]).groupBy(f.category()).having(countAll().gt(1))`.
|
|
53
|
+
* Calls accumulate, as `and` does.
|
|
54
|
+
*/
|
|
55
|
+
having(...conditions: Operation[]): this;
|
|
56
|
+
/** Return each distinct row once: `SELECT DISTINCT`. A sort on a distinct query has to use a selected column. */
|
|
57
|
+
distinct(): this;
|
|
36
58
|
/** Abort the query and throw QueryTimeoutError if it runs longer than `milliseconds` (default 60000). */
|
|
37
59
|
timeout(milliseconds: number): this;
|
|
38
|
-
toSql()
|
|
60
|
+
/** The query as SQL, in Postgres unless a dialect is given: `toSql('databricks')`. Nothing is run. */
|
|
61
|
+
toSql(dialect?: DialectName | SqlDialect): string;
|
|
39
62
|
toRows(): Promise<Row[]>;
|
|
40
63
|
}
|
|
41
64
|
declare function convertInputsAndSelect(businessDate: Date | string | null, processingDatetime: Date | string | null, columns: (Attribute | RelationalOperationElement)[], table: QueryTarget, op?: RelationalOperationElement): FinderResult;
|
|
@@ -7,12 +7,12 @@ import {
|
|
|
7
7
|
convertInputsAndSelectForDateRange,
|
|
8
8
|
getRunner,
|
|
9
9
|
registerRunner
|
|
10
|
-
} from "../chunk-
|
|
11
|
-
import "../chunk-
|
|
12
|
-
import "../chunk-
|
|
13
|
-
import "../chunk-
|
|
14
|
-
import "../chunk-
|
|
15
|
-
import "../chunk-
|
|
10
|
+
} from "../chunk-KAK75RVS.js";
|
|
11
|
+
import "../chunk-BKPWV3OF.js";
|
|
12
|
+
import "../chunk-GPHWC533.js";
|
|
13
|
+
import "../chunk-MGEL5RWM.js";
|
|
14
|
+
import "../chunk-BGEX377Q.js";
|
|
15
|
+
import "../chunk-PF6EJZHB.js";
|
|
16
16
|
export {
|
|
17
17
|
DEFAULT_TIMEOUT_MS,
|
|
18
18
|
FinderResult,
|