@depup/kysely 0.28.14-depup.0 → 0.28.16-depup.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/changes.json +1 -1
- package/dist/cjs/dialect/postgres/postgres-introspector.js +21 -19
- package/dist/cjs/expression/expression-builder.d.ts +1 -1
- package/dist/cjs/index.d.ts +4 -0
- package/dist/cjs/index.js +4 -0
- package/dist/cjs/migration/file-migration-provider.js +34 -1
- package/dist/cjs/parser/binary-operation-parser.d.ts +3 -1
- package/dist/cjs/query-builder/delete-query-builder.d.ts +4 -4
- 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.d.ts +4 -4
- 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/expression/expression-builder.d.ts +1 -1
- package/dist/esm/index.d.ts +4 -0
- package/dist/esm/index.js +4 -0
- package/dist/esm/parser/binary-operation-parser.d.ts +3 -1
- package/dist/esm/query-builder/delete-query-builder.d.ts +4 -4
- 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.d.ts +4 -4
- 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 +43 -42
package/README.md
CHANGED
|
@@ -13,8 +13,8 @@ npm install @depup/kysely
|
|
|
13
13
|
|
|
14
14
|
| Field | Value |
|
|
15
15
|
|-------|-------|
|
|
16
|
-
| Original | [kysely](https://www.npmjs.com/package/kysely) @ 0.28.
|
|
17
|
-
| Processed | 2026-
|
|
16
|
+
| Original | [kysely](https://www.npmjs.com/package/kysely) @ 0.28.16 |
|
|
17
|
+
| Processed | 2026-04-10 |
|
|
18
18
|
| Smoke test | passed |
|
|
19
19
|
| Deps updated | 0 |
|
|
20
20
|
|
package/changes.json
CHANGED
|
@@ -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;
|
|
@@ -524,7 +524,7 @@ export interface ExpressionBuilder<DB, TB extends keyof DB> {
|
|
|
524
524
|
* ```
|
|
525
525
|
*
|
|
526
526
|
* In the next example a reference tuple is compared to a subquery. Note that
|
|
527
|
-
* in this case you need to use the {@link
|
|
527
|
+
* in this case you need to use the {@link SelectQueryBuilder.$asTuple | $asTuple}
|
|
528
528
|
* function:
|
|
529
529
|
*
|
|
530
530
|
* ```ts
|
package/dist/cjs/index.d.ts
CHANGED
package/dist/cjs/index.js
CHANGED
|
@@ -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)) {
|
|
@@ -6,12 +6,14 @@ import { type ValueExpression, type ValueExpressionOrList } from './value-parser
|
|
|
6
6
|
import type { OperationNode } from '../operation-node/operation-node.js';
|
|
7
7
|
import type { Expression } from '../expression/expression.js';
|
|
8
8
|
import type { SelectType } from '../util/column-type.js';
|
|
9
|
+
import type { IsNever } from '../util/type-utils.js';
|
|
10
|
+
import type { KyselyTypeError } from '../util/type-error.js';
|
|
9
11
|
export type OperandValueExpression<DB, TB extends keyof DB, RE> = ValueExpression<DB, TB, ExtractTypeFromReferenceExpression<DB, TB, RE>>;
|
|
10
12
|
export type OperandValueExpressionOrList<DB, TB extends keyof DB, RE> = ValueExpressionOrList<DB, TB, ExtractTypeFromReferenceExpression<DB, TB, RE> | null>;
|
|
11
13
|
export type OperatorExpression = Operator | Expression<unknown>;
|
|
12
14
|
export type BinaryOperatorExpression = BinaryOperator | Expression<unknown>;
|
|
13
15
|
export type ComparisonOperatorExpression = ComparisonOperator | Expression<unknown>;
|
|
14
|
-
export type FilterObject<DB, TB extends keyof DB> = {
|
|
16
|
+
export type FilterObject<DB, TB extends keyof DB> = IsNever<TB> extends true ? KyselyTypeError<'there are no tables in query context, so a filter object cannot be defined. try passing an array instead.'> : {
|
|
15
17
|
[R in StringReference<DB, TB>]?: ValueExpressionOrList<DB, TB, SelectType<ExtractTypeFromStringReference<DB, TB, R>>>;
|
|
16
18
|
};
|
|
17
19
|
export declare function parseValueBinaryOperationOrExpression(args: any[]): OperationNode;
|
|
@@ -976,21 +976,21 @@ export declare class DeleteQueryBuilder<DB, TB extends keyof DB, O> implements W
|
|
|
976
976
|
*/
|
|
977
977
|
clearLimit(): DeleteQueryBuilder<DB, TB, O>;
|
|
978
978
|
/**
|
|
979
|
-
* @
|
|
979
|
+
* @remarks This is only supported by some dialects like MySQL or SQLite with `SQLITE_ENABLE_UPDATE_DELETE_LIMIT`.
|
|
980
980
|
*/
|
|
981
981
|
orderBy<OE extends OrderByExpression<DB, TB, {}>>(expr: OE, modifiers?: OrderByModifiers): DeleteQueryBuilder<DB, TB, O>;
|
|
982
982
|
/**
|
|
983
|
-
* @
|
|
983
|
+
* @remarks This is only supported by some dialects like MySQL or SQLite with `SQLITE_ENABLE_UPDATE_DELETE_LIMIT`.
|
|
984
984
|
* @deprecated It does ~2-2.6x more compile-time instantiations compared to multiple chained `orderBy(expr, modifiers?)` calls (in `order by` clauses with reasonable item counts), and has broken autocompletion.
|
|
985
985
|
*/
|
|
986
986
|
orderBy<OE extends OrderByExpression<DB, TB, {}> | DirectedOrderByStringReference<DB, TB, {}>>(exprs: ReadonlyArray<OE>): DeleteQueryBuilder<DB, TB, O>;
|
|
987
987
|
/**
|
|
988
|
-
* @
|
|
988
|
+
* @remarks This is only supported by some dialects like MySQL or SQLite with `SQLITE_ENABLE_UPDATE_DELETE_LIMIT`.
|
|
989
989
|
* @deprecated It does ~2.9x more compile-time instantiations compared to a `orderBy(expr, direction)` call.
|
|
990
990
|
*/
|
|
991
991
|
orderBy<OE extends DirectedOrderByStringReference<DB, TB, {}>>(expr: OE): DeleteQueryBuilder<DB, TB, O>;
|
|
992
992
|
/**
|
|
993
|
-
* @
|
|
993
|
+
* @remarks This is only supported by some dialects like MySQL or SQLite with `SQLITE_ENABLE_UPDATE_DELETE_LIMIT`.
|
|
994
994
|
* @deprecated Use `orderBy(expr, (ob) => ...)` instead.
|
|
995
995
|
*/
|
|
996
996
|
orderBy<OE extends OrderByExpression<DB, TB, {}>>(expr: OE, modifiers: Expression<any>): DeleteQueryBuilder<DB, TB, O>;
|
|
@@ -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;
|