@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 +1 -1
- package/src/query-builder.js +4 -3
package/package.json
CHANGED
package/src/query-builder.js
CHANGED
|
@@ -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
|
|
126
|
-
if (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,
|
|
135
|
+
return { data: first, error: null, total_rows: res.total_rows ?? null, paginate: res.paginate ?? null };
|
|
135
136
|
}
|
|
136
137
|
|
|
137
138
|
return res;
|