kysely 0.16.11 → 0.17.0
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 +2 -2
- package/dist/cjs/dialect/mysql/mysql-adapter.js +3 -4
- package/dist/cjs/dialect/mysql/mysql-introspector.js +2 -1
- package/dist/cjs/dialect/postgres/postgres-adapter.js +3 -2
- package/dist/cjs/dialect/sqlite/sqlite-introspector.js +2 -1
- package/dist/cjs/index-nodeless.d.ts +2 -0
- package/dist/cjs/index-nodeless.js +2 -0
- package/dist/cjs/kysely.d.ts +3 -6
- package/dist/cjs/kysely.js +7 -12
- package/dist/cjs/migration/migrator.js +4 -4
- package/dist/cjs/operation-node/operation-node-transformer.js +1 -1
- package/dist/cjs/operation-node/raw-node.d.ts +4 -2
- package/dist/cjs/operation-node/raw-node.js +8 -2
- package/dist/cjs/parser/complex-expression-parser.d.ts +5 -5
- package/dist/cjs/parser/complex-expression-parser.js +5 -4
- package/dist/cjs/parser/filter-parser.d.ts +9 -9
- package/dist/cjs/parser/filter-parser.js +31 -30
- package/dist/cjs/parser/group-by-parser.d.ts +1 -2
- package/dist/cjs/parser/group-by-parser.js +2 -2
- package/dist/cjs/parser/insert-values-parser.d.ts +1 -2
- package/dist/cjs/parser/insert-values-parser.js +6 -6
- package/dist/cjs/parser/join-parser.d.ts +1 -2
- package/dist/cjs/parser/join-parser.js +8 -7
- package/dist/cjs/parser/order-by-parser.d.ts +1 -2
- package/dist/cjs/parser/order-by-parser.js +4 -4
- package/dist/cjs/parser/parse-utils.d.ts +10 -0
- package/dist/cjs/parser/parse-utils.js +38 -0
- package/dist/cjs/parser/reference-parser.d.ts +2 -3
- package/dist/cjs/parser/reference-parser.js +5 -5
- package/dist/cjs/parser/select-parser.d.ts +1 -2
- package/dist/cjs/parser/select-parser.js +5 -5
- package/dist/cjs/parser/table-parser.d.ts +2 -3
- package/dist/cjs/parser/table-parser.js +5 -5
- package/dist/cjs/parser/update-set-parser.d.ts +1 -2
- package/dist/cjs/parser/update-set-parser.js +2 -2
- package/dist/cjs/parser/value-parser.d.ts +3 -4
- package/dist/cjs/parser/value-parser.js +7 -7
- package/dist/cjs/parser/with-parser.d.ts +1 -2
- package/dist/cjs/parser/with-parser.js +3 -2
- package/dist/cjs/query-builder/delete-query-builder.d.ts +23 -19
- package/dist/cjs/query-builder/delete-query-builder.js +15 -15
- package/dist/cjs/query-builder/expression-builder.d.ts +4 -13
- package/dist/cjs/query-builder/expression-builder.js +12 -21
- package/dist/cjs/query-builder/function-builder.d.ts +2 -6
- package/dist/cjs/query-builder/function-builder.js +5 -8
- package/dist/cjs/query-builder/insert-query-builder.d.ts +12 -8
- package/dist/cjs/query-builder/insert-query-builder.js +8 -7
- package/dist/cjs/query-builder/join-builder.d.ts +0 -2
- package/dist/cjs/query-builder/join-builder.js +8 -8
- package/dist/cjs/query-builder/on-conflict-builder.d.ts +24 -20
- package/dist/cjs/query-builder/on-conflict-builder.js +17 -17
- package/dist/cjs/query-builder/returning-interface.d.ts +3 -1
- package/dist/cjs/query-builder/select-query-builder.d.ts +41 -29
- package/dist/cjs/query-builder/select-query-builder.js +28 -26
- package/dist/cjs/query-builder/update-query-builder.d.ts +30 -24
- package/dist/cjs/query-builder/update-query-builder.js +22 -20
- package/dist/cjs/query-builder/where-interface.d.ts +20 -16
- package/dist/cjs/query-compiler/default-query-compiler.js +1 -1
- package/dist/cjs/query-creator.d.ts +10 -129
- package/dist/cjs/query-creator.js +5 -136
- package/dist/cjs/query-executor/default-query-executor.d.ts +8 -1
- package/dist/cjs/query-executor/default-query-executor.js +13 -13
- package/dist/cjs/query-executor/noop-query-executor.d.ts +8 -0
- package/dist/cjs/query-executor/noop-query-executor.js +8 -1
- package/dist/cjs/query-executor/query-executor-provider.d.ts +8 -0
- package/dist/cjs/query-executor/query-executor-provider.js +2 -0
- package/dist/cjs/query-executor/query-executor.d.ts +7 -0
- package/dist/cjs/raw-builder/raw-builder.d.ts +42 -11
- package/dist/cjs/raw-builder/raw-builder.js +55 -56
- package/dist/cjs/raw-builder/sql.d.ts +323 -0
- package/dist/cjs/raw-builder/sql.js +153 -0
- package/dist/cjs/schema/alter-table-builder.d.ts +20 -8
- package/dist/cjs/schema/column-definition-builder.d.ts +20 -8
- package/dist/cjs/schema/create-index-builder.d.ts +3 -1
- package/dist/cjs/schema/create-index-builder.js +3 -1
- package/dist/cjs/schema/create-table-builder.d.ts +6 -2
- package/dist/cjs/schema/create-table-builder.js +6 -2
- package/dist/cjs/schema/create-view-builder.d.ts +3 -3
- package/dist/cjs/schema/create-view-builder.js +3 -3
- package/dist/cjs/util/query-id.js +10 -4
- package/dist/cjs/util/random-string.js +65 -2
- package/dist/esm/dialect/mysql/mysql-adapter.js +3 -4
- package/dist/esm/dialect/mysql/mysql-introspector.js +2 -1
- package/dist/esm/dialect/postgres/postgres-adapter.js +3 -2
- package/dist/esm/dialect/sqlite/sqlite-introspector.js +2 -1
- package/dist/esm/index-nodeless.d.ts +2 -0
- package/dist/esm/index-nodeless.js +2 -0
- package/dist/esm/kysely.d.ts +3 -6
- package/dist/esm/kysely.js +7 -12
- package/dist/esm/migration/migrator.js +4 -4
- package/dist/esm/operation-node/operation-node-transformer.js +1 -1
- package/dist/esm/operation-node/raw-node.d.ts +4 -2
- package/dist/esm/operation-node/raw-node.js +8 -2
- package/dist/esm/parser/complex-expression-parser.d.ts +5 -5
- package/dist/esm/parser/complex-expression-parser.js +5 -4
- package/dist/esm/parser/filter-parser.d.ts +9 -9
- package/dist/esm/parser/filter-parser.js +31 -30
- package/dist/esm/parser/group-by-parser.d.ts +1 -2
- package/dist/esm/parser/group-by-parser.js +2 -2
- package/dist/esm/parser/insert-values-parser.d.ts +1 -2
- package/dist/esm/parser/insert-values-parser.js +6 -6
- package/dist/esm/parser/join-parser.d.ts +1 -2
- package/dist/esm/parser/join-parser.js +8 -7
- package/dist/esm/parser/order-by-parser.d.ts +1 -2
- package/dist/esm/parser/order-by-parser.js +4 -4
- package/dist/esm/parser/parse-utils.d.ts +10 -0
- package/dist/esm/parser/parse-utils.js +32 -0
- package/dist/esm/parser/reference-parser.d.ts +2 -3
- package/dist/esm/parser/reference-parser.js +5 -5
- package/dist/esm/parser/select-parser.d.ts +1 -2
- package/dist/esm/parser/select-parser.js +5 -5
- package/dist/esm/parser/table-parser.d.ts +2 -3
- package/dist/esm/parser/table-parser.js +5 -5
- package/dist/esm/parser/update-set-parser.d.ts +1 -2
- package/dist/esm/parser/update-set-parser.js +2 -2
- package/dist/esm/parser/value-parser.d.ts +3 -4
- package/dist/esm/parser/value-parser.js +7 -7
- package/dist/esm/parser/with-parser.d.ts +1 -2
- package/dist/esm/parser/with-parser.js +3 -2
- package/dist/esm/query-builder/delete-query-builder.d.ts +23 -19
- package/dist/esm/query-builder/delete-query-builder.js +15 -15
- package/dist/esm/query-builder/expression-builder.d.ts +4 -13
- package/dist/esm/query-builder/expression-builder.js +12 -21
- package/dist/esm/query-builder/function-builder.d.ts +2 -6
- package/dist/esm/query-builder/function-builder.js +5 -8
- package/dist/esm/query-builder/insert-query-builder.d.ts +12 -8
- package/dist/esm/query-builder/insert-query-builder.js +8 -7
- package/dist/esm/query-builder/join-builder.d.ts +0 -2
- package/dist/esm/query-builder/join-builder.js +8 -8
- package/dist/esm/query-builder/on-conflict-builder.d.ts +24 -20
- package/dist/esm/query-builder/on-conflict-builder.js +17 -17
- package/dist/esm/query-builder/returning-interface.d.ts +3 -1
- package/dist/esm/query-builder/select-query-builder.d.ts +41 -29
- package/dist/esm/query-builder/select-query-builder.js +28 -26
- package/dist/esm/query-builder/update-query-builder.d.ts +30 -24
- package/dist/esm/query-builder/update-query-builder.js +22 -20
- package/dist/esm/query-builder/where-interface.d.ts +20 -16
- package/dist/esm/query-compiler/default-query-compiler.js +1 -1
- package/dist/esm/query-creator.d.ts +10 -129
- package/dist/esm/query-creator.js +5 -136
- package/dist/esm/query-executor/default-query-executor.d.ts +8 -1
- package/dist/esm/query-executor/default-query-executor.js +13 -13
- package/dist/esm/query-executor/noop-query-executor.d.ts +8 -0
- package/dist/esm/query-executor/noop-query-executor.js +7 -0
- package/dist/esm/query-executor/query-executor-provider.d.ts +8 -0
- package/dist/esm/query-executor/query-executor-provider.js +2 -0
- package/dist/esm/query-executor/query-executor.d.ts +7 -0
- package/dist/esm/raw-builder/raw-builder.d.ts +42 -11
- package/dist/esm/raw-builder/raw-builder.js +56 -57
- package/dist/esm/raw-builder/sql.d.ts +323 -0
- package/dist/esm/raw-builder/sql.js +151 -0
- package/dist/esm/schema/alter-table-builder.d.ts +20 -8
- package/dist/esm/schema/column-definition-builder.d.ts +20 -8
- package/dist/esm/schema/create-index-builder.d.ts +3 -1
- package/dist/esm/schema/create-index-builder.js +3 -1
- package/dist/esm/schema/create-table-builder.d.ts +6 -2
- package/dist/esm/schema/create-table-builder.js +6 -2
- package/dist/esm/schema/create-view-builder.d.ts +3 -3
- package/dist/esm/schema/create-view-builder.js +3 -3
- package/dist/esm/util/query-id.js +10 -4
- package/dist/esm/util/random-string.js +65 -2
- package/package.json +13 -13
- package/dist/cjs/parser/parse-context.d.ts +0 -55
- package/dist/cjs/parser/parse-context.js +0 -50
- package/dist/cjs/util/private-symbols.d.ts +0 -5
- package/dist/cjs/util/private-symbols.js +0 -8
- package/dist/esm/parser/parse-context.d.ts +0 -55
- package/dist/esm/parser/parse-context.js +0 -47
- package/dist/esm/util/private-symbols.d.ts +0 -5
- package/dist/esm/util/private-symbols.js +0 -6
|
@@ -11,13 +11,13 @@ export class JoinBuilder {
|
|
|
11
11
|
on(...args) {
|
|
12
12
|
return new JoinBuilder({
|
|
13
13
|
...this.#props,
|
|
14
|
-
joinNode: JoinNode.cloneWithOn(this.#props.joinNode, parseOnFilter(
|
|
14
|
+
joinNode: JoinNode.cloneWithOn(this.#props.joinNode, parseOnFilter(args)),
|
|
15
15
|
});
|
|
16
16
|
}
|
|
17
17
|
orOn(...args) {
|
|
18
18
|
return new JoinBuilder({
|
|
19
19
|
...this.#props,
|
|
20
|
-
joinNode: JoinNode.cloneWithOrOn(this.#props.joinNode, parseOnFilter(
|
|
20
|
+
joinNode: JoinNode.cloneWithOrOn(this.#props.joinNode, parseOnFilter(args)),
|
|
21
21
|
});
|
|
22
22
|
}
|
|
23
23
|
/**
|
|
@@ -29,7 +29,7 @@ export class JoinBuilder {
|
|
|
29
29
|
onRef(lhs, op, rhs) {
|
|
30
30
|
return new JoinBuilder({
|
|
31
31
|
...this.#props,
|
|
32
|
-
joinNode: JoinNode.cloneWithOn(this.#props.joinNode, parseReferenceFilter(
|
|
32
|
+
joinNode: JoinNode.cloneWithOn(this.#props.joinNode, parseReferenceFilter(lhs, op, rhs)),
|
|
33
33
|
});
|
|
34
34
|
}
|
|
35
35
|
/**
|
|
@@ -41,7 +41,7 @@ export class JoinBuilder {
|
|
|
41
41
|
orOnRef(lhs, op, rhs) {
|
|
42
42
|
return new JoinBuilder({
|
|
43
43
|
...this.#props,
|
|
44
|
-
joinNode: JoinNode.cloneWithOrOn(this.#props.joinNode, parseReferenceFilter(
|
|
44
|
+
joinNode: JoinNode.cloneWithOrOn(this.#props.joinNode, parseReferenceFilter(lhs, op, rhs)),
|
|
45
45
|
});
|
|
46
46
|
}
|
|
47
47
|
/**
|
|
@@ -53,7 +53,7 @@ export class JoinBuilder {
|
|
|
53
53
|
onExists(arg) {
|
|
54
54
|
return new JoinBuilder({
|
|
55
55
|
...this.#props,
|
|
56
|
-
joinNode: JoinNode.cloneWithOn(this.#props.joinNode, parseExistFilter(
|
|
56
|
+
joinNode: JoinNode.cloneWithOn(this.#props.joinNode, parseExistFilter(arg)),
|
|
57
57
|
});
|
|
58
58
|
}
|
|
59
59
|
/**
|
|
@@ -65,7 +65,7 @@ export class JoinBuilder {
|
|
|
65
65
|
onNotExists(arg) {
|
|
66
66
|
return new JoinBuilder({
|
|
67
67
|
...this.#props,
|
|
68
|
-
joinNode: JoinNode.cloneWithOn(this.#props.joinNode, parseNotExistFilter(
|
|
68
|
+
joinNode: JoinNode.cloneWithOn(this.#props.joinNode, parseNotExistFilter(arg)),
|
|
69
69
|
});
|
|
70
70
|
}
|
|
71
71
|
/**
|
|
@@ -77,7 +77,7 @@ export class JoinBuilder {
|
|
|
77
77
|
orOnExists(arg) {
|
|
78
78
|
return new JoinBuilder({
|
|
79
79
|
...this.#props,
|
|
80
|
-
joinNode: JoinNode.cloneWithOrOn(this.#props.joinNode, parseExistFilter(
|
|
80
|
+
joinNode: JoinNode.cloneWithOrOn(this.#props.joinNode, parseExistFilter(arg)),
|
|
81
81
|
});
|
|
82
82
|
}
|
|
83
83
|
/**
|
|
@@ -89,7 +89,7 @@ export class JoinBuilder {
|
|
|
89
89
|
orOnNotExists(arg) {
|
|
90
90
|
return new JoinBuilder({
|
|
91
91
|
...this.#props,
|
|
92
|
-
joinNode: JoinNode.cloneWithOrOn(this.#props.joinNode, parseNotExistFilter(
|
|
92
|
+
joinNode: JoinNode.cloneWithOrOn(this.#props.joinNode, parseNotExistFilter(arg)),
|
|
93
93
|
});
|
|
94
94
|
}
|
|
95
95
|
toOperationNode() {
|
|
@@ -2,7 +2,6 @@ import { OnConflictNode } from '../operation-node/on-conflict-node.js';
|
|
|
2
2
|
import { OperationNodeSource } from '../operation-node/operation-node-source.js';
|
|
3
3
|
import { ComplexExpression } from '../parser/complex-expression-parser.js';
|
|
4
4
|
import { WhereGrouper, FilterOperator, FilterValueExpressionOrList } from '../parser/filter-parser.js';
|
|
5
|
-
import { ParseContext } from '../parser/parse-context.js';
|
|
6
5
|
import { ReferenceExpression } from '../parser/reference-parser.js';
|
|
7
6
|
import { MutationObject } from '../parser/update-set-parser.js';
|
|
8
7
|
import { AnyColumn, AnyRawBuilder } from '../util/type-utils.js';
|
|
@@ -70,7 +69,7 @@ export declare class OnConflictBuilder<DB, TB extends keyof DB> implements Where
|
|
|
70
69
|
* ```
|
|
71
70
|
*
|
|
72
71
|
* Operator can be any supported operator or if the typings don't support it
|
|
73
|
-
* you can always use `
|
|
72
|
+
* you can always use `sql\`your operator\``.
|
|
74
73
|
*
|
|
75
74
|
* ```ts
|
|
76
75
|
* const persons = await db
|
|
@@ -140,7 +139,7 @@ export declare class OnConflictBuilder<DB, TB extends keyof DB> implements Where
|
|
|
140
139
|
*
|
|
141
140
|
* A `where in` query can be built by using the `in` operator and an array
|
|
142
141
|
* of values. The values in the array can also be subqueries or raw
|
|
143
|
-
*
|
|
142
|
+
* {@link sql} expressions.
|
|
144
143
|
*
|
|
145
144
|
* ```ts
|
|
146
145
|
* const persons = await db
|
|
@@ -156,15 +155,17 @@ export declare class OnConflictBuilder<DB, TB extends keyof DB> implements Where
|
|
|
156
155
|
* select * from "person" where "id" in ($1, $2, $3)
|
|
157
156
|
* ```
|
|
158
157
|
*
|
|
159
|
-
* If everything else fails, you can always
|
|
158
|
+
* If everything else fails, you can always use the {@link sql} tag
|
|
160
159
|
* as any of the arguments, including the operator:
|
|
161
160
|
*
|
|
162
161
|
* ```ts
|
|
162
|
+
* import { sql } from 'kysely'
|
|
163
|
+
*
|
|
163
164
|
* const persons = await db
|
|
164
165
|
* .selectFrom('person')
|
|
165
166
|
* .selectAll()
|
|
166
167
|
* .where(
|
|
167
|
-
*
|
|
168
|
+
* sql`coalesce(first_name, last_name)`,
|
|
168
169
|
* 'like',
|
|
169
170
|
* '%' + name + '%',
|
|
170
171
|
* )
|
|
@@ -199,24 +200,25 @@ export declare class OnConflictBuilder<DB, TB extends keyof DB> implements Where
|
|
|
199
200
|
* ```
|
|
200
201
|
*
|
|
201
202
|
* In all examples above the columns were known at compile time
|
|
202
|
-
* (except for the
|
|
203
|
-
* you to refer to columns that exist in the database **and**
|
|
204
|
-
* referred to in the current query and context.
|
|
203
|
+
* (except for the raw {@link sql} expressions). By default kysely only
|
|
204
|
+
* allows you to refer to columns that exist in the database **and**
|
|
205
|
+
* can be referred to in the current query and context.
|
|
205
206
|
*
|
|
206
207
|
* Sometimes you may want to refer to columns that come from the user
|
|
207
208
|
* input and thus are not available at compile time.
|
|
208
209
|
*
|
|
209
|
-
* You have two options,
|
|
210
|
+
* You have two options, the {@link sql} tag or `db.dynamic`. The example below
|
|
210
211
|
* uses both:
|
|
211
212
|
*
|
|
212
213
|
* ```ts
|
|
214
|
+
* import { sql } from 'kysely'
|
|
213
215
|
* const { ref } = db.dynamic
|
|
214
216
|
*
|
|
215
217
|
* const persons = await db
|
|
216
218
|
* .selectFrom('person')
|
|
217
219
|
* .selectAll()
|
|
218
220
|
* .where(ref(columnFromUserInput), '=', 1)
|
|
219
|
-
* .orWhere(
|
|
221
|
+
* .orWhere(sql.id(columnFromUserInput), '=', 2)
|
|
220
222
|
* .execute()
|
|
221
223
|
* ```
|
|
222
224
|
*/
|
|
@@ -381,7 +383,6 @@ export declare class OnConflictBuilder<DB, TB extends keyof DB> implements Where
|
|
|
381
383
|
}
|
|
382
384
|
export interface OnConflictBuilderProps {
|
|
383
385
|
readonly onConflictNode: OnConflictNode;
|
|
384
|
-
readonly parseContext: ParseContext;
|
|
385
386
|
}
|
|
386
387
|
export declare type OnConflictDatabase<DB, TB extends keyof DB> = {
|
|
387
388
|
[K in keyof DB | 'excluded']: K extends keyof DB ? DB[K] : DB[TB];
|
|
@@ -425,7 +426,7 @@ export declare class OnConflictUpdateBuilder<DB, TB extends keyof DB> implements
|
|
|
425
426
|
* ```
|
|
426
427
|
*
|
|
427
428
|
* Operator can be any supported operator or if the typings don't support it
|
|
428
|
-
* you can always use `
|
|
429
|
+
* you can always use `sql\`your operator\``.
|
|
429
430
|
*
|
|
430
431
|
* ```ts
|
|
431
432
|
* const persons = await db
|
|
@@ -495,7 +496,7 @@ export declare class OnConflictUpdateBuilder<DB, TB extends keyof DB> implements
|
|
|
495
496
|
*
|
|
496
497
|
* A `where in` query can be built by using the `in` operator and an array
|
|
497
498
|
* of values. The values in the array can also be subqueries or raw
|
|
498
|
-
*
|
|
499
|
+
* {@link sql} expressions.
|
|
499
500
|
*
|
|
500
501
|
* ```ts
|
|
501
502
|
* const persons = await db
|
|
@@ -511,15 +512,17 @@ export declare class OnConflictUpdateBuilder<DB, TB extends keyof DB> implements
|
|
|
511
512
|
* select * from "person" where "id" in ($1, $2, $3)
|
|
512
513
|
* ```
|
|
513
514
|
*
|
|
514
|
-
* If everything else fails, you can always
|
|
515
|
+
* If everything else fails, you can always use the {@link sql} tag
|
|
515
516
|
* as any of the arguments, including the operator:
|
|
516
517
|
*
|
|
517
518
|
* ```ts
|
|
519
|
+
* import { sql } from 'kysely'
|
|
520
|
+
*
|
|
518
521
|
* const persons = await db
|
|
519
522
|
* .selectFrom('person')
|
|
520
523
|
* .selectAll()
|
|
521
524
|
* .where(
|
|
522
|
-
*
|
|
525
|
+
* sql`coalesce(first_name, last_name)`,
|
|
523
526
|
* 'like',
|
|
524
527
|
* '%' + name + '%',
|
|
525
528
|
* )
|
|
@@ -554,24 +557,25 @@ export declare class OnConflictUpdateBuilder<DB, TB extends keyof DB> implements
|
|
|
554
557
|
* ```
|
|
555
558
|
*
|
|
556
559
|
* In all examples above the columns were known at compile time
|
|
557
|
-
* (except for the
|
|
558
|
-
* you to refer to columns that exist in the database **and**
|
|
559
|
-
* referred to in the current query and context.
|
|
560
|
+
* (except for the raw {@link sql} expressions). By default kysely only
|
|
561
|
+
* allows you to refer to columns that exist in the database **and**
|
|
562
|
+
* can be referred to in the current query and context.
|
|
560
563
|
*
|
|
561
564
|
* Sometimes you may want to refer to columns that come from the user
|
|
562
565
|
* input and thus are not available at compile time.
|
|
563
566
|
*
|
|
564
|
-
* You have two options,
|
|
567
|
+
* You have two options, the {@link sql} tag or `db.dynamic`. The example below
|
|
565
568
|
* uses both:
|
|
566
569
|
*
|
|
567
570
|
* ```ts
|
|
571
|
+
* import { sql } from 'kysely'
|
|
568
572
|
* const { ref } = db.dynamic
|
|
569
573
|
*
|
|
570
574
|
* const persons = await db
|
|
571
575
|
* .selectFrom('person')
|
|
572
576
|
* .selectAll()
|
|
573
577
|
* .where(ref(columnFromUserInput), '=', 1)
|
|
574
|
-
* .orWhere(
|
|
578
|
+
* .orWhere(sql.id(columnFromUserInput), '=', 2)
|
|
575
579
|
* .execute()
|
|
576
580
|
* ```
|
|
577
581
|
*/
|
|
@@ -78,7 +78,7 @@ export class OnConflictBuilder {
|
|
|
78
78
|
where(...args) {
|
|
79
79
|
return new OnConflictBuilder({
|
|
80
80
|
...this.#props,
|
|
81
|
-
onConflictNode: OnConflictNode.cloneWithIndexWhere(this.#props.onConflictNode, parseWhereFilter(
|
|
81
|
+
onConflictNode: OnConflictNode.cloneWithIndexWhere(this.#props.onConflictNode, parseWhereFilter(args)),
|
|
82
82
|
});
|
|
83
83
|
}
|
|
84
84
|
/**
|
|
@@ -89,13 +89,13 @@ export class OnConflictBuilder {
|
|
|
89
89
|
whereRef(lhs, op, rhs) {
|
|
90
90
|
return new OnConflictBuilder({
|
|
91
91
|
...this.#props,
|
|
92
|
-
onConflictNode: OnConflictNode.cloneWithIndexWhere(this.#props.onConflictNode, parseReferenceFilter(
|
|
92
|
+
onConflictNode: OnConflictNode.cloneWithIndexWhere(this.#props.onConflictNode, parseReferenceFilter(lhs, op, rhs)),
|
|
93
93
|
});
|
|
94
94
|
}
|
|
95
95
|
orWhere(...args) {
|
|
96
96
|
return new OnConflictBuilder({
|
|
97
97
|
...this.#props,
|
|
98
|
-
onConflictNode: OnConflictNode.cloneWithIndexOrWhere(this.#props.onConflictNode, parseWhereFilter(
|
|
98
|
+
onConflictNode: OnConflictNode.cloneWithIndexOrWhere(this.#props.onConflictNode, parseWhereFilter(args)),
|
|
99
99
|
});
|
|
100
100
|
}
|
|
101
101
|
/**
|
|
@@ -106,7 +106,7 @@ export class OnConflictBuilder {
|
|
|
106
106
|
orWhereRef(lhs, op, rhs) {
|
|
107
107
|
return new OnConflictBuilder({
|
|
108
108
|
...this.#props,
|
|
109
|
-
onConflictNode: OnConflictNode.cloneWithIndexOrWhere(this.#props.onConflictNode, parseReferenceFilter(
|
|
109
|
+
onConflictNode: OnConflictNode.cloneWithIndexOrWhere(this.#props.onConflictNode, parseReferenceFilter(lhs, op, rhs)),
|
|
110
110
|
});
|
|
111
111
|
}
|
|
112
112
|
/**
|
|
@@ -117,7 +117,7 @@ export class OnConflictBuilder {
|
|
|
117
117
|
whereExists(arg) {
|
|
118
118
|
return new OnConflictBuilder({
|
|
119
119
|
...this.#props,
|
|
120
|
-
onConflictNode: OnConflictNode.cloneWithIndexWhere(this.#props.onConflictNode, parseExistFilter(
|
|
120
|
+
onConflictNode: OnConflictNode.cloneWithIndexWhere(this.#props.onConflictNode, parseExistFilter(arg)),
|
|
121
121
|
});
|
|
122
122
|
}
|
|
123
123
|
/**
|
|
@@ -128,7 +128,7 @@ export class OnConflictBuilder {
|
|
|
128
128
|
whereNotExists(arg) {
|
|
129
129
|
return new OnConflictBuilder({
|
|
130
130
|
...this.#props,
|
|
131
|
-
onConflictNode: OnConflictNode.cloneWithIndexWhere(this.#props.onConflictNode, parseNotExistFilter(
|
|
131
|
+
onConflictNode: OnConflictNode.cloneWithIndexWhere(this.#props.onConflictNode, parseNotExistFilter(arg)),
|
|
132
132
|
});
|
|
133
133
|
}
|
|
134
134
|
/**
|
|
@@ -139,7 +139,7 @@ export class OnConflictBuilder {
|
|
|
139
139
|
orWhereExists(arg) {
|
|
140
140
|
return new OnConflictBuilder({
|
|
141
141
|
...this.#props,
|
|
142
|
-
onConflictNode: OnConflictNode.cloneWithIndexOrWhere(this.#props.onConflictNode, parseExistFilter(
|
|
142
|
+
onConflictNode: OnConflictNode.cloneWithIndexOrWhere(this.#props.onConflictNode, parseExistFilter(arg)),
|
|
143
143
|
});
|
|
144
144
|
}
|
|
145
145
|
/**
|
|
@@ -150,7 +150,7 @@ export class OnConflictBuilder {
|
|
|
150
150
|
orWhereNotExists(arg) {
|
|
151
151
|
return new OnConflictBuilder({
|
|
152
152
|
...this.#props,
|
|
153
|
-
onConflictNode: OnConflictNode.cloneWithIndexOrWhere(this.#props.onConflictNode, parseNotExistFilter(
|
|
153
|
+
onConflictNode: OnConflictNode.cloneWithIndexOrWhere(this.#props.onConflictNode, parseNotExistFilter(arg)),
|
|
154
154
|
});
|
|
155
155
|
}
|
|
156
156
|
/**
|
|
@@ -212,7 +212,7 @@ export class OnConflictBuilder {
|
|
|
212
212
|
return new OnConflictUpdateBuilder({
|
|
213
213
|
...this.#props,
|
|
214
214
|
onConflictNode: OnConflictNode.cloneWith(this.#props.onConflictNode, {
|
|
215
|
-
updates: parseUpdateObject(
|
|
215
|
+
updates: parseUpdateObject(updates),
|
|
216
216
|
}),
|
|
217
217
|
});
|
|
218
218
|
}
|
|
@@ -236,7 +236,7 @@ export class OnConflictUpdateBuilder {
|
|
|
236
236
|
where(...args) {
|
|
237
237
|
return new OnConflictUpdateBuilder({
|
|
238
238
|
...this.#props,
|
|
239
|
-
onConflictNode: OnConflictNode.cloneWithUpdateWhere(this.#props.onConflictNode, parseWhereFilter(
|
|
239
|
+
onConflictNode: OnConflictNode.cloneWithUpdateWhere(this.#props.onConflictNode, parseWhereFilter(args)),
|
|
240
240
|
});
|
|
241
241
|
}
|
|
242
242
|
/**
|
|
@@ -247,13 +247,13 @@ export class OnConflictUpdateBuilder {
|
|
|
247
247
|
whereRef(lhs, op, rhs) {
|
|
248
248
|
return new OnConflictUpdateBuilder({
|
|
249
249
|
...this.#props,
|
|
250
|
-
onConflictNode: OnConflictNode.cloneWithUpdateWhere(this.#props.onConflictNode, parseReferenceFilter(
|
|
250
|
+
onConflictNode: OnConflictNode.cloneWithUpdateWhere(this.#props.onConflictNode, parseReferenceFilter(lhs, op, rhs)),
|
|
251
251
|
});
|
|
252
252
|
}
|
|
253
253
|
orWhere(...args) {
|
|
254
254
|
return new OnConflictUpdateBuilder({
|
|
255
255
|
...this.#props,
|
|
256
|
-
onConflictNode: OnConflictNode.cloneWithUpdateOrWhere(this.#props.onConflictNode, parseWhereFilter(
|
|
256
|
+
onConflictNode: OnConflictNode.cloneWithUpdateOrWhere(this.#props.onConflictNode, parseWhereFilter(args)),
|
|
257
257
|
});
|
|
258
258
|
}
|
|
259
259
|
/**
|
|
@@ -264,7 +264,7 @@ export class OnConflictUpdateBuilder {
|
|
|
264
264
|
orWhereRef(lhs, op, rhs) {
|
|
265
265
|
return new OnConflictUpdateBuilder({
|
|
266
266
|
...this.#props,
|
|
267
|
-
onConflictNode: OnConflictNode.cloneWithUpdateOrWhere(this.#props.onConflictNode, parseReferenceFilter(
|
|
267
|
+
onConflictNode: OnConflictNode.cloneWithUpdateOrWhere(this.#props.onConflictNode, parseReferenceFilter(lhs, op, rhs)),
|
|
268
268
|
});
|
|
269
269
|
}
|
|
270
270
|
/**
|
|
@@ -275,7 +275,7 @@ export class OnConflictUpdateBuilder {
|
|
|
275
275
|
whereExists(arg) {
|
|
276
276
|
return new OnConflictUpdateBuilder({
|
|
277
277
|
...this.#props,
|
|
278
|
-
onConflictNode: OnConflictNode.cloneWithUpdateWhere(this.#props.onConflictNode, parseExistFilter(
|
|
278
|
+
onConflictNode: OnConflictNode.cloneWithUpdateWhere(this.#props.onConflictNode, parseExistFilter(arg)),
|
|
279
279
|
});
|
|
280
280
|
}
|
|
281
281
|
/**
|
|
@@ -286,7 +286,7 @@ export class OnConflictUpdateBuilder {
|
|
|
286
286
|
whereNotExists(arg) {
|
|
287
287
|
return new OnConflictUpdateBuilder({
|
|
288
288
|
...this.#props,
|
|
289
|
-
onConflictNode: OnConflictNode.cloneWithUpdateWhere(this.#props.onConflictNode, parseNotExistFilter(
|
|
289
|
+
onConflictNode: OnConflictNode.cloneWithUpdateWhere(this.#props.onConflictNode, parseNotExistFilter(arg)),
|
|
290
290
|
});
|
|
291
291
|
}
|
|
292
292
|
/**
|
|
@@ -297,7 +297,7 @@ export class OnConflictUpdateBuilder {
|
|
|
297
297
|
orWhereExists(arg) {
|
|
298
298
|
return new OnConflictUpdateBuilder({
|
|
299
299
|
...this.#props,
|
|
300
|
-
onConflictNode: OnConflictNode.cloneWithUpdateOrWhere(this.#props.onConflictNode, parseExistFilter(
|
|
300
|
+
onConflictNode: OnConflictNode.cloneWithUpdateOrWhere(this.#props.onConflictNode, parseExistFilter(arg)),
|
|
301
301
|
});
|
|
302
302
|
}
|
|
303
303
|
/**
|
|
@@ -308,7 +308,7 @@ export class OnConflictUpdateBuilder {
|
|
|
308
308
|
orWhereNotExists(arg) {
|
|
309
309
|
return new OnConflictUpdateBuilder({
|
|
310
310
|
...this.#props,
|
|
311
|
-
onConflictNode: OnConflictNode.cloneWithUpdateOrWhere(this.#props.onConflictNode, parseNotExistFilter(
|
|
311
|
+
onConflictNode: OnConflictNode.cloneWithUpdateOrWhere(this.#props.onConflictNode, parseNotExistFilter(arg)),
|
|
312
312
|
});
|
|
313
313
|
}
|
|
314
314
|
toOperationNode() {
|
|
@@ -45,6 +45,8 @@ export interface ReturningInterface<DB, TB extends keyof DB, O> {
|
|
|
45
45
|
* Return arbitrary expressions:
|
|
46
46
|
*
|
|
47
47
|
* ```ts
|
|
48
|
+
* import { sql } from 'kysely'
|
|
49
|
+
*
|
|
48
50
|
* const { id, full_name, first_pet_id } = await db
|
|
49
51
|
* .insertInto('person')
|
|
50
52
|
* .values({
|
|
@@ -53,7 +55,7 @@ export interface ReturningInterface<DB, TB extends keyof DB, O> {
|
|
|
53
55
|
* })
|
|
54
56
|
* .returning([
|
|
55
57
|
* 'id as id',
|
|
56
|
-
*
|
|
58
|
+
* sql<string>`concat(first_name, ' ', last_name)`.as('full_name'),
|
|
57
59
|
* (qb) => qb.selectFrom('pets').select('pet.id').limit(1).as('first_pet_id')
|
|
58
60
|
* ])
|
|
59
61
|
* .executeTakeFirst()
|
|
@@ -12,7 +12,6 @@ import { OrderByDirectionExpression, OrderByExpression } from '../parser/order-b
|
|
|
12
12
|
import { Compilable } from '../util/compilable.js';
|
|
13
13
|
import { QueryExecutor } from '../query-executor/query-executor.js';
|
|
14
14
|
import { QueryId } from '../util/query-id.js';
|
|
15
|
-
import { ParseContext } from '../parser/parse-context.js';
|
|
16
15
|
import { UnionExpression } from '../parser/union-parser.js';
|
|
17
16
|
import { KyselyPlugin } from '../plugin/kysely-plugin.js';
|
|
18
17
|
import { WhereInterface } from './where-interface.js';
|
|
@@ -46,7 +45,7 @@ export declare class SelectQueryBuilder<DB, TB extends keyof DB, O> implements W
|
|
|
46
45
|
* ```
|
|
47
46
|
*
|
|
48
47
|
* Operator can be any supported operator or if the typings don't support it
|
|
49
|
-
* you can always use `
|
|
48
|
+
* you can always use `sql\`your operator\``.
|
|
50
49
|
*
|
|
51
50
|
* ```ts
|
|
52
51
|
* const persons = await db
|
|
@@ -116,7 +115,7 @@ export declare class SelectQueryBuilder<DB, TB extends keyof DB, O> implements W
|
|
|
116
115
|
*
|
|
117
116
|
* A `where in` query can be built by using the `in` operator and an array
|
|
118
117
|
* of values. The values in the array can also be subqueries or raw
|
|
119
|
-
*
|
|
118
|
+
* {@link sql} expressions.
|
|
120
119
|
*
|
|
121
120
|
* ```ts
|
|
122
121
|
* const persons = await db
|
|
@@ -132,15 +131,17 @@ export declare class SelectQueryBuilder<DB, TB extends keyof DB, O> implements W
|
|
|
132
131
|
* select * from "person" where "id" in ($1, $2, $3)
|
|
133
132
|
* ```
|
|
134
133
|
*
|
|
135
|
-
* If everything else fails, you can always
|
|
134
|
+
* If everything else fails, you can always use the {@link sql} tag
|
|
136
135
|
* as any of the arguments, including the operator:
|
|
137
136
|
*
|
|
138
137
|
* ```ts
|
|
138
|
+
* import { sql } from 'kysely'
|
|
139
|
+
*
|
|
139
140
|
* const persons = await db
|
|
140
141
|
* .selectFrom('person')
|
|
141
142
|
* .selectAll()
|
|
142
143
|
* .where(
|
|
143
|
-
*
|
|
144
|
+
* sql`coalesce(first_name, last_name)`,
|
|
144
145
|
* 'like',
|
|
145
146
|
* '%' + name + '%',
|
|
146
147
|
* )
|
|
@@ -175,24 +176,25 @@ export declare class SelectQueryBuilder<DB, TB extends keyof DB, O> implements W
|
|
|
175
176
|
* ```
|
|
176
177
|
*
|
|
177
178
|
* In all examples above the columns were known at compile time
|
|
178
|
-
* (except for the
|
|
179
|
-
* you to refer to columns that exist in the database **and**
|
|
180
|
-
* referred to in the current query and context.
|
|
179
|
+
* (except for the raw {@link sql} expressions). By default kysely only
|
|
180
|
+
* allows you to refer to columns that exist in the database **and**
|
|
181
|
+
* can be referred to in the current query and context.
|
|
181
182
|
*
|
|
182
183
|
* Sometimes you may want to refer to columns that come from the user
|
|
183
184
|
* input and thus are not available at compile time.
|
|
184
185
|
*
|
|
185
|
-
* You have two options,
|
|
186
|
+
* You have two options, the {@link sql} tag or `db.dynamic`. The example below
|
|
186
187
|
* uses both:
|
|
187
188
|
*
|
|
188
189
|
* ```ts
|
|
190
|
+
* import { sql } from 'kysely'
|
|
189
191
|
* const { ref } = db.dynamic
|
|
190
192
|
*
|
|
191
193
|
* const persons = await db
|
|
192
194
|
* .selectFrom('person')
|
|
193
195
|
* .selectAll()
|
|
194
196
|
* .where(ref(columnFromUserInput), '=', 1)
|
|
195
|
-
* .orWhere(
|
|
197
|
+
* .orWhere(sql.id(columnFromUserInput), '=', 2)
|
|
196
198
|
* .execute()
|
|
197
199
|
* ```
|
|
198
200
|
*/
|
|
@@ -326,13 +328,14 @@ export declare class SelectQueryBuilder<DB, TB extends keyof DB, O> implements W
|
|
|
326
328
|
/**
|
|
327
329
|
* Adds a `where exists` clause to the query.
|
|
328
330
|
*
|
|
329
|
-
* You can either use a subquery or a raw
|
|
331
|
+
* You can either use a subquery or a raw {@link sql} snippet.
|
|
330
332
|
*
|
|
331
333
|
* ### Examples
|
|
332
334
|
*
|
|
333
335
|
* The query below selets all persons that own a pet named Catto:
|
|
334
336
|
*
|
|
335
337
|
* ```ts
|
|
338
|
+
* const petName = 'Catto'
|
|
336
339
|
* const persons = await db
|
|
337
340
|
* .selectFrom('person')
|
|
338
341
|
* .selectAll()
|
|
@@ -340,7 +343,7 @@ export declare class SelectQueryBuilder<DB, TB extends keyof DB, O> implements W
|
|
|
340
343
|
* .selectFrom('pet')
|
|
341
344
|
* .select('pet.id')
|
|
342
345
|
* .whereRef('person.id', '=', 'pet.owner_id')
|
|
343
|
-
* .where('pet.name', '=',
|
|
346
|
+
* .where('pet.name', '=', petName)
|
|
344
347
|
* )
|
|
345
348
|
* .execute()
|
|
346
349
|
* ```
|
|
@@ -357,16 +360,16 @@ export declare class SelectQueryBuilder<DB, TB extends keyof DB, O> implements W
|
|
|
357
360
|
* )
|
|
358
361
|
* ```
|
|
359
362
|
*
|
|
360
|
-
* The same query as in the previous example but with using raw:
|
|
363
|
+
* The same query as in the previous example but with using raw {@link sql}:
|
|
361
364
|
*
|
|
362
365
|
* ```ts
|
|
366
|
+
* import { sql } from 'kysely'
|
|
367
|
+
*
|
|
368
|
+
* const petName = 'Catto'
|
|
363
369
|
* db.selectFrom('person')
|
|
364
370
|
* .selectAll()
|
|
365
371
|
* .whereExists(
|
|
366
|
-
*
|
|
367
|
-
* '(select pet.id from pet where person.id = pet.owner_id and pet.name = ?)',
|
|
368
|
-
* ['Catto']
|
|
369
|
-
* )
|
|
372
|
+
* sql`(select pet.id from pet where person.id = pet.owner_id and pet.name = ${petName})`
|
|
370
373
|
* )
|
|
371
374
|
* ```
|
|
372
375
|
*
|
|
@@ -449,7 +452,7 @@ export declare class SelectQueryBuilder<DB, TB extends keyof DB, O> implements W
|
|
|
449
452
|
* Kysely only allows you to select columns and expressions that exist and would
|
|
450
453
|
* produce valid SQL. However, Kysely is not perfect and there may be cases where
|
|
451
454
|
* the type inference doesn't work and you need to override it. You can always
|
|
452
|
-
* use the {@link Kysely.dynamic | dynamic} module and {@link
|
|
455
|
+
* use the {@link Kysely.dynamic | dynamic} module and the {@link sql} tag
|
|
453
456
|
* to override the types.
|
|
454
457
|
*
|
|
455
458
|
* Select calls are additive. Calling `select('id').select('first_name')` is the
|
|
@@ -536,11 +539,13 @@ export declare class SelectQueryBuilder<DB, TB extends keyof DB, O> implements W
|
|
|
536
539
|
* from "person"
|
|
537
540
|
* ```
|
|
538
541
|
*
|
|
539
|
-
* You can also select subqueries and raw expressions. Note that you
|
|
542
|
+
* You can also select subqueries and raw sql expressions. Note that you
|
|
540
543
|
* always need to give a name for the selections using the `as`
|
|
541
544
|
* method:
|
|
542
545
|
*
|
|
543
546
|
* ```ts
|
|
547
|
+
* import { sql } from 'kysely'
|
|
548
|
+
*
|
|
544
549
|
* const persons = await db.selectFrom('person')
|
|
545
550
|
* .select([
|
|
546
551
|
* (qb) => qb
|
|
@@ -549,7 +554,7 @@ export declare class SelectQueryBuilder<DB, TB extends keyof DB, O> implements W
|
|
|
549
554
|
* .select('pet.name')
|
|
550
555
|
* .limit(1)
|
|
551
556
|
* .as('pet_name')
|
|
552
|
-
*
|
|
557
|
+
* sql<string>`concat(first_name, ' ', last_name)`.as('full_name')
|
|
553
558
|
* ])
|
|
554
559
|
* .execute()
|
|
555
560
|
*
|
|
@@ -571,7 +576,7 @@ export declare class SelectQueryBuilder<DB, TB extends keyof DB, O> implements W
|
|
|
571
576
|
* from "person"
|
|
572
577
|
* ```
|
|
573
578
|
*
|
|
574
|
-
* In case you use
|
|
579
|
+
* In case you use the {@link sql} tag you need to specify the type of the expression
|
|
575
580
|
* (in this example `string`).
|
|
576
581
|
*
|
|
577
582
|
* All the examples above assume you know the column names at compile time.
|
|
@@ -889,10 +894,12 @@ export declare class SelectQueryBuilder<DB, TB extends keyof DB, O> implements W
|
|
|
889
894
|
* order by "id" asc, "fn" desc
|
|
890
895
|
* ```
|
|
891
896
|
*
|
|
892
|
-
* The order by expression can also be a
|
|
897
|
+
* The order by expression can also be a raw sql expression or a subquery
|
|
893
898
|
* in addition to column references:
|
|
894
899
|
*
|
|
895
900
|
* ```ts
|
|
901
|
+
* import { sql } from 'kysely'
|
|
902
|
+
*
|
|
896
903
|
* await db
|
|
897
904
|
* .selectFrom('person')
|
|
898
905
|
* .selectAll()
|
|
@@ -902,7 +909,7 @@ export declare class SelectQueryBuilder<DB, TB extends keyof DB, O> implements W
|
|
|
902
909
|
* .limit(1)
|
|
903
910
|
* )
|
|
904
911
|
* .orderBy(
|
|
905
|
-
*
|
|
912
|
+
* sql`concat(first_name, last_name)`
|
|
906
913
|
* )
|
|
907
914
|
* .execute()
|
|
908
915
|
* ```
|
|
@@ -953,11 +960,13 @@ export declare class SelectQueryBuilder<DB, TB extends keyof DB, O> implements W
|
|
|
953
960
|
* ### Examples
|
|
954
961
|
*
|
|
955
962
|
* ```ts
|
|
963
|
+
* import { sql } from 'kysely'
|
|
964
|
+
*
|
|
956
965
|
* await db
|
|
957
966
|
* .selectFrom('person')
|
|
958
967
|
* .select([
|
|
959
968
|
* 'first_name',
|
|
960
|
-
*
|
|
969
|
+
* sql`max(id)`.as('max_id')
|
|
961
970
|
* ])
|
|
962
971
|
* .groupBy('first_name')
|
|
963
972
|
* .execute()
|
|
@@ -974,12 +983,14 @@ export declare class SelectQueryBuilder<DB, TB extends keyof DB, O> implements W
|
|
|
974
983
|
* `groupBy` also accepts an array:
|
|
975
984
|
*
|
|
976
985
|
* ```ts
|
|
986
|
+
* import { sql } from 'kysely'
|
|
987
|
+
*
|
|
977
988
|
* await db
|
|
978
989
|
* .selectFrom('person')
|
|
979
990
|
* .select([
|
|
980
991
|
* 'first_name',
|
|
981
992
|
* 'last_name',
|
|
982
|
-
*
|
|
993
|
+
* sql`max(id)`.as('max_id')
|
|
983
994
|
* ])
|
|
984
995
|
* .groupBy([
|
|
985
996
|
* 'first_name',
|
|
@@ -997,18 +1008,20 @@ export declare class SelectQueryBuilder<DB, TB extends keyof DB, O> implements W
|
|
|
997
1008
|
* ```
|
|
998
1009
|
*
|
|
999
1010
|
* The group by expressions can also be subqueries or
|
|
1000
|
-
* raw expressions:
|
|
1011
|
+
* raw sql expressions:
|
|
1001
1012
|
*
|
|
1002
1013
|
* ```ts
|
|
1014
|
+
* import { sql } from 'kysely'
|
|
1015
|
+
*
|
|
1003
1016
|
* await db
|
|
1004
1017
|
* .selectFrom('person')
|
|
1005
1018
|
* .select([
|
|
1006
1019
|
* 'first_name',
|
|
1007
1020
|
* 'last_name',
|
|
1008
|
-
*
|
|
1021
|
+
* sql`max(id)`.as('max_id')
|
|
1009
1022
|
* ])
|
|
1010
1023
|
* .groupBy([
|
|
1011
|
-
*
|
|
1024
|
+
* sql`concat(first_name, last_name)`,
|
|
1012
1025
|
* (qb) => qb.selectFrom('pet').select('id').limit(1)
|
|
1013
1026
|
* ])
|
|
1014
1027
|
* .execute()
|
|
@@ -1242,7 +1255,6 @@ export interface SelectQueryBuilderProps {
|
|
|
1242
1255
|
readonly queryId: QueryId;
|
|
1243
1256
|
readonly queryNode: SelectQueryNode;
|
|
1244
1257
|
readonly executor: QueryExecutor;
|
|
1245
|
-
readonly parseContext: ParseContext;
|
|
1246
1258
|
}
|
|
1247
1259
|
/**
|
|
1248
1260
|
* {@link SelectQueryBuilder} with an alias. The result of calling {@link SelectQueryBuilder.as}.
|