@sfutureapps/db-sdk 0.3.21 → 0.3.23

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sfutureapps/db-sdk",
3
- "version": "0.3.21",
3
+ "version": "0.3.23",
4
4
  "description": "SfutureApps JS SDK for ThinkPHP DB Gateway (MySQL)",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -120,10 +120,11 @@ export class QueryBuilder {
120
120
  distinct: this._distinct,
121
121
  group: this._group,
122
122
  having: this._having,
123
+ single: this._single,
123
124
  };
124
125
 
125
- if (this._page !== null) payload.page = this._page;
126
- if (this._offset !== null) payload.offset = this._offset;
126
+ if (this._page != null) payload.page = this._page;
127
+ if (this._offset != null) payload.offset = this._offset;
127
128
 
128
129
  const res = await post({ endpoint: "/db/v1/query", data: payload });
129
130
 
@@ -131,7 +132,7 @@ export class QueryBuilder {
131
132
 
132
133
  if (this._single) {
133
134
  const first = Array.isArray(res.data) ? (res.data[ 0 ] ?? null) : null;
134
- return { data: first, error: null, count: res.count ?? null, meta: res.meta ?? null };
135
+ return { data: first, error: null, total_rows: res.total_rows ?? null, paginate: res.paginate ?? null };
135
136
  }
136
137
 
137
138
  return res;