@naturalcycles/db-lib 9.3.1 → 9.3.2
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.
|
@@ -60,11 +60,11 @@ export declare class CommonDao<BM extends PartialObjectWithId, DBM extends Parti
|
|
|
60
60
|
runQueryExtendedAsTM(q: DBQuery<DBM>, opt?: CommonDaoOptions): Promise<RunQueryResult<TM>>;
|
|
61
61
|
runQueryCount(q: DBQuery<DBM>, opt?: CommonDaoOptions): Promise<number>;
|
|
62
62
|
streamQueryForEach(q: DBQuery<DBM>, mapper: AsyncMapper<Saved<BM>, void>, opt?: CommonDaoStreamForEachOptions<Saved<BM>>): Promise<void>;
|
|
63
|
-
streamQueryAsDBMForEach(q: DBQuery<DBM>, mapper: AsyncMapper<DBM
|
|
63
|
+
streamQueryAsDBMForEach(q: DBQuery<DBM>, mapper: AsyncMapper<Saved<DBM>, void>, opt?: CommonDaoStreamForEachOptions<DBM>): Promise<void>;
|
|
64
64
|
/**
|
|
65
65
|
* Stream as Readable, to be able to .pipe() it further with support of backpressure.
|
|
66
66
|
*/
|
|
67
|
-
streamQueryAsDBM(q: DBQuery<DBM>, opt?: CommonDaoStreamOptions<DBM>): ReadableTyped<DBM
|
|
67
|
+
streamQueryAsDBM(q: DBQuery<DBM>, opt?: CommonDaoStreamOptions<DBM>): ReadableTyped<Saved<DBM>>;
|
|
68
68
|
/**
|
|
69
69
|
* Stream as Readable, to be able to .pipe() it further with support of backpressure.
|
|
70
70
|
*
|
package/dist/query/dbQuery.d.ts
CHANGED
|
@@ -100,9 +100,9 @@ export declare class RunnableDBQuery<BM extends PartialObjectWithId, DBM extends
|
|
|
100
100
|
runQueryCount(opt?: CommonDaoOptions): Promise<number>;
|
|
101
101
|
updateByQuery(patch: DBPatch<DBM>, opt?: CommonDaoOptions): Promise<number>;
|
|
102
102
|
streamQueryForEach(mapper: AsyncMapper<Saved<BM>, void>, opt?: CommonDaoStreamForEachOptions<Saved<BM>>): Promise<void>;
|
|
103
|
-
streamQueryAsDBMForEach(mapper: AsyncMapper<DBM
|
|
103
|
+
streamQueryAsDBMForEach(mapper: AsyncMapper<Saved<DBM>, void>, opt?: CommonDaoStreamForEachOptions<DBM>): Promise<void>;
|
|
104
104
|
streamQuery(opt?: CommonDaoStreamOptions<Saved<BM>>): ReadableTyped<Saved<BM>>;
|
|
105
|
-
streamQueryAsDBM(opt?: CommonDaoStreamOptions<DBM>): ReadableTyped<DBM
|
|
105
|
+
streamQueryAsDBM(opt?: CommonDaoStreamOptions<DBM>): ReadableTyped<Saved<DBM>>;
|
|
106
106
|
queryIds(opt?: CommonDaoOptions): Promise<string[]>;
|
|
107
107
|
streamQueryIds(opt?: CommonDaoStreamOptions<string>): ReadableTyped<string>;
|
|
108
108
|
streamQueryIdsForEach(mapper: AsyncMapper<string, void>, opt?: CommonDaoStreamForEachOptions<string>): Promise<void>;
|
package/package.json
CHANGED
|
@@ -484,7 +484,7 @@ export class CommonDao<
|
|
|
484
484
|
|
|
485
485
|
async streamQueryAsDBMForEach(
|
|
486
486
|
q: DBQuery<DBM>,
|
|
487
|
-
mapper: AsyncMapper<DBM
|
|
487
|
+
mapper: AsyncMapper<Saved<DBM>, void>,
|
|
488
488
|
opt: CommonDaoStreamForEachOptions<DBM> = {},
|
|
489
489
|
): Promise<void> {
|
|
490
490
|
q.table = opt.table || q.table
|
|
@@ -515,7 +515,7 @@ export class CommonDao<
|
|
|
515
515
|
errorMode: opt.errorMode,
|
|
516
516
|
},
|
|
517
517
|
),
|
|
518
|
-
transformMap<DBM
|
|
518
|
+
transformMap<Saved<DBM>, void>(mapper, {
|
|
519
519
|
...opt,
|
|
520
520
|
predicate: _passthroughPredicate, // to be able to logProgress
|
|
521
521
|
}),
|
|
@@ -535,7 +535,10 @@ export class CommonDao<
|
|
|
535
535
|
/**
|
|
536
536
|
* Stream as Readable, to be able to .pipe() it further with support of backpressure.
|
|
537
537
|
*/
|
|
538
|
-
streamQueryAsDBM(
|
|
538
|
+
streamQueryAsDBM(
|
|
539
|
+
q: DBQuery<DBM>,
|
|
540
|
+
opt: CommonDaoStreamOptions<DBM> = {},
|
|
541
|
+
): ReadableTyped<Saved<DBM>> {
|
|
539
542
|
q.table = opt.table || q.table
|
|
540
543
|
opt.skipValidation = opt.skipValidation !== false // default true
|
|
541
544
|
opt.skipConversion = opt.skipConversion !== false // default true
|
package/src/query/dbQuery.ts
CHANGED
|
@@ -297,7 +297,7 @@ export class RunnableDBQuery<
|
|
|
297
297
|
}
|
|
298
298
|
|
|
299
299
|
async streamQueryAsDBMForEach(
|
|
300
|
-
mapper: AsyncMapper<DBM
|
|
300
|
+
mapper: AsyncMapper<Saved<DBM>, void>,
|
|
301
301
|
opt?: CommonDaoStreamForEachOptions<DBM>,
|
|
302
302
|
): Promise<void> {
|
|
303
303
|
await this.dao.streamQueryAsDBMForEach(this, mapper, opt)
|
|
@@ -307,7 +307,7 @@ export class RunnableDBQuery<
|
|
|
307
307
|
return this.dao.streamQuery(this, opt)
|
|
308
308
|
}
|
|
309
309
|
|
|
310
|
-
streamQueryAsDBM(opt?: CommonDaoStreamOptions<DBM>): ReadableTyped<DBM
|
|
310
|
+
streamQueryAsDBM(opt?: CommonDaoStreamOptions<DBM>): ReadableTyped<Saved<DBM>> {
|
|
311
311
|
return this.dao.streamQueryAsDBM(this, opt)
|
|
312
312
|
}
|
|
313
313
|
|