kysely 0.28.2 → 0.28.3
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/mssql/mssql-driver.d.ts +3 -2
- package/dist/cjs/dialect/mssql/mssql-driver.js +68 -57
- package/dist/cjs/dialect/postgres/postgres-introspector.js +2 -0
- package/dist/cjs/helpers/mssql.d.ts +4 -4
- package/dist/cjs/helpers/mysql.d.ts +4 -4
- package/dist/cjs/helpers/postgres.d.ts +4 -4
- package/dist/cjs/helpers/sqlite.d.ts +4 -4
- package/dist/cjs/index.d.ts +1 -1
- package/dist/cjs/kysely.d.ts +4 -0
- package/dist/cjs/kysely.js +12 -6
- package/dist/cjs/migration/migrator.js +2 -1
- package/dist/cjs/parser/delete-from-parser.d.ts +5 -1
- package/dist/cjs/parser/merge-into-parser.d.ts +3 -1
- package/dist/cjs/parser/select-from-parser.d.ts +3 -1
- package/dist/cjs/parser/update-parser.d.ts +5 -1
- package/dist/cjs/query-builder/delete-query-builder.js +2 -2
- package/dist/cjs/query-builder/function-module.d.ts +5 -5
- package/dist/cjs/query-builder/insert-query-builder.js +2 -2
- package/dist/cjs/query-builder/merge-query-builder.js +1 -1
- package/dist/cjs/query-builder/select-query-builder.js +2 -2
- package/dist/cjs/query-builder/update-query-builder.js +2 -2
- package/dist/cjs/query-compiler/default-query-compiler.js +1 -4
- package/dist/cjs/query-executor/query-executor-base.d.ts +2 -2
- package/dist/cjs/query-executor/query-executor-base.js +4 -4
- package/dist/cjs/query-executor/query-executor.d.ts +2 -2
- package/dist/cjs/raw-builder/raw-builder.js +1 -1
- package/dist/cjs/schema/alter-table-add-foreign-key-constraint-builder.js +1 -1
- package/dist/cjs/schema/alter-table-add-index-builder.js +1 -1
- package/dist/cjs/schema/alter-table-builder.js +1 -1
- package/dist/cjs/schema/alter-table-drop-constraint-builder.js +1 -1
- package/dist/cjs/schema/alter-table-executor.js +1 -1
- package/dist/cjs/schema/create-index-builder.js +1 -1
- package/dist/cjs/schema/create-schema-builder.js +1 -1
- package/dist/cjs/schema/create-table-builder.js +1 -1
- package/dist/cjs/schema/create-type-builder.js +1 -1
- package/dist/cjs/schema/create-view-builder.js +1 -1
- package/dist/cjs/schema/drop-index-builder.js +1 -1
- package/dist/cjs/schema/drop-schema-builder.js +1 -1
- package/dist/cjs/schema/drop-table-builder.js +1 -1
- package/dist/cjs/schema/drop-type-builder.js +1 -1
- package/dist/cjs/schema/drop-view-builder.js +1 -1
- package/dist/cjs/schema/refresh-materialized-view-builder.js +1 -1
- package/dist/cjs/util/type-utils.d.ts +17 -0
- package/dist/esm/dialect/mssql/mssql-driver.d.ts +3 -2
- package/dist/esm/dialect/mssql/mssql-driver.js +68 -57
- package/dist/esm/dialect/postgres/postgres-introspector.js +2 -0
- package/dist/esm/helpers/mssql.d.ts +4 -4
- package/dist/esm/helpers/mysql.d.ts +4 -4
- package/dist/esm/helpers/postgres.d.ts +4 -4
- package/dist/esm/helpers/sqlite.d.ts +4 -4
- package/dist/esm/index.d.ts +1 -1
- package/dist/esm/kysely.d.ts +4 -0
- package/dist/esm/kysely.js +12 -6
- package/dist/esm/migration/migrator.js +3 -2
- package/dist/esm/parser/delete-from-parser.d.ts +5 -1
- package/dist/esm/parser/merge-into-parser.d.ts +3 -1
- package/dist/esm/parser/select-from-parser.d.ts +3 -1
- package/dist/esm/parser/update-parser.d.ts +5 -1
- package/dist/esm/query-builder/delete-query-builder.js +2 -2
- package/dist/esm/query-builder/function-module.d.ts +5 -5
- package/dist/esm/query-builder/insert-query-builder.js +2 -2
- package/dist/esm/query-builder/merge-query-builder.js +1 -1
- package/dist/esm/query-builder/select-query-builder.js +2 -2
- package/dist/esm/query-builder/update-query-builder.js +2 -2
- package/dist/esm/query-compiler/default-query-compiler.js +1 -4
- package/dist/esm/query-executor/query-executor-base.d.ts +2 -2
- package/dist/esm/query-executor/query-executor-base.js +4 -4
- package/dist/esm/query-executor/query-executor.d.ts +2 -2
- package/dist/esm/raw-builder/raw-builder.js +1 -1
- package/dist/esm/schema/alter-table-add-foreign-key-constraint-builder.js +1 -1
- package/dist/esm/schema/alter-table-add-index-builder.js +1 -1
- package/dist/esm/schema/alter-table-builder.js +1 -1
- package/dist/esm/schema/alter-table-drop-constraint-builder.js +1 -1
- package/dist/esm/schema/alter-table-executor.js +1 -1
- package/dist/esm/schema/create-index-builder.js +1 -1
- package/dist/esm/schema/create-schema-builder.js +1 -1
- package/dist/esm/schema/create-table-builder.js +1 -1
- package/dist/esm/schema/create-type-builder.js +1 -1
- package/dist/esm/schema/create-view-builder.js +1 -1
- package/dist/esm/schema/drop-index-builder.js +1 -1
- package/dist/esm/schema/drop-schema-builder.js +1 -1
- package/dist/esm/schema/drop-table-builder.js +1 -1
- package/dist/esm/schema/drop-type-builder.js +1 -1
- package/dist/esm/schema/drop-view-builder.js +1 -1
- package/dist/esm/schema/refresh-materialized-view-builder.js +1 -1
- package/dist/esm/util/type-utils.d.ts +17 -0
- package/package.json +35 -32
- package/.renovaterc.json +0 -3
- package/CODE_OF_CONDUCT.md +0 -183
- package/FUNDING.md +0 -25
- package/deno.check.d.ts +0 -96
- package/deno.check.json +0 -21
|
@@ -4,6 +4,7 @@ import { MssqlDialectConfig, Tedious, TediousConnection } from './mssql-dialect-
|
|
|
4
4
|
import { CompiledQuery } from '../../query-compiler/compiled-query.js';
|
|
5
5
|
declare const PRIVATE_RESET_METHOD: unique symbol;
|
|
6
6
|
declare const PRIVATE_DESTROY_METHOD: unique symbol;
|
|
7
|
+
declare const PRIVATE_VALIDATE_METHOD: unique symbol;
|
|
7
8
|
export declare class MssqlDriver implements Driver {
|
|
8
9
|
#private;
|
|
9
10
|
constructor(config: MssqlDialectConfig);
|
|
@@ -51,8 +52,8 @@ declare class MssqlConnection implements DatabaseConnection {
|
|
|
51
52
|
rollbackTransaction(savepointName?: string): Promise<void>;
|
|
52
53
|
savepoint(savepointName: string): Promise<void>;
|
|
53
54
|
streamQuery<O>(compiledQuery: CompiledQuery, chunkSize: number): AsyncIterableIterator<QueryResult<O>>;
|
|
54
|
-
validate(): Promise<boolean>;
|
|
55
|
-
[PRIVATE_RESET_METHOD](): Promise<void>;
|
|
56
55
|
[PRIVATE_DESTROY_METHOD](): Promise<void>;
|
|
56
|
+
[PRIVATE_RESET_METHOD](): Promise<void>;
|
|
57
|
+
[PRIVATE_VALIDATE_METHOD](): Promise<boolean>;
|
|
57
58
|
}
|
|
58
59
|
export {};
|
|
@@ -8,6 +8,7 @@ const random_string_js_1 = require("../../util/random-string.js");
|
|
|
8
8
|
const deferred_js_1 = require("../../util/deferred.js");
|
|
9
9
|
const PRIVATE_RESET_METHOD = Symbol();
|
|
10
10
|
const PRIVATE_DESTROY_METHOD = Symbol();
|
|
11
|
+
const PRIVATE_VALIDATE_METHOD = Symbol();
|
|
11
12
|
class MssqlDriver {
|
|
12
13
|
#config;
|
|
13
14
|
#pool;
|
|
@@ -29,7 +30,7 @@ class MssqlDriver {
|
|
|
29
30
|
validate: validateConnections === false ||
|
|
30
31
|
deprecatedValidateConnections === false
|
|
31
32
|
? undefined
|
|
32
|
-
: (connection) => connection
|
|
33
|
+
: (connection) => connection[PRIVATE_VALIDATE_METHOD](),
|
|
33
34
|
});
|
|
34
35
|
}
|
|
35
36
|
async init() {
|
|
@@ -67,14 +68,12 @@ class MssqlDriver {
|
|
|
67
68
|
exports.MssqlDriver = MssqlDriver;
|
|
68
69
|
class MssqlConnection {
|
|
69
70
|
#connection;
|
|
71
|
+
#hasSocketError;
|
|
70
72
|
#tedious;
|
|
71
73
|
constructor(connection, tedious) {
|
|
72
74
|
this.#connection = connection;
|
|
75
|
+
this.#hasSocketError = false;
|
|
73
76
|
this.#tedious = tedious;
|
|
74
|
-
this.#connection.on('error', console.error);
|
|
75
|
-
this.#connection.once('end', () => {
|
|
76
|
-
this.#connection.off('error', console.error);
|
|
77
|
-
});
|
|
78
77
|
}
|
|
79
78
|
async beginTransaction(settings) {
|
|
80
79
|
const { isolationLevel } = settings;
|
|
@@ -96,17 +95,28 @@ class MssqlConnection {
|
|
|
96
95
|
}));
|
|
97
96
|
}
|
|
98
97
|
async connect() {
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
else {
|
|
106
|
-
resolve(undefined);
|
|
107
|
-
}
|
|
108
|
-
});
|
|
98
|
+
const { promise: waitForConnected, reject, resolve } = new deferred_js_1.Deferred();
|
|
99
|
+
this.#connection.connect((error) => {
|
|
100
|
+
if (error) {
|
|
101
|
+
return reject(error);
|
|
102
|
+
}
|
|
103
|
+
resolve();
|
|
109
104
|
});
|
|
105
|
+
this.#connection.on('error', (error) => {
|
|
106
|
+
if (error instanceof Error &&
|
|
107
|
+
'code' in error &&
|
|
108
|
+
error.code === 'ESOCKET') {
|
|
109
|
+
this.#hasSocketError = true;
|
|
110
|
+
}
|
|
111
|
+
console.error(error);
|
|
112
|
+
reject(error);
|
|
113
|
+
});
|
|
114
|
+
function endListener() {
|
|
115
|
+
reject(new Error('The connection ended without ever completing the connection'));
|
|
116
|
+
}
|
|
117
|
+
this.#connection.once('end', endListener);
|
|
118
|
+
await waitForConnected;
|
|
119
|
+
this.#connection.off('end', endListener);
|
|
110
120
|
return this;
|
|
111
121
|
}
|
|
112
122
|
async executeQuery(compiledQuery) {
|
|
@@ -170,22 +180,6 @@ class MssqlConnection {
|
|
|
170
180
|
await this.#cancelRequest(request);
|
|
171
181
|
}
|
|
172
182
|
}
|
|
173
|
-
async validate() {
|
|
174
|
-
try {
|
|
175
|
-
const deferred = new deferred_js_1.Deferred();
|
|
176
|
-
const request = new MssqlRequest({
|
|
177
|
-
compiledQuery: compiled_query_js_1.CompiledQuery.raw('select 1'),
|
|
178
|
-
onDone: deferred,
|
|
179
|
-
tedious: this.#tedious,
|
|
180
|
-
});
|
|
181
|
-
this.#connection.execSql(request.request);
|
|
182
|
-
await deferred.promise;
|
|
183
|
-
return true;
|
|
184
|
-
}
|
|
185
|
-
catch {
|
|
186
|
-
return false;
|
|
187
|
-
}
|
|
188
|
-
}
|
|
189
183
|
#getTediousIsolationLevel(isolationLevel) {
|
|
190
184
|
const { ISOLATION_LEVEL } = this.#tedious;
|
|
191
185
|
const mapper = {
|
|
@@ -207,27 +201,50 @@ class MssqlConnection {
|
|
|
207
201
|
const wasCanceled = this.#connection.cancel();
|
|
208
202
|
if (!wasCanceled) {
|
|
209
203
|
request.request.off('requestCompleted', resolve);
|
|
210
|
-
resolve(
|
|
204
|
+
resolve();
|
|
211
205
|
}
|
|
212
206
|
});
|
|
213
207
|
}
|
|
208
|
+
[PRIVATE_DESTROY_METHOD]() {
|
|
209
|
+
if ('closed' in this.#connection && this.#connection.closed) {
|
|
210
|
+
return Promise.resolve();
|
|
211
|
+
}
|
|
212
|
+
return new Promise((resolve) => {
|
|
213
|
+
this.#connection.once('end', resolve);
|
|
214
|
+
this.#connection.close();
|
|
215
|
+
});
|
|
216
|
+
}
|
|
214
217
|
async [PRIVATE_RESET_METHOD]() {
|
|
215
218
|
await new Promise((resolve, reject) => {
|
|
216
219
|
this.#connection.reset((error) => {
|
|
217
|
-
if (error)
|
|
218
|
-
reject(error);
|
|
219
|
-
|
|
220
|
-
|
|
220
|
+
if (error) {
|
|
221
|
+
return reject(error);
|
|
222
|
+
}
|
|
223
|
+
resolve();
|
|
221
224
|
});
|
|
222
225
|
});
|
|
223
226
|
}
|
|
224
|
-
[
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
227
|
+
async [PRIVATE_VALIDATE_METHOD]() {
|
|
228
|
+
if (this.#hasSocketError || this.#isConnectionClosed()) {
|
|
229
|
+
return false;
|
|
230
|
+
}
|
|
231
|
+
try {
|
|
232
|
+
const deferred = new deferred_js_1.Deferred();
|
|
233
|
+
const request = new MssqlRequest({
|
|
234
|
+
compiledQuery: compiled_query_js_1.CompiledQuery.raw('select 1'),
|
|
235
|
+
onDone: deferred,
|
|
236
|
+
tedious: this.#tedious,
|
|
228
237
|
});
|
|
229
|
-
this.#connection.
|
|
230
|
-
|
|
238
|
+
this.#connection.execSql(request.request);
|
|
239
|
+
await deferred.promise;
|
|
240
|
+
return true;
|
|
241
|
+
}
|
|
242
|
+
catch {
|
|
243
|
+
return false;
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
#isConnectionClosed() {
|
|
247
|
+
return 'closed' in this.#connection && Boolean(this.#connection.closed);
|
|
231
248
|
}
|
|
232
249
|
}
|
|
233
250
|
class MssqlRequest {
|
|
@@ -251,23 +268,19 @@ class MssqlRequest {
|
|
|
251
268
|
}
|
|
252
269
|
delete this.#subscribers[subscriptionKey];
|
|
253
270
|
if (event === 'error') {
|
|
254
|
-
onDone.reject(error);
|
|
255
|
-
}
|
|
256
|
-
else {
|
|
257
|
-
onDone.resolve({
|
|
258
|
-
rowCount: this.#rowCount,
|
|
259
|
-
rows: this.#rows,
|
|
260
|
-
});
|
|
271
|
+
return onDone.reject(error);
|
|
261
272
|
}
|
|
273
|
+
onDone.resolve({
|
|
274
|
+
rowCount: this.#rowCount,
|
|
275
|
+
rows: this.#rows,
|
|
276
|
+
});
|
|
262
277
|
};
|
|
263
278
|
}
|
|
264
279
|
this.#request = new this.#tedious.Request(compiledQuery.sql, (err, rowCount) => {
|
|
265
280
|
if (err) {
|
|
266
|
-
Object.values(this.#subscribers).forEach((subscriber) => subscriber('error', err instanceof AggregateError ? err.errors : err));
|
|
267
|
-
}
|
|
268
|
-
else {
|
|
269
|
-
this.#rowCount = rowCount;
|
|
281
|
+
return Object.values(this.#subscribers).forEach((subscriber) => subscriber('error', err instanceof AggregateError ? err.errors : err));
|
|
270
282
|
}
|
|
283
|
+
this.#rowCount = rowCount;
|
|
271
284
|
});
|
|
272
285
|
this.#addParametersToRequest(compiledQuery.parameters);
|
|
273
286
|
this.#attachListeners();
|
|
@@ -281,11 +294,9 @@ class MssqlRequest {
|
|
|
281
294
|
this.#subscribers[subscriptionKey] = (event, error) => {
|
|
282
295
|
delete this.#subscribers[subscriptionKey];
|
|
283
296
|
if (event === 'error') {
|
|
284
|
-
reject(error);
|
|
285
|
-
}
|
|
286
|
-
else {
|
|
287
|
-
resolve(this.#rows.splice(0, this.#streamChunkSize));
|
|
297
|
+
return reject(error);
|
|
288
298
|
}
|
|
299
|
+
resolve(this.#rows.splice(0, this.#streamChunkSize));
|
|
289
300
|
};
|
|
290
301
|
this.#request.resume();
|
|
291
302
|
});
|
|
@@ -48,6 +48,8 @@ class PostgresIntrospector {
|
|
|
48
48
|
])
|
|
49
49
|
.where('ns.nspname', '!~', '^pg_')
|
|
50
50
|
.where('ns.nspname', '!=', 'information_schema')
|
|
51
|
+
// Filter out internal cockroachdb schema
|
|
52
|
+
.where('ns.nspname', '!=', 'crdb_internal')
|
|
51
53
|
// No system columns
|
|
52
54
|
.where('a.attnum', '>=', 0)
|
|
53
55
|
.where('a.attisdropped', '!=', true)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Expression } from '../expression/expression.js';
|
|
2
2
|
import { RawBuilder } from '../raw-builder/raw-builder.js';
|
|
3
|
-
import { Simplify } from '../util/type-utils.js';
|
|
3
|
+
import { ShallowDehydrateObject, ShallowDehydrateValue, Simplify } from '../util/type-utils.js';
|
|
4
4
|
/**
|
|
5
5
|
* An MS SQL Server helper for aggregating a subquery into a JSON array.
|
|
6
6
|
*
|
|
@@ -73,7 +73,7 @@ import { Simplify } from '../util/type-utils.js';
|
|
|
73
73
|
* from "person"
|
|
74
74
|
* ```
|
|
75
75
|
*/
|
|
76
|
-
export declare function jsonArrayFrom<O>(expr: Expression<O>): RawBuilder<Simplify<O
|
|
76
|
+
export declare function jsonArrayFrom<O>(expr: Expression<O>): RawBuilder<Simplify<ShallowDehydrateObject<O>>[]>;
|
|
77
77
|
/**
|
|
78
78
|
* An MS SQL Server helper for turning a subquery into a JSON object.
|
|
79
79
|
*
|
|
@@ -146,7 +146,7 @@ export declare function jsonArrayFrom<O>(expr: Expression<O>): RawBuilder<Simpli
|
|
|
146
146
|
* from "person"
|
|
147
147
|
* ```
|
|
148
148
|
*/
|
|
149
|
-
export declare function jsonObjectFrom<O>(expr: Expression<O>): RawBuilder<Simplify<O
|
|
149
|
+
export declare function jsonObjectFrom<O>(expr: Expression<O>): RawBuilder<Simplify<ShallowDehydrateObject<O>> | null>;
|
|
150
150
|
/**
|
|
151
151
|
* The MS SQL Server `json_query` function, single argument variant.
|
|
152
152
|
*
|
|
@@ -208,5 +208,5 @@ export declare function jsonObjectFrom<O>(expr: Expression<O>): RawBuilder<Simpl
|
|
|
208
208
|
* ```
|
|
209
209
|
*/
|
|
210
210
|
export declare function jsonBuildObject<O extends Record<string, Expression<unknown>>>(obj: O): RawBuilder<Simplify<{
|
|
211
|
-
[K in keyof O]: O[K] extends Expression<infer V> ? V : never;
|
|
211
|
+
[K in keyof O]: O[K] extends Expression<infer V> ? ShallowDehydrateValue<V> : never;
|
|
212
212
|
}>>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Expression } from '../expression/expression.js';
|
|
2
2
|
import { SelectQueryBuilderExpression } from '../query-builder/select-query-builder-expression.js';
|
|
3
3
|
import { RawBuilder } from '../raw-builder/raw-builder.js';
|
|
4
|
-
import { Simplify } from '../util/type-utils.js';
|
|
4
|
+
import { ShallowDehydrateObject, ShallowDehydrateValue, Simplify } from '../util/type-utils.js';
|
|
5
5
|
/**
|
|
6
6
|
* A MySQL helper for aggregating a subquery into a JSON array.
|
|
7
7
|
*
|
|
@@ -50,7 +50,7 @@ import { Simplify } from '../util/type-utils.js';
|
|
|
50
50
|
* from `person`
|
|
51
51
|
* ```
|
|
52
52
|
*/
|
|
53
|
-
export declare function jsonArrayFrom<O>(expr: SelectQueryBuilderExpression<O>): RawBuilder<Simplify<O
|
|
53
|
+
export declare function jsonArrayFrom<O>(expr: SelectQueryBuilderExpression<O>): RawBuilder<Simplify<ShallowDehydrateObject<O>>[]>;
|
|
54
54
|
/**
|
|
55
55
|
* A MySQL helper for turning a subquery into a JSON object.
|
|
56
56
|
*
|
|
@@ -101,7 +101,7 @@ export declare function jsonArrayFrom<O>(expr: SelectQueryBuilderExpression<O>):
|
|
|
101
101
|
* from `person`
|
|
102
102
|
* ```
|
|
103
103
|
*/
|
|
104
|
-
export declare function jsonObjectFrom<O>(expr: SelectQueryBuilderExpression<O>): RawBuilder<Simplify<O
|
|
104
|
+
export declare function jsonObjectFrom<O>(expr: SelectQueryBuilderExpression<O>): RawBuilder<Simplify<ShallowDehydrateObject<O>> | null>;
|
|
105
105
|
/**
|
|
106
106
|
* The MySQL `json_object` function.
|
|
107
107
|
*
|
|
@@ -143,5 +143,5 @@ export declare function jsonObjectFrom<O>(expr: SelectQueryBuilderExpression<O>)
|
|
|
143
143
|
* ```
|
|
144
144
|
*/
|
|
145
145
|
export declare function jsonBuildObject<O extends Record<string, Expression<unknown>>>(obj: O): RawBuilder<Simplify<{
|
|
146
|
-
[K in keyof O]: O[K] extends Expression<infer V> ? V : never;
|
|
146
|
+
[K in keyof O]: O[K] extends Expression<infer V> ? ShallowDehydrateValue<V> : never;
|
|
147
147
|
}>>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Expression } from '../expression/expression.js';
|
|
2
2
|
import { RawBuilder } from '../raw-builder/raw-builder.js';
|
|
3
|
-
import { Simplify } from '../util/type-utils.js';
|
|
3
|
+
import { ShallowDehydrateValue, ShallowDehydrateObject, Simplify } from '../util/type-utils.js';
|
|
4
4
|
/**
|
|
5
5
|
* A postgres helper for aggregating a subquery (or other expression) into a JSONB array.
|
|
6
6
|
*
|
|
@@ -50,7 +50,7 @@ import { Simplify } from '../util/type-utils.js';
|
|
|
50
50
|
* from "person"
|
|
51
51
|
* ```
|
|
52
52
|
*/
|
|
53
|
-
export declare function jsonArrayFrom<O>(expr: Expression<O>): RawBuilder<Simplify<O
|
|
53
|
+
export declare function jsonArrayFrom<O>(expr: Expression<O>): RawBuilder<Simplify<ShallowDehydrateObject<O>>[]>;
|
|
54
54
|
/**
|
|
55
55
|
* A postgres helper for turning a subquery (or other expression) into a JSON object.
|
|
56
56
|
*
|
|
@@ -102,7 +102,7 @@ export declare function jsonArrayFrom<O>(expr: Expression<O>): RawBuilder<Simpli
|
|
|
102
102
|
* from "person"
|
|
103
103
|
* ```
|
|
104
104
|
*/
|
|
105
|
-
export declare function jsonObjectFrom<O>(expr: Expression<O>): RawBuilder<Simplify<O
|
|
105
|
+
export declare function jsonObjectFrom<O>(expr: Expression<O>): RawBuilder<Simplify<ShallowDehydrateObject<O>> | null>;
|
|
106
106
|
/**
|
|
107
107
|
* The PostgreSQL `json_build_object` function.
|
|
108
108
|
*
|
|
@@ -147,7 +147,7 @@ export declare function jsonObjectFrom<O>(expr: Expression<O>): RawBuilder<Simpl
|
|
|
147
147
|
* ```
|
|
148
148
|
*/
|
|
149
149
|
export declare function jsonBuildObject<O extends Record<string, Expression<unknown>>>(obj: O): RawBuilder<Simplify<{
|
|
150
|
-
[K in keyof O]: O[K] extends Expression<infer V> ? V : never;
|
|
150
|
+
[K in keyof O]: O[K] extends Expression<infer V> ? ShallowDehydrateValue<V> : never;
|
|
151
151
|
}>>;
|
|
152
152
|
export type MergeAction = 'INSERT' | 'UPDATE' | 'DELETE';
|
|
153
153
|
/**
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Expression } from '../expression/expression.js';
|
|
2
2
|
import { SelectQueryBuilderExpression } from '../query-builder/select-query-builder-expression.js';
|
|
3
3
|
import { RawBuilder } from '../raw-builder/raw-builder.js';
|
|
4
|
-
import { Simplify } from '../util/type-utils.js';
|
|
4
|
+
import { ShallowDehydrateObject, ShallowDehydrateValue, Simplify } from '../util/type-utils.js';
|
|
5
5
|
/**
|
|
6
6
|
* A SQLite helper for aggregating a subquery into a JSON array.
|
|
7
7
|
*
|
|
@@ -63,7 +63,7 @@ import { Simplify } from '../util/type-utils.js';
|
|
|
63
63
|
* from "person"
|
|
64
64
|
* ```
|
|
65
65
|
*/
|
|
66
|
-
export declare function jsonArrayFrom<O>(expr: SelectQueryBuilderExpression<O>): RawBuilder<Simplify<O
|
|
66
|
+
export declare function jsonArrayFrom<O>(expr: SelectQueryBuilderExpression<O>): RawBuilder<Simplify<ShallowDehydrateObject<O>>[]>;
|
|
67
67
|
/**
|
|
68
68
|
* A SQLite helper for turning a subquery into a JSON object.
|
|
69
69
|
*
|
|
@@ -127,7 +127,7 @@ export declare function jsonArrayFrom<O>(expr: SelectQueryBuilderExpression<O>):
|
|
|
127
127
|
* from "person";
|
|
128
128
|
* ```
|
|
129
129
|
*/
|
|
130
|
-
export declare function jsonObjectFrom<O>(expr: SelectQueryBuilderExpression<O>): RawBuilder<Simplify<O
|
|
130
|
+
export declare function jsonObjectFrom<O>(expr: SelectQueryBuilderExpression<O>): RawBuilder<Simplify<ShallowDehydrateObject<O>> | null>;
|
|
131
131
|
/**
|
|
132
132
|
* The SQLite `json_object` function.
|
|
133
133
|
*
|
|
@@ -185,5 +185,5 @@ export declare function jsonObjectFrom<O>(expr: SelectQueryBuilderExpression<O>)
|
|
|
185
185
|
* ```
|
|
186
186
|
*/
|
|
187
187
|
export declare function jsonBuildObject<O extends Record<string, Expression<unknown>>>(obj: O): RawBuilder<Simplify<{
|
|
188
|
-
[K in keyof O]: O[K] extends Expression<infer V> ? V : never;
|
|
188
|
+
[K in keyof O]: O[K] extends Expression<infer V> ? ShallowDehydrateValue<V> : never;
|
|
189
189
|
}>>;
|
package/dist/cjs/index.d.ts
CHANGED
|
@@ -204,7 +204,7 @@ export * from './util/compilable.js';
|
|
|
204
204
|
export * from './util/explainable.js';
|
|
205
205
|
export * from './util/streamable.js';
|
|
206
206
|
export * from './util/log.js';
|
|
207
|
-
export { AnyAliasedColumn, AnyAliasedColumnWithTable, AnyColumn, AnyColumnWithTable, Equals, UnknownRow, Simplify, SqlBool, Nullable, NotNull, } from './util/type-utils.js';
|
|
207
|
+
export { AnyAliasedColumn, AnyAliasedColumnWithTable, AnyColumn, AnyColumnWithTable, Equals, UnknownRow, Simplify, SqlBool, Nullable, NotNull, ShallowDehydrateObject, ShallowDehydrateValue, StringsWhenDataTypeNotAvailable, } from './util/type-utils.js';
|
|
208
208
|
export * from './util/infer-result.js';
|
|
209
209
|
export { logOnce } from './util/log-once.js';
|
|
210
210
|
export { createQueryId, QueryId } from './util/query-id.js';
|
package/dist/cjs/kysely.d.ts
CHANGED
|
@@ -18,6 +18,10 @@ import { Expression } from './expression/expression.js';
|
|
|
18
18
|
import { DrainOuterGeneric } from './util/type-utils.js';
|
|
19
19
|
import { ReleaseSavepoint, RollbackToSavepoint } from './parser/savepoint-parser.js';
|
|
20
20
|
import { ControlledConnection } from './util/provide-controlled-connection.js';
|
|
21
|
+
declare global {
|
|
22
|
+
interface AsyncDisposable {
|
|
23
|
+
}
|
|
24
|
+
}
|
|
21
25
|
/**
|
|
22
26
|
* The main Kysely class.
|
|
23
27
|
*
|
package/dist/cjs/kysely.js
CHANGED
|
@@ -20,6 +20,7 @@ const case_node_js_1 = require("./operation-node/case-node.js");
|
|
|
20
20
|
const expression_parser_js_1 = require("./parser/expression-parser.js");
|
|
21
21
|
const with_schema_plugin_js_1 = require("./plugin/with-schema/with-schema-plugin.js");
|
|
22
22
|
const provide_controlled_connection_js_1 = require("./util/provide-controlled-connection.js");
|
|
23
|
+
const log_once_js_1 = require("./util/log-once.js");
|
|
23
24
|
// @ts-ignore
|
|
24
25
|
Symbol.asyncDispose ??= Symbol('Symbol.asyncDispose');
|
|
25
26
|
/**
|
|
@@ -460,9 +461,14 @@ class Kysely extends query_creator_js_1.QueryCreator {
|
|
|
460
461
|
*
|
|
461
462
|
* See {@link https://github.com/kysely-org/kysely/blob/master/site/docs/recipes/0004-splitting-query-building-and-execution.md#execute-compiled-queries splitting build, compile and execute code recipe} for more information.
|
|
462
463
|
*/
|
|
463
|
-
executeQuery(query,
|
|
464
|
+
executeQuery(query,
|
|
465
|
+
// TODO: remove this in the future. deprecated in 0.28.x
|
|
466
|
+
queryId) {
|
|
467
|
+
if (queryId !== undefined) {
|
|
468
|
+
(0, log_once_js_1.logOnce)('Passing `queryId` in `db.executeQuery` is deprecated and will result in a compile-time error in the future.');
|
|
469
|
+
}
|
|
464
470
|
const compiledQuery = (0, compilable_js_1.isCompilable)(query) ? query.compile() : query;
|
|
465
|
-
return this.getExecutor().executeQuery(compiledQuery
|
|
471
|
+
return this.getExecutor().executeQuery(compiledQuery);
|
|
466
472
|
}
|
|
467
473
|
async [Symbol.asyncDispose]() {
|
|
468
474
|
await this.destroy();
|
|
@@ -888,13 +894,13 @@ class NotCommittedOrRolledBackAssertingExecutor {
|
|
|
888
894
|
provideConnection(consumer) {
|
|
889
895
|
return this.#executor.provideConnection(consumer);
|
|
890
896
|
}
|
|
891
|
-
executeQuery(compiledQuery
|
|
897
|
+
executeQuery(compiledQuery) {
|
|
892
898
|
assertNotCommittedOrRolledBack(this.#state);
|
|
893
|
-
return this.#executor.executeQuery(compiledQuery
|
|
899
|
+
return this.#executor.executeQuery(compiledQuery);
|
|
894
900
|
}
|
|
895
|
-
stream(compiledQuery, chunkSize
|
|
901
|
+
stream(compiledQuery, chunkSize) {
|
|
896
902
|
assertNotCommittedOrRolledBack(this.#state);
|
|
897
|
-
return this.#executor.stream(compiledQuery, chunkSize
|
|
903
|
+
return this.#executor.stream(compiledQuery, chunkSize);
|
|
898
904
|
}
|
|
899
905
|
withConnectionProvider(connectionProvider) {
|
|
900
906
|
return new NotCommittedOrRolledBackAssertingExecutor(this.#executor.withConnectionProvider(connectionProvider), this.#state);
|
|
@@ -178,7 +178,8 @@ class Migrator {
|
|
|
178
178
|
*/
|
|
179
179
|
async migrateTo(targetMigrationName) {
|
|
180
180
|
return this.#migrate(({ migrations, executedMigrations, pendingMigrations, }) => {
|
|
181
|
-
if (
|
|
181
|
+
if ((0, object_utils_js_1.isObject)(targetMigrationName) &&
|
|
182
|
+
targetMigrationName.__noMigrations__ === true) {
|
|
182
183
|
return { direction: 'Down', step: Infinity };
|
|
183
184
|
}
|
|
184
185
|
if (!migrations.find((m) => m.name === targetMigrationName)) {
|
|
@@ -2,4 +2,8 @@ import type { DeleteQueryBuilder } from '../query-builder/delete-query-builder.j
|
|
|
2
2
|
import type { DeleteResult } from '../query-builder/delete-result.js';
|
|
3
3
|
import type { ShallowRecord } from '../util/type-utils.js';
|
|
4
4
|
import type { ExtractTableAlias, From, FromTables, TableExpressionOrList } from './table-parser.js';
|
|
5
|
-
export type DeleteFrom<DB, TE extends TableExpressionOrList<DB, never>> =
|
|
5
|
+
export type DeleteFrom<DB, TE extends TableExpressionOrList<DB, never>> = [
|
|
6
|
+
TE
|
|
7
|
+
] extends [keyof DB] ? DeleteQueryBuilder<DB, ExtractTableAlias<DB, TE>, DeleteResult> : [
|
|
8
|
+
TE
|
|
9
|
+
] extends [`${infer T} as ${infer A}`] ? T extends keyof DB ? DeleteQueryBuilder<DB & ShallowRecord<A, DB[T]>, A, DeleteResult> : never : TE extends ReadonlyArray<infer T> ? DeleteQueryBuilder<From<DB, T>, FromTables<DB, never, T>, DeleteResult> : DeleteQueryBuilder<From<DB, TE>, FromTables<DB, never, TE>, DeleteResult>;
|
|
@@ -2,4 +2,6 @@ import type { MergeQueryBuilder } from '../query-builder/merge-query-builder.js'
|
|
|
2
2
|
import type { MergeResult } from '../query-builder/merge-result.js';
|
|
3
3
|
import type { ShallowRecord } from '../util/type-utils.js';
|
|
4
4
|
import type { ExtractTableAlias, SimpleTableReference } from './table-parser.js';
|
|
5
|
-
export type MergeInto<DB, TE extends SimpleTableReference<DB>> = TE extends
|
|
5
|
+
export type MergeInto<DB, TE extends SimpleTableReference<DB>> = [TE] extends [
|
|
6
|
+
keyof DB
|
|
7
|
+
] ? MergeQueryBuilder<DB, ExtractTableAlias<DB, TE>, MergeResult> : [TE] extends [`${infer T} as ${infer A}`] ? T extends keyof DB ? MergeQueryBuilder<DB & ShallowRecord<A, DB[T]>, A, MergeResult> : never : never;
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import type { SelectQueryBuilder } from '../query-builder/select-query-builder.js';
|
|
2
2
|
import type { ShallowRecord } from '../util/type-utils.js';
|
|
3
3
|
import type { ExtractTableAlias, From, FromTables, TableExpressionOrList } from './table-parser.js';
|
|
4
|
-
export type SelectFrom<DB, TB extends keyof DB, TE extends TableExpressionOrList<DB, TB>> = TE extends keyof DB
|
|
4
|
+
export type SelectFrom<DB, TB extends keyof DB, TE extends TableExpressionOrList<DB, TB>> = [TE] extends [keyof DB] ? SelectQueryBuilder<DB, TB | ExtractTableAlias<DB, TE>, {}> : [
|
|
5
|
+
TE
|
|
6
|
+
] extends [`${infer T} as ${infer A}`] ? T extends keyof DB ? SelectQueryBuilder<DB & ShallowRecord<A, DB[T]>, TB | A, {}> : never : TE extends ReadonlyArray<infer T> ? SelectQueryBuilder<From<DB, T>, FromTables<DB, TB, T>, {}> : SelectQueryBuilder<From<DB, TE>, FromTables<DB, TB, TE>, {}>;
|
|
@@ -2,4 +2,8 @@ import type { UpdateQueryBuilder } from '../query-builder/update-query-builder.j
|
|
|
2
2
|
import type { UpdateResult } from '../query-builder/update-result.js';
|
|
3
3
|
import type { ShallowRecord } from '../util/type-utils.js';
|
|
4
4
|
import type { ExtractTableAlias, From, FromTables, TableExpressionOrList } from './table-parser.js';
|
|
5
|
-
export type UpdateTable<DB, TE extends TableExpressionOrList<DB, never>> =
|
|
5
|
+
export type UpdateTable<DB, TE extends TableExpressionOrList<DB, never>> = [
|
|
6
|
+
TE
|
|
7
|
+
] extends [keyof DB] ? UpdateQueryBuilder<DB, ExtractTableAlias<DB, TE>, ExtractTableAlias<DB, TE>, UpdateResult> : [
|
|
8
|
+
TE
|
|
9
|
+
] extends [`${infer T} as ${infer A}`] ? T extends keyof DB ? UpdateQueryBuilder<DB & ShallowRecord<A, DB[T]>, A, A, UpdateResult> : never : TE extends ReadonlyArray<infer T> ? UpdateQueryBuilder<From<DB, T>, FromTables<DB, never, T>, FromTables<DB, never, T>, UpdateResult> : UpdateQueryBuilder<From<DB, TE>, FromTables<DB, never, TE>, FromTables<DB, never, TE>, UpdateResult>;
|
|
@@ -451,7 +451,7 @@ class DeleteQueryBuilder {
|
|
|
451
451
|
*/
|
|
452
452
|
async execute() {
|
|
453
453
|
const compiledQuery = this.compile();
|
|
454
|
-
const result = await this.#props.executor.executeQuery(compiledQuery
|
|
454
|
+
const result = await this.#props.executor.executeQuery(compiledQuery);
|
|
455
455
|
const { adapter } = this.#props.executor;
|
|
456
456
|
const query = compiledQuery.query;
|
|
457
457
|
if ((query.returning && adapter.supportsReturning) ||
|
|
@@ -488,7 +488,7 @@ class DeleteQueryBuilder {
|
|
|
488
488
|
}
|
|
489
489
|
async *stream(chunkSize = 100) {
|
|
490
490
|
const compiledQuery = this.compile();
|
|
491
|
-
const stream = this.#props.executor.stream(compiledQuery, chunkSize
|
|
491
|
+
const stream = this.#props.executor.stream(compiledQuery, chunkSize);
|
|
492
492
|
for await (const item of stream) {
|
|
493
493
|
yield* item.rows;
|
|
494
494
|
}
|
|
@@ -3,10 +3,10 @@ import { Expression } from '../expression/expression.js';
|
|
|
3
3
|
import { ExtractTypeFromCoalesce1, ExtractTypeFromCoalesce3, ExtractTypeFromCoalesce2, ExtractTypeFromCoalesce4, ExtractTypeFromCoalesce5 } from '../parser/coalesce-parser.js';
|
|
4
4
|
import { ExtractTypeFromReferenceExpression, ReferenceExpression, StringReference, ExtractTypeFromStringReference } from '../parser/reference-parser.js';
|
|
5
5
|
import { KyselyTypeError } from '../util/type-error.js';
|
|
6
|
-
import { IsNever } from '../util/type-utils.js';
|
|
6
|
+
import { IsNever, ShallowDehydrateObject, ShallowDehydrateValue, Simplify } from '../util/type-utils.js';
|
|
7
7
|
import { AggregateFunctionBuilder } from './aggregate-function-builder.js';
|
|
8
8
|
import { SelectQueryBuilderExpression } from '../query-builder/select-query-builder-expression.js';
|
|
9
|
-
import { Selectable } from '../util/column-type.js';
|
|
9
|
+
import { Selectable, SelectType } from '../util/column-type.js';
|
|
10
10
|
/**
|
|
11
11
|
* Helpers for type safe SQL function calls.
|
|
12
12
|
*
|
|
@@ -565,8 +565,8 @@ export interface FunctionModule<DB, TB extends keyof DB> {
|
|
|
565
565
|
* group by "person"."first_name"
|
|
566
566
|
* ```
|
|
567
567
|
*/
|
|
568
|
-
jsonAgg<T extends (TB & string) | Expression<unknown>>(table: T): AggregateFunctionBuilder<DB, TB, T extends TB ? Selectable<DB[T]
|
|
569
|
-
jsonAgg<RE extends StringReference<DB, TB>>(column: RE): AggregateFunctionBuilder<DB, TB, ExtractTypeFromStringReference<DB, TB, RE
|
|
568
|
+
jsonAgg<T extends (TB & string) | Expression<unknown>>(table: T): AggregateFunctionBuilder<DB, TB, T extends TB ? Simplify<ShallowDehydrateObject<Selectable<DB[T]>>>[] : T extends Expression<infer O> ? Simplify<ShallowDehydrateObject<O>>[] : never>;
|
|
569
|
+
jsonAgg<RE extends StringReference<DB, TB>>(column: RE): AggregateFunctionBuilder<DB, TB, ShallowDehydrateValue<SelectType<ExtractTypeFromStringReference<DB, TB, RE>>>[] | null>;
|
|
570
570
|
/**
|
|
571
571
|
* Creates a to_json function call.
|
|
572
572
|
*
|
|
@@ -587,6 +587,6 @@ export interface FunctionModule<DB, TB extends keyof DB> {
|
|
|
587
587
|
* inner join "pet" on "pet"."owner_id" = "person"."id"
|
|
588
588
|
* ```
|
|
589
589
|
*/
|
|
590
|
-
toJson<T extends (TB & string) | Expression<unknown>>(table: T): ExpressionWrapper<DB, TB, T extends TB ? Selectable<DB[T]
|
|
590
|
+
toJson<T extends (TB & string) | Expression<unknown>>(table: T): ExpressionWrapper<DB, TB, T extends TB ? Simplify<ShallowDehydrateObject<Selectable<DB[T]>>> : T extends Expression<infer O> ? Simplify<ShallowDehydrateObject<O>> : never>;
|
|
591
591
|
}
|
|
592
592
|
export declare function createFunctionModule<DB, TB extends keyof DB>(): FunctionModule<DB, TB>;
|
|
@@ -1105,7 +1105,7 @@ class InsertQueryBuilder {
|
|
|
1105
1105
|
*/
|
|
1106
1106
|
async execute() {
|
|
1107
1107
|
const compiledQuery = this.compile();
|
|
1108
|
-
const result = await this.#props.executor.executeQuery(compiledQuery
|
|
1108
|
+
const result = await this.#props.executor.executeQuery(compiledQuery);
|
|
1109
1109
|
const { adapter } = this.#props.executor;
|
|
1110
1110
|
const query = compiledQuery.query;
|
|
1111
1111
|
if ((query.returning && adapter.supportsReturning) ||
|
|
@@ -1144,7 +1144,7 @@ class InsertQueryBuilder {
|
|
|
1144
1144
|
}
|
|
1145
1145
|
async *stream(chunkSize = 100) {
|
|
1146
1146
|
const compiledQuery = this.compile();
|
|
1147
|
-
const stream = this.#props.executor.stream(compiledQuery, chunkSize
|
|
1147
|
+
const stream = this.#props.executor.stream(compiledQuery, chunkSize);
|
|
1148
1148
|
for await (const item of stream) {
|
|
1149
1149
|
yield* item.rows;
|
|
1150
1150
|
}
|
|
@@ -419,7 +419,7 @@ class WheneableMergeQueryBuilder {
|
|
|
419
419
|
*/
|
|
420
420
|
async execute() {
|
|
421
421
|
const compiledQuery = this.compile();
|
|
422
|
-
const result = await this.#props.executor.executeQuery(compiledQuery
|
|
422
|
+
const result = await this.#props.executor.executeQuery(compiledQuery);
|
|
423
423
|
const { adapter } = this.#props.executor;
|
|
424
424
|
const query = compiledQuery.query;
|
|
425
425
|
if ((query.returning && adapter.supportsReturning) ||
|
|
@@ -316,7 +316,7 @@ class SelectQueryBuilderImpl {
|
|
|
316
316
|
}
|
|
317
317
|
async execute() {
|
|
318
318
|
const compiledQuery = this.compile();
|
|
319
|
-
const result = await this.#props.executor.executeQuery(compiledQuery
|
|
319
|
+
const result = await this.#props.executor.executeQuery(compiledQuery);
|
|
320
320
|
return result.rows;
|
|
321
321
|
}
|
|
322
322
|
async executeTakeFirst() {
|
|
@@ -335,7 +335,7 @@ class SelectQueryBuilderImpl {
|
|
|
335
335
|
}
|
|
336
336
|
async *stream(chunkSize = 100) {
|
|
337
337
|
const compiledQuery = this.compile();
|
|
338
|
-
const stream = this.#props.executor.stream(compiledQuery, chunkSize
|
|
338
|
+
const stream = this.#props.executor.stream(compiledQuery, chunkSize);
|
|
339
339
|
for await (const item of stream) {
|
|
340
340
|
yield* item.rows;
|
|
341
341
|
}
|
|
@@ -458,7 +458,7 @@ class UpdateQueryBuilder {
|
|
|
458
458
|
*/
|
|
459
459
|
async execute() {
|
|
460
460
|
const compiledQuery = this.compile();
|
|
461
|
-
const result = await this.#props.executor.executeQuery(compiledQuery
|
|
461
|
+
const result = await this.#props.executor.executeQuery(compiledQuery);
|
|
462
462
|
const { adapter } = this.#props.executor;
|
|
463
463
|
const query = compiledQuery.query;
|
|
464
464
|
if ((query.returning && adapter.supportsReturning) ||
|
|
@@ -497,7 +497,7 @@ class UpdateQueryBuilder {
|
|
|
497
497
|
}
|
|
498
498
|
async *stream(chunkSize = 100) {
|
|
499
499
|
const compiledQuery = this.compile();
|
|
500
|
-
const stream = this.#props.executor.stream(compiledQuery, chunkSize
|
|
500
|
+
const stream = this.#props.executor.stream(compiledQuery, chunkSize);
|
|
501
501
|
for await (const item of stream) {
|
|
502
502
|
yield* item.rows;
|
|
503
503
|
}
|
|
@@ -1320,7 +1320,7 @@ class DefaultQueryCompiler extends operation_node_visitor_js_1.OperationNodeVisi
|
|
|
1320
1320
|
if ((0, object_utils_js_1.isString)(value)) {
|
|
1321
1321
|
this.appendStringLiteral(value);
|
|
1322
1322
|
}
|
|
1323
|
-
else if ((0, object_utils_js_1.isNumber)(value) || (0, object_utils_js_1.isBoolean)(value)) {
|
|
1323
|
+
else if ((0, object_utils_js_1.isNumber)(value) || (0, object_utils_js_1.isBoolean)(value) || (0, object_utils_js_1.isBigInt)(value)) {
|
|
1324
1324
|
this.append(value.toString());
|
|
1325
1325
|
}
|
|
1326
1326
|
else if ((0, object_utils_js_1.isNull)(value)) {
|
|
@@ -1329,9 +1329,6 @@ class DefaultQueryCompiler extends operation_node_visitor_js_1.OperationNodeVisi
|
|
|
1329
1329
|
else if ((0, object_utils_js_1.isDate)(value)) {
|
|
1330
1330
|
this.appendImmediateValue(value.toISOString());
|
|
1331
1331
|
}
|
|
1332
|
-
else if ((0, object_utils_js_1.isBigInt)(value)) {
|
|
1333
|
-
this.appendImmediateValue(value.toString());
|
|
1334
|
-
}
|
|
1335
1332
|
else {
|
|
1336
1333
|
throw new Error(`invalid immediate value ${value}`);
|
|
1337
1334
|
}
|
|
@@ -35,13 +35,13 @@ export declare abstract class QueryExecutorBase implements QueryExecutor {
|
|
|
35
35
|
* Executes a compiled query and runs the result through all plugins'
|
|
36
36
|
* `transformResult` method.
|
|
37
37
|
*/
|
|
38
|
-
executeQuery<R>(compiledQuery: CompiledQuery
|
|
38
|
+
executeQuery<R>(compiledQuery: CompiledQuery): Promise<QueryResult<R>>;
|
|
39
39
|
/**
|
|
40
40
|
* Executes a compiled query and runs the result through all plugins'
|
|
41
41
|
* `transformResult` method. Results are streamead instead of loaded
|
|
42
42
|
* at once.
|
|
43
43
|
*/
|
|
44
|
-
stream<R>(compiledQuery: CompiledQuery, chunkSize: number
|
|
44
|
+
stream<R>(compiledQuery: CompiledQuery, chunkSize: number): AsyncIterableIterator<QueryResult<R>>;
|
|
45
45
|
/**
|
|
46
46
|
* Returns a copy of this executor with a new connection provider.
|
|
47
47
|
*/
|