baja-lite 1.7.0 → 1.7.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/package.json +3 -3
- package/sql.js +8 -8
- package/test-mysql.js +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "baja-lite",
|
|
3
|
-
"version": "1.7.
|
|
3
|
+
"version": "1.7.2",
|
|
4
4
|
"description": "some util for self",
|
|
5
5
|
"homepage": "https://github.com/void-soul/baja-lite",
|
|
6
6
|
"repository": {
|
|
@@ -44,11 +44,11 @@
|
|
|
44
44
|
"iterare": "1.2.1",
|
|
45
45
|
"mustache": "4.2.0",
|
|
46
46
|
"pino": "10.1.0",
|
|
47
|
-
"pino-pretty": "13.1.
|
|
47
|
+
"pino-pretty": "13.1.3",
|
|
48
48
|
"reflect-metadata": "0.2.2",
|
|
49
49
|
"request": "2.88.2",
|
|
50
50
|
"request-promise": "4.2.6",
|
|
51
|
-
"sql-formatter": "15.6.
|
|
51
|
+
"sql-formatter": "15.6.12",
|
|
52
52
|
"sqlstring": "2.3.3",
|
|
53
53
|
"tslib": "2.8.1"
|
|
54
54
|
},
|
package/sql.js
CHANGED
|
@@ -3480,8 +3480,8 @@ class StreamQuery {
|
|
|
3480
3480
|
this._updateColumns = [];
|
|
3481
3481
|
this._groups = [];
|
|
3482
3482
|
this._orders = [];
|
|
3483
|
-
this._startRow =
|
|
3484
|
-
this._pageSize =
|
|
3483
|
+
this._startRow = -1;
|
|
3484
|
+
this._pageSize = -1;
|
|
3485
3485
|
this._prefix = parseInt(`${Math.random() * 1000}`);
|
|
3486
3486
|
this._service = service;
|
|
3487
3487
|
this[_fields] = __fields;
|
|
@@ -3493,8 +3493,8 @@ class StreamQuery {
|
|
|
3493
3493
|
this._wheres.length = 0;
|
|
3494
3494
|
this._param = {};
|
|
3495
3495
|
this._paramKeys = {};
|
|
3496
|
-
this._pageSize =
|
|
3497
|
-
this._startRow =
|
|
3496
|
+
this._pageSize = -1;
|
|
3497
|
+
this._startRow = -1;
|
|
3498
3498
|
this._orders.length = 0;
|
|
3499
3499
|
this._groups.length = 0;
|
|
3500
3500
|
this._columns.length = 0;
|
|
@@ -3877,10 +3877,10 @@ class StreamQuery {
|
|
|
3877
3877
|
${this._groups.length > 0 ? `GROUP BY ${this._groups.join(',')} ` : ''}
|
|
3878
3878
|
${this._orders.length > 0 ? `ORDER BY ${this._orders.join(',')} ` : ''}
|
|
3879
3879
|
`;
|
|
3880
|
-
if (this._startRow && this._pageSize) {
|
|
3880
|
+
if (this._startRow >= 0 && this._pageSize >= 0) {
|
|
3881
3881
|
sql += `LIMIT ${this._startRow}, ${this._pageSize}`;
|
|
3882
3882
|
}
|
|
3883
|
-
else if (this._startRow) {
|
|
3883
|
+
else if (this._startRow >= 0) {
|
|
3884
3884
|
sql += `LIMIT ${this._startRow}`;
|
|
3885
3885
|
}
|
|
3886
3886
|
if (option.sync === SyncMode.Async) {
|
|
@@ -3922,10 +3922,10 @@ class StreamQuery {
|
|
|
3922
3922
|
${this._groups.length > 0 ? `GROUP BY ${this._groups.join(',')} ` : ''}
|
|
3923
3923
|
${this._orders.length > 0 ? `ORDER BY ${this._orders.join(',')} ` : ''}
|
|
3924
3924
|
`;
|
|
3925
|
-
if (this._startRow && this._pageSize) {
|
|
3925
|
+
if (this._startRow >= 0 && this._pageSize >= 0) {
|
|
3926
3926
|
sql += `LIMIT ${this._startRow}, ${this._pageSize}`;
|
|
3927
3927
|
}
|
|
3928
|
-
else if (this._startRow) {
|
|
3928
|
+
else if (this._startRow >= 0) {
|
|
3929
3929
|
sql += `LIMIT ${this._startRow}`;
|
|
3930
3930
|
}
|
|
3931
3931
|
const sqlCount = `
|