kysely 0.28.14 → 0.28.15
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/cjs/dialect/postgres/postgres-introspector.js +21 -19
- package/dist/cjs/migration/file-migration-provider.js +34 -1
- package/dist/cjs/query-builder/delete-query-builder.js +24 -22
- package/dist/cjs/query-builder/select-query-builder.js +43 -41
- package/dist/cjs/query-builder/update-query-builder.js +24 -22
- package/dist/cjs/util/column-type.d.ts +54 -0
- package/dist/cjs/util/type-utils.d.ts +1 -1
- package/dist/esm/dialect/postgres/postgres-introspector.js +21 -19
- package/dist/esm/query-builder/delete-query-builder.js +24 -22
- package/dist/esm/query-builder/select-query-builder.js +43 -41
- package/dist/esm/query-builder/update-query-builder.js +24 -22
- package/dist/esm/util/column-type.d.ts +54 -0
- package/dist/esm/util/type-utils.d.ts +1 -1
- package/package.json +10 -9
|
@@ -73,28 +73,30 @@ class PostgresIntrospector {
|
|
|
73
73
|
};
|
|
74
74
|
}
|
|
75
75
|
#parseTableMetadata(columns) {
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
76
|
+
const tableDictionary = new Map();
|
|
77
|
+
for (let i = 0, len = columns.length; i < len; i++) {
|
|
78
|
+
const column = columns[i];
|
|
79
|
+
const { schema, table } = column;
|
|
80
|
+
const tableKey = `schema:${schema};table:${table}`;
|
|
81
|
+
if (!tableDictionary.has(tableKey)) {
|
|
82
|
+
tableDictionary.set(tableKey, (0, object_utils_js_1.freeze)({
|
|
83
83
|
columns: [],
|
|
84
|
-
|
|
85
|
-
|
|
84
|
+
isView: column.table_type === 'v',
|
|
85
|
+
name: table,
|
|
86
|
+
schema,
|
|
87
|
+
}));
|
|
86
88
|
}
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
dataType:
|
|
90
|
-
dataTypeSchema:
|
|
91
|
-
|
|
92
|
-
isAutoIncrementing:
|
|
93
|
-
|
|
94
|
-
|
|
89
|
+
tableDictionary.get(tableKey).columns.push((0, object_utils_js_1.freeze)({
|
|
90
|
+
comment: column.column_description ?? undefined,
|
|
91
|
+
dataType: column.type,
|
|
92
|
+
dataTypeSchema: column.type_schema,
|
|
93
|
+
hasDefaultValue: column.has_default,
|
|
94
|
+
isAutoIncrementing: column.auto_incrementing !== null,
|
|
95
|
+
isNullable: !column.not_null,
|
|
96
|
+
name: column.column,
|
|
95
97
|
}));
|
|
96
|
-
|
|
97
|
-
|
|
98
|
+
}
|
|
99
|
+
return Array.from(tableDictionary.values());
|
|
98
100
|
}
|
|
99
101
|
}
|
|
100
102
|
exports.PostgresIntrospector = PostgresIntrospector;
|
|
@@ -1,4 +1,37 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
2
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
36
|
exports.FileMigrationProvider = void 0;
|
|
4
37
|
const object_utils_js_1 = require("../util/object-utils.js");
|
|
@@ -32,7 +65,7 @@ class FileMigrationProvider {
|
|
|
32
65
|
fileName.endsWith('.mjs') ||
|
|
33
66
|
(fileName.endsWith('.mts') && !fileName.endsWith('.d.mts'))) {
|
|
34
67
|
const migration = await Promise.resolve(`${
|
|
35
|
-
/* webpackIgnore: true */ this.#props.path.join(this.#props.migrationFolder, fileName)}`).then(s => require(s));
|
|
68
|
+
/* webpackIgnore: true */ this.#props.path.join(this.#props.migrationFolder, fileName)}`).then(s => __importStar(require(s)));
|
|
36
69
|
const migrationKey = fileName.substring(0, fileName.lastIndexOf('.'));
|
|
37
70
|
// Handle esModuleInterop export's `default` prop...
|
|
38
71
|
if (isMigration(migration?.default)) {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var _a;
|
|
2
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
4
|
exports.DeleteQueryBuilder = void 0;
|
|
4
5
|
const join_parser_js_1 = require("../parser/join-parser.js");
|
|
@@ -20,19 +21,19 @@ class DeleteQueryBuilder {
|
|
|
20
21
|
this.#props = (0, object_utils_js_1.freeze)(props);
|
|
21
22
|
}
|
|
22
23
|
where(...args) {
|
|
23
|
-
return new
|
|
24
|
+
return new _a({
|
|
24
25
|
...this.#props,
|
|
25
26
|
queryNode: query_node_js_1.QueryNode.cloneWithWhere(this.#props.queryNode, (0, binary_operation_parser_js_1.parseValueBinaryOperationOrExpression)(args)),
|
|
26
27
|
});
|
|
27
28
|
}
|
|
28
29
|
whereRef(lhs, op, rhs) {
|
|
29
|
-
return new
|
|
30
|
+
return new _a({
|
|
30
31
|
...this.#props,
|
|
31
32
|
queryNode: query_node_js_1.QueryNode.cloneWithWhere(this.#props.queryNode, (0, binary_operation_parser_js_1.parseReferentialBinaryOperation)(lhs, op, rhs)),
|
|
32
33
|
});
|
|
33
34
|
}
|
|
34
35
|
clearWhere() {
|
|
35
|
-
return new
|
|
36
|
+
return new _a({
|
|
36
37
|
...this.#props,
|
|
37
38
|
queryNode: query_node_js_1.QueryNode.cloneWithoutWhere(this.#props.queryNode),
|
|
38
39
|
});
|
|
@@ -77,13 +78,13 @@ class DeleteQueryBuilder {
|
|
|
77
78
|
* ```
|
|
78
79
|
*/
|
|
79
80
|
top(expression, modifiers) {
|
|
80
|
-
return new
|
|
81
|
+
return new _a({
|
|
81
82
|
...this.#props,
|
|
82
83
|
queryNode: query_node_js_1.QueryNode.cloneWithTop(this.#props.queryNode, (0, top_parser_js_1.parseTop)(expression, modifiers)),
|
|
83
84
|
});
|
|
84
85
|
}
|
|
85
86
|
using(tables) {
|
|
86
|
-
return new
|
|
87
|
+
return new _a({
|
|
87
88
|
...this.#props,
|
|
88
89
|
queryNode: delete_query_node_js_1.DeleteQueryNode.cloneWithUsing(this.#props.queryNode, (0, table_parser_js_1.parseTableExpressionOrList)(tables)),
|
|
89
90
|
});
|
|
@@ -101,31 +102,31 @@ class DeleteQueryBuilder {
|
|
|
101
102
|
return this.#join('FullJoin', args);
|
|
102
103
|
}
|
|
103
104
|
#join(joinType, args) {
|
|
104
|
-
return new
|
|
105
|
+
return new _a({
|
|
105
106
|
...this.#props,
|
|
106
107
|
queryNode: query_node_js_1.QueryNode.cloneWithJoin(this.#props.queryNode, (0, join_parser_js_1.parseJoin)(joinType, args)),
|
|
107
108
|
});
|
|
108
109
|
}
|
|
109
110
|
returning(selection) {
|
|
110
|
-
return new
|
|
111
|
+
return new _a({
|
|
111
112
|
...this.#props,
|
|
112
113
|
queryNode: query_node_js_1.QueryNode.cloneWithReturning(this.#props.queryNode, (0, select_parser_js_1.parseSelectArg)(selection)),
|
|
113
114
|
});
|
|
114
115
|
}
|
|
115
116
|
returningAll(table) {
|
|
116
|
-
return new
|
|
117
|
+
return new _a({
|
|
117
118
|
...this.#props,
|
|
118
119
|
queryNode: query_node_js_1.QueryNode.cloneWithReturning(this.#props.queryNode, (0, select_parser_js_1.parseSelectAll)(table)),
|
|
119
120
|
});
|
|
120
121
|
}
|
|
121
122
|
output(args) {
|
|
122
|
-
return new
|
|
123
|
+
return new _a({
|
|
123
124
|
...this.#props,
|
|
124
125
|
queryNode: query_node_js_1.QueryNode.cloneWithOutput(this.#props.queryNode, (0, select_parser_js_1.parseSelectArg)(args)),
|
|
125
126
|
});
|
|
126
127
|
}
|
|
127
128
|
outputAll(table) {
|
|
128
|
-
return new
|
|
129
|
+
return new _a({
|
|
129
130
|
...this.#props,
|
|
130
131
|
queryNode: query_node_js_1.QueryNode.cloneWithOutput(this.#props.queryNode, (0, select_parser_js_1.parseSelectAll)(table)),
|
|
131
132
|
});
|
|
@@ -150,7 +151,7 @@ class DeleteQueryBuilder {
|
|
|
150
151
|
* ```
|
|
151
152
|
*/
|
|
152
153
|
clearReturning() {
|
|
153
|
-
return new
|
|
154
|
+
return new _a({
|
|
154
155
|
...this.#props,
|
|
155
156
|
queryNode: query_node_js_1.QueryNode.cloneWithoutReturning(this.#props.queryNode),
|
|
156
157
|
});
|
|
@@ -176,19 +177,19 @@ class DeleteQueryBuilder {
|
|
|
176
177
|
* ```
|
|
177
178
|
*/
|
|
178
179
|
clearLimit() {
|
|
179
|
-
return new
|
|
180
|
+
return new _a({
|
|
180
181
|
...this.#props,
|
|
181
182
|
queryNode: delete_query_node_js_1.DeleteQueryNode.cloneWithoutLimit(this.#props.queryNode),
|
|
182
183
|
});
|
|
183
184
|
}
|
|
184
185
|
orderBy(...args) {
|
|
185
|
-
return new
|
|
186
|
+
return new _a({
|
|
186
187
|
...this.#props,
|
|
187
188
|
queryNode: query_node_js_1.QueryNode.cloneWithOrderByItems(this.#props.queryNode, (0, order_by_parser_js_1.parseOrderBy)(args)),
|
|
188
189
|
});
|
|
189
190
|
}
|
|
190
191
|
clearOrderBy() {
|
|
191
|
-
return new
|
|
192
|
+
return new _a({
|
|
192
193
|
...this.#props,
|
|
193
194
|
queryNode: query_node_js_1.QueryNode.cloneWithoutOrderBy(this.#props.queryNode),
|
|
194
195
|
});
|
|
@@ -218,7 +219,7 @@ class DeleteQueryBuilder {
|
|
|
218
219
|
* ```
|
|
219
220
|
*/
|
|
220
221
|
limit(limit) {
|
|
221
|
-
return new
|
|
222
|
+
return new _a({
|
|
222
223
|
...this.#props,
|
|
223
224
|
queryNode: delete_query_node_js_1.DeleteQueryNode.cloneWithLimit(this.#props.queryNode, limit_node_js_1.LimitNode.create((0, value_parser_js_1.parseValueExpression)(limit))),
|
|
224
225
|
});
|
|
@@ -245,7 +246,7 @@ class DeleteQueryBuilder {
|
|
|
245
246
|
* ```
|
|
246
247
|
*/
|
|
247
248
|
modifyEnd(modifier) {
|
|
248
|
-
return new
|
|
249
|
+
return new _a({
|
|
249
250
|
...this.#props,
|
|
250
251
|
queryNode: query_node_js_1.QueryNode.cloneWithEndModifier(this.#props.queryNode, modifier.toOperationNode()),
|
|
251
252
|
});
|
|
@@ -316,7 +317,7 @@ class DeleteQueryBuilder {
|
|
|
316
317
|
if (condition) {
|
|
317
318
|
return func(this);
|
|
318
319
|
}
|
|
319
|
-
return new
|
|
320
|
+
return new _a({
|
|
320
321
|
...this.#props,
|
|
321
322
|
});
|
|
322
323
|
}
|
|
@@ -327,7 +328,7 @@ class DeleteQueryBuilder {
|
|
|
327
328
|
* returns a copy of this `DeleteQueryBuilder` with a new output type.
|
|
328
329
|
*/
|
|
329
330
|
$castTo() {
|
|
330
|
-
return new
|
|
331
|
+
return new _a(this.#props);
|
|
331
332
|
}
|
|
332
333
|
/**
|
|
333
334
|
* Narrows (parts of) the output type of the query.
|
|
@@ -379,7 +380,7 @@ class DeleteQueryBuilder {
|
|
|
379
380
|
* ```
|
|
380
381
|
*/
|
|
381
382
|
$narrowType() {
|
|
382
|
-
return new
|
|
383
|
+
return new _a(this.#props);
|
|
383
384
|
}
|
|
384
385
|
/**
|
|
385
386
|
* Asserts that query's output row type equals the given type `T`.
|
|
@@ -427,13 +428,13 @@ class DeleteQueryBuilder {
|
|
|
427
428
|
* ```
|
|
428
429
|
*/
|
|
429
430
|
$assertType() {
|
|
430
|
-
return new
|
|
431
|
+
return new _a(this.#props);
|
|
431
432
|
}
|
|
432
433
|
/**
|
|
433
434
|
* Returns a copy of this DeleteQueryBuilder instance with the given plugin installed.
|
|
434
435
|
*/
|
|
435
436
|
withPlugin(plugin) {
|
|
436
|
-
return new
|
|
437
|
+
return new _a({
|
|
437
438
|
...this.#props,
|
|
438
439
|
executor: this.#props.executor.withPlugin(plugin),
|
|
439
440
|
});
|
|
@@ -494,7 +495,7 @@ class DeleteQueryBuilder {
|
|
|
494
495
|
}
|
|
495
496
|
}
|
|
496
497
|
async explain(format, options) {
|
|
497
|
-
const builder = new
|
|
498
|
+
const builder = new _a({
|
|
498
499
|
...this.#props,
|
|
499
500
|
queryNode: query_node_js_1.QueryNode.cloneWithExplain(this.#props.queryNode, format, options),
|
|
500
501
|
});
|
|
@@ -502,3 +503,4 @@ class DeleteQueryBuilder {
|
|
|
502
503
|
}
|
|
503
504
|
}
|
|
504
505
|
exports.DeleteQueryBuilder = DeleteQueryBuilder;
|
|
506
|
+
_a = DeleteQueryBuilder;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var _a;
|
|
2
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
4
|
exports.createSelectQueryBuilder = createSelectQueryBuilder;
|
|
4
5
|
const alias_node_js_1 = require("../operation-node/alias-node.js");
|
|
@@ -34,97 +35,97 @@ class SelectQueryBuilderImpl {
|
|
|
34
35
|
return true;
|
|
35
36
|
}
|
|
36
37
|
where(...args) {
|
|
37
|
-
return new
|
|
38
|
+
return new _a({
|
|
38
39
|
...this.#props,
|
|
39
40
|
queryNode: query_node_js_1.QueryNode.cloneWithWhere(this.#props.queryNode, (0, binary_operation_parser_js_1.parseValueBinaryOperationOrExpression)(args)),
|
|
40
41
|
});
|
|
41
42
|
}
|
|
42
43
|
whereRef(lhs, op, rhs) {
|
|
43
|
-
return new
|
|
44
|
+
return new _a({
|
|
44
45
|
...this.#props,
|
|
45
46
|
queryNode: query_node_js_1.QueryNode.cloneWithWhere(this.#props.queryNode, (0, binary_operation_parser_js_1.parseReferentialBinaryOperation)(lhs, op, rhs)),
|
|
46
47
|
});
|
|
47
48
|
}
|
|
48
49
|
having(...args) {
|
|
49
|
-
return new
|
|
50
|
+
return new _a({
|
|
50
51
|
...this.#props,
|
|
51
52
|
queryNode: select_query_node_js_1.SelectQueryNode.cloneWithHaving(this.#props.queryNode, (0, binary_operation_parser_js_1.parseValueBinaryOperationOrExpression)(args)),
|
|
52
53
|
});
|
|
53
54
|
}
|
|
54
55
|
havingRef(lhs, op, rhs) {
|
|
55
|
-
return new
|
|
56
|
+
return new _a({
|
|
56
57
|
...this.#props,
|
|
57
58
|
queryNode: select_query_node_js_1.SelectQueryNode.cloneWithHaving(this.#props.queryNode, (0, binary_operation_parser_js_1.parseReferentialBinaryOperation)(lhs, op, rhs)),
|
|
58
59
|
});
|
|
59
60
|
}
|
|
60
61
|
select(selection) {
|
|
61
|
-
return new
|
|
62
|
+
return new _a({
|
|
62
63
|
...this.#props,
|
|
63
64
|
queryNode: select_query_node_js_1.SelectQueryNode.cloneWithSelections(this.#props.queryNode, (0, select_parser_js_1.parseSelectArg)(selection)),
|
|
64
65
|
});
|
|
65
66
|
}
|
|
66
67
|
distinctOn(selection) {
|
|
67
|
-
return new
|
|
68
|
+
return new _a({
|
|
68
69
|
...this.#props,
|
|
69
70
|
queryNode: select_query_node_js_1.SelectQueryNode.cloneWithDistinctOn(this.#props.queryNode, (0, reference_parser_js_1.parseReferenceExpressionOrList)(selection)),
|
|
70
71
|
});
|
|
71
72
|
}
|
|
72
73
|
modifyFront(modifier) {
|
|
73
|
-
return new
|
|
74
|
+
return new _a({
|
|
74
75
|
...this.#props,
|
|
75
76
|
queryNode: select_query_node_js_1.SelectQueryNode.cloneWithFrontModifier(this.#props.queryNode, select_modifier_node_js_1.SelectModifierNode.createWithExpression(modifier.toOperationNode())),
|
|
76
77
|
});
|
|
77
78
|
}
|
|
78
79
|
modifyEnd(modifier) {
|
|
79
|
-
return new
|
|
80
|
+
return new _a({
|
|
80
81
|
...this.#props,
|
|
81
82
|
queryNode: query_node_js_1.QueryNode.cloneWithEndModifier(this.#props.queryNode, select_modifier_node_js_1.SelectModifierNode.createWithExpression(modifier.toOperationNode())),
|
|
82
83
|
});
|
|
83
84
|
}
|
|
84
85
|
distinct() {
|
|
85
|
-
return new
|
|
86
|
+
return new _a({
|
|
86
87
|
...this.#props,
|
|
87
88
|
queryNode: select_query_node_js_1.SelectQueryNode.cloneWithFrontModifier(this.#props.queryNode, select_modifier_node_js_1.SelectModifierNode.create('Distinct')),
|
|
88
89
|
});
|
|
89
90
|
}
|
|
90
91
|
forUpdate(of) {
|
|
91
|
-
return new
|
|
92
|
+
return new _a({
|
|
92
93
|
...this.#props,
|
|
93
94
|
queryNode: query_node_js_1.QueryNode.cloneWithEndModifier(this.#props.queryNode, select_modifier_node_js_1.SelectModifierNode.create('ForUpdate', of ? (0, object_utils_js_1.asArray)(of).map(table_parser_js_1.parseTable) : undefined)),
|
|
94
95
|
});
|
|
95
96
|
}
|
|
96
97
|
forShare(of) {
|
|
97
|
-
return new
|
|
98
|
+
return new _a({
|
|
98
99
|
...this.#props,
|
|
99
100
|
queryNode: query_node_js_1.QueryNode.cloneWithEndModifier(this.#props.queryNode, select_modifier_node_js_1.SelectModifierNode.create('ForShare', of ? (0, object_utils_js_1.asArray)(of).map(table_parser_js_1.parseTable) : undefined)),
|
|
100
101
|
});
|
|
101
102
|
}
|
|
102
103
|
forKeyShare(of) {
|
|
103
|
-
return new
|
|
104
|
+
return new _a({
|
|
104
105
|
...this.#props,
|
|
105
106
|
queryNode: query_node_js_1.QueryNode.cloneWithEndModifier(this.#props.queryNode, select_modifier_node_js_1.SelectModifierNode.create('ForKeyShare', of ? (0, object_utils_js_1.asArray)(of).map(table_parser_js_1.parseTable) : undefined)),
|
|
106
107
|
});
|
|
107
108
|
}
|
|
108
109
|
forNoKeyUpdate(of) {
|
|
109
|
-
return new
|
|
110
|
+
return new _a({
|
|
110
111
|
...this.#props,
|
|
111
112
|
queryNode: query_node_js_1.QueryNode.cloneWithEndModifier(this.#props.queryNode, select_modifier_node_js_1.SelectModifierNode.create('ForNoKeyUpdate', of ? (0, object_utils_js_1.asArray)(of).map(table_parser_js_1.parseTable) : undefined)),
|
|
112
113
|
});
|
|
113
114
|
}
|
|
114
115
|
skipLocked() {
|
|
115
|
-
return new
|
|
116
|
+
return new _a({
|
|
116
117
|
...this.#props,
|
|
117
118
|
queryNode: query_node_js_1.QueryNode.cloneWithEndModifier(this.#props.queryNode, select_modifier_node_js_1.SelectModifierNode.create('SkipLocked')),
|
|
118
119
|
});
|
|
119
120
|
}
|
|
120
121
|
noWait() {
|
|
121
|
-
return new
|
|
122
|
+
return new _a({
|
|
122
123
|
...this.#props,
|
|
123
124
|
queryNode: query_node_js_1.QueryNode.cloneWithEndModifier(this.#props.queryNode, select_modifier_node_js_1.SelectModifierNode.create('NoWait')),
|
|
124
125
|
});
|
|
125
126
|
}
|
|
126
127
|
selectAll(table) {
|
|
127
|
-
return new
|
|
128
|
+
return new _a({
|
|
128
129
|
...this.#props,
|
|
129
130
|
queryNode: select_query_node_js_1.SelectQueryNode.cloneWithSelections(this.#props.queryNode, (0, select_parser_js_1.parseSelectAll)(table)),
|
|
130
131
|
});
|
|
@@ -160,79 +161,79 @@ class SelectQueryBuilderImpl {
|
|
|
160
161
|
return this.#join('OuterApply', args);
|
|
161
162
|
}
|
|
162
163
|
#join(joinType, args) {
|
|
163
|
-
return new
|
|
164
|
+
return new _a({
|
|
164
165
|
...this.#props,
|
|
165
166
|
queryNode: query_node_js_1.QueryNode.cloneWithJoin(this.#props.queryNode, (0, join_parser_js_1.parseJoin)(joinType, args)),
|
|
166
167
|
});
|
|
167
168
|
}
|
|
168
169
|
orderBy(...args) {
|
|
169
|
-
return new
|
|
170
|
+
return new _a({
|
|
170
171
|
...this.#props,
|
|
171
172
|
queryNode: query_node_js_1.QueryNode.cloneWithOrderByItems(this.#props.queryNode, (0, order_by_parser_js_1.parseOrderBy)(args)),
|
|
172
173
|
});
|
|
173
174
|
}
|
|
174
175
|
groupBy(groupBy) {
|
|
175
|
-
return new
|
|
176
|
+
return new _a({
|
|
176
177
|
...this.#props,
|
|
177
178
|
queryNode: select_query_node_js_1.SelectQueryNode.cloneWithGroupByItems(this.#props.queryNode, (0, group_by_parser_js_1.parseGroupBy)(groupBy)),
|
|
178
179
|
});
|
|
179
180
|
}
|
|
180
181
|
limit(limit) {
|
|
181
|
-
return new
|
|
182
|
+
return new _a({
|
|
182
183
|
...this.#props,
|
|
183
184
|
queryNode: select_query_node_js_1.SelectQueryNode.cloneWithLimit(this.#props.queryNode, limit_node_js_1.LimitNode.create((0, value_parser_js_1.parseValueExpression)(limit))),
|
|
184
185
|
});
|
|
185
186
|
}
|
|
186
187
|
offset(offset) {
|
|
187
|
-
return new
|
|
188
|
+
return new _a({
|
|
188
189
|
...this.#props,
|
|
189
190
|
queryNode: select_query_node_js_1.SelectQueryNode.cloneWithOffset(this.#props.queryNode, offset_node_js_1.OffsetNode.create((0, value_parser_js_1.parseValueExpression)(offset))),
|
|
190
191
|
});
|
|
191
192
|
}
|
|
192
193
|
fetch(rowCount, modifier = 'only') {
|
|
193
|
-
return new
|
|
194
|
+
return new _a({
|
|
194
195
|
...this.#props,
|
|
195
196
|
queryNode: select_query_node_js_1.SelectQueryNode.cloneWithFetch(this.#props.queryNode, (0, fetch_parser_js_1.parseFetch)(rowCount, modifier)),
|
|
196
197
|
});
|
|
197
198
|
}
|
|
198
199
|
top(expression, modifiers) {
|
|
199
|
-
return new
|
|
200
|
+
return new _a({
|
|
200
201
|
...this.#props,
|
|
201
202
|
queryNode: query_node_js_1.QueryNode.cloneWithTop(this.#props.queryNode, (0, top_parser_js_1.parseTop)(expression, modifiers)),
|
|
202
203
|
});
|
|
203
204
|
}
|
|
204
205
|
union(expression) {
|
|
205
|
-
return new
|
|
206
|
+
return new _a({
|
|
206
207
|
...this.#props,
|
|
207
208
|
queryNode: select_query_node_js_1.SelectQueryNode.cloneWithSetOperations(this.#props.queryNode, (0, set_operation_parser_js_1.parseSetOperations)('union', expression, false)),
|
|
208
209
|
});
|
|
209
210
|
}
|
|
210
211
|
unionAll(expression) {
|
|
211
|
-
return new
|
|
212
|
+
return new _a({
|
|
212
213
|
...this.#props,
|
|
213
214
|
queryNode: select_query_node_js_1.SelectQueryNode.cloneWithSetOperations(this.#props.queryNode, (0, set_operation_parser_js_1.parseSetOperations)('union', expression, true)),
|
|
214
215
|
});
|
|
215
216
|
}
|
|
216
217
|
intersect(expression) {
|
|
217
|
-
return new
|
|
218
|
+
return new _a({
|
|
218
219
|
...this.#props,
|
|
219
220
|
queryNode: select_query_node_js_1.SelectQueryNode.cloneWithSetOperations(this.#props.queryNode, (0, set_operation_parser_js_1.parseSetOperations)('intersect', expression, false)),
|
|
220
221
|
});
|
|
221
222
|
}
|
|
222
223
|
intersectAll(expression) {
|
|
223
|
-
return new
|
|
224
|
+
return new _a({
|
|
224
225
|
...this.#props,
|
|
225
226
|
queryNode: select_query_node_js_1.SelectQueryNode.cloneWithSetOperations(this.#props.queryNode, (0, set_operation_parser_js_1.parseSetOperations)('intersect', expression, true)),
|
|
226
227
|
});
|
|
227
228
|
}
|
|
228
229
|
except(expression) {
|
|
229
|
-
return new
|
|
230
|
+
return new _a({
|
|
230
231
|
...this.#props,
|
|
231
232
|
queryNode: select_query_node_js_1.SelectQueryNode.cloneWithSetOperations(this.#props.queryNode, (0, set_operation_parser_js_1.parseSetOperations)('except', expression, false)),
|
|
232
233
|
});
|
|
233
234
|
}
|
|
234
235
|
exceptAll(expression) {
|
|
235
|
-
return new
|
|
236
|
+
return new _a({
|
|
236
237
|
...this.#props,
|
|
237
238
|
queryNode: select_query_node_js_1.SelectQueryNode.cloneWithSetOperations(this.#props.queryNode, (0, set_operation_parser_js_1.parseSetOperations)('except', expression, true)),
|
|
238
239
|
});
|
|
@@ -241,37 +242,37 @@ class SelectQueryBuilderImpl {
|
|
|
241
242
|
return new AliasedSelectQueryBuilderImpl(this, alias);
|
|
242
243
|
}
|
|
243
244
|
clearSelect() {
|
|
244
|
-
return new
|
|
245
|
+
return new _a({
|
|
245
246
|
...this.#props,
|
|
246
247
|
queryNode: select_query_node_js_1.SelectQueryNode.cloneWithoutSelections(this.#props.queryNode),
|
|
247
248
|
});
|
|
248
249
|
}
|
|
249
250
|
clearWhere() {
|
|
250
|
-
return new
|
|
251
|
+
return new _a({
|
|
251
252
|
...this.#props,
|
|
252
253
|
queryNode: query_node_js_1.QueryNode.cloneWithoutWhere(this.#props.queryNode),
|
|
253
254
|
});
|
|
254
255
|
}
|
|
255
256
|
clearLimit() {
|
|
256
|
-
return new
|
|
257
|
+
return new _a({
|
|
257
258
|
...this.#props,
|
|
258
259
|
queryNode: select_query_node_js_1.SelectQueryNode.cloneWithoutLimit(this.#props.queryNode),
|
|
259
260
|
});
|
|
260
261
|
}
|
|
261
262
|
clearOffset() {
|
|
262
|
-
return new
|
|
263
|
+
return new _a({
|
|
263
264
|
...this.#props,
|
|
264
265
|
queryNode: select_query_node_js_1.SelectQueryNode.cloneWithoutOffset(this.#props.queryNode),
|
|
265
266
|
});
|
|
266
267
|
}
|
|
267
268
|
clearOrderBy() {
|
|
268
|
-
return new
|
|
269
|
+
return new _a({
|
|
269
270
|
...this.#props,
|
|
270
271
|
queryNode: query_node_js_1.QueryNode.cloneWithoutOrderBy(this.#props.queryNode),
|
|
271
272
|
});
|
|
272
273
|
}
|
|
273
274
|
clearGroupBy() {
|
|
274
|
-
return new
|
|
275
|
+
return new _a({
|
|
275
276
|
...this.#props,
|
|
276
277
|
queryNode: select_query_node_js_1.SelectQueryNode.cloneWithoutGroupBy(this.#props.queryNode),
|
|
277
278
|
});
|
|
@@ -283,18 +284,18 @@ class SelectQueryBuilderImpl {
|
|
|
283
284
|
if (condition) {
|
|
284
285
|
return func(this);
|
|
285
286
|
}
|
|
286
|
-
return new
|
|
287
|
+
return new _a({
|
|
287
288
|
...this.#props,
|
|
288
289
|
});
|
|
289
290
|
}
|
|
290
291
|
$castTo() {
|
|
291
|
-
return new
|
|
292
|
+
return new _a(this.#props);
|
|
292
293
|
}
|
|
293
294
|
$narrowType() {
|
|
294
|
-
return new
|
|
295
|
+
return new _a(this.#props);
|
|
295
296
|
}
|
|
296
297
|
$assertType() {
|
|
297
|
-
return new
|
|
298
|
+
return new _a(this.#props);
|
|
298
299
|
}
|
|
299
300
|
$asTuple() {
|
|
300
301
|
return new expression_wrapper_js_1.ExpressionWrapper(this.toOperationNode());
|
|
@@ -303,7 +304,7 @@ class SelectQueryBuilderImpl {
|
|
|
303
304
|
return new expression_wrapper_js_1.ExpressionWrapper(this.toOperationNode());
|
|
304
305
|
}
|
|
305
306
|
withPlugin(plugin) {
|
|
306
|
-
return new
|
|
307
|
+
return new _a({
|
|
307
308
|
...this.#props,
|
|
308
309
|
executor: this.#props.executor.withPlugin(plugin),
|
|
309
310
|
});
|
|
@@ -341,13 +342,14 @@ class SelectQueryBuilderImpl {
|
|
|
341
342
|
}
|
|
342
343
|
}
|
|
343
344
|
async explain(format, options) {
|
|
344
|
-
const builder = new
|
|
345
|
+
const builder = new _a({
|
|
345
346
|
...this.#props,
|
|
346
347
|
queryNode: query_node_js_1.QueryNode.cloneWithExplain(this.#props.queryNode, format, options),
|
|
347
348
|
});
|
|
348
349
|
return await builder.execute();
|
|
349
350
|
}
|
|
350
351
|
}
|
|
352
|
+
_a = SelectQueryBuilderImpl;
|
|
351
353
|
function createSelectQueryBuilder(props) {
|
|
352
354
|
return new SelectQueryBuilderImpl(props);
|
|
353
355
|
}
|