@proteinjs/db 1.5.0 → 1.5.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.
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,17 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [1.5.2](https://github.com/proteinjs/db/compare/@proteinjs/db@1.5.1...@proteinjs/db@1.5.2) (2024-08-05)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* `RecordIterator` now correctly calculates `pagination.end`. i don't think it was ever reading past the first page since the first page of `results.length` would always be less than `pageSize`.. ([2a23c04](https://github.com/proteinjs/db/commit/2a23c0488f58588a7581413457b40e9a347500e5))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
6
17
|
# [1.5.0](https://github.com/proteinjs/db/compare/@proteinjs/db@1.4.0...@proteinjs/db@1.5.0) (2024-08-02)
|
|
7
18
|
|
|
8
19
|
|
|
@@ -58,7 +58,7 @@ var RecordIterator = /** @class */ (function () {
|
|
|
58
58
|
switch (_b.label) {
|
|
59
59
|
case 0:
|
|
60
60
|
if (!true) return [3 /*break*/, 11];
|
|
61
|
-
pagination = { start: this.currentPage * this.pageSize, end: (this.currentPage + 1) * this.pageSize
|
|
61
|
+
pagination = { start: this.currentPage * this.pageSize, end: (this.currentPage + 1) * this.pageSize };
|
|
62
62
|
this.query.paginate(pagination);
|
|
63
63
|
return [4 /*yield*/, __await(this.db.query(this.table, this.query))];
|
|
64
64
|
case 1:
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RecordIterator.js","sourceRoot":"","sources":["../../src/RecordIterator.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,2BAAiC;A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E,KAAK,EAAE,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,QAAQ,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,WAAW,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC,QAAQ,EAAE,CAAC;wBAC5G,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC;wBAChB,6BAAM,IAAI,CAAC,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,GAAA;;wBAArD,OAAO,GAAG,SAA2C;6BAEvD,CAAA,OAAO,CAAC,MAAM,KAAK,CAAC,CAAA,EAApB,wBAAoB;;4BACtB,iCAAO;;8BAGiB,EAAP,mBAAO;;;6BAAP,CAAA,qBAAO,CAAA;wBAAf,IAAI;qDACP,IAAI;4BAAV,gCAAU;;wBAAV,SAAU,CAAC;;;wBADM,IAAO,CAAA;;;6BAItB,CAAA,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,QAAQ,CAAA,EAA9B,yBAA8B;;4BAChC,iCAAO;;wBAGT,IAAI,CAAC,WAAW,EAAE,CAAC;;;;;;KAEtB;IACH,qBAAC;AAAD,CAAC,AApCD,IAoCC;AApCY,wCAAc"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@proteinjs/db",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.2",
|
|
4
4
|
"description": "Db",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"@proteinjs/reflection": "1.1.7",
|
|
27
27
|
"@proteinjs/serializer": "1.0.13",
|
|
28
28
|
"@proteinjs/server-api": "1.4.0",
|
|
29
|
-
"@proteinjs/service": "1.0.
|
|
29
|
+
"@proteinjs/service": "1.0.25",
|
|
30
30
|
"@proteinjs/user-auth": "1.0.15",
|
|
31
31
|
"@proteinjs/util": "1.3.1",
|
|
32
32
|
"moment": "2.29.4",
|
|
@@ -48,5 +48,5 @@
|
|
|
48
48
|
},
|
|
49
49
|
"main": "./dist/generated/index.js",
|
|
50
50
|
"types": "./dist/generated/index.d.ts",
|
|
51
|
-
"gitHead": "
|
|
51
|
+
"gitHead": "6216b2e035134bc04bfb6e6a822698851e2b791f"
|
|
52
52
|
}
|
package/src/RecordIterator.ts
CHANGED
|
@@ -22,7 +22,7 @@ export class RecordIterator<T extends Record> implements AsyncIterable<T> {
|
|
|
22
22
|
|
|
23
23
|
async *[Symbol.asyncIterator](): AsyncIterator<T> {
|
|
24
24
|
while (true) {
|
|
25
|
-
const pagination = { start: this.currentPage * this.pageSize, end: (this.currentPage + 1) * this.pageSize
|
|
25
|
+
const pagination = { start: this.currentPage * this.pageSize, end: (this.currentPage + 1) * this.pageSize };
|
|
26
26
|
this.query.paginate(pagination);
|
|
27
27
|
const results = await this.db.query(this.table, this.query);
|
|
28
28
|
|