@supabase/postgrest-js 2.107.0 → 2.108.0
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/dist/index.cjs +13 -10
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +5 -5
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts +5 -5
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +13 -10
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/PostgrestBuilder.ts +11 -3
- package/src/PostgrestTransformBuilder.ts +7 -7
- package/src/version.ts +1 -1
package/dist/index.cjs
CHANGED
|
@@ -275,13 +275,16 @@ var PostgrestBuilder = class {
|
|
|
275
275
|
const executeWithRetry = async () => {
|
|
276
276
|
let attemptCount = 0;
|
|
277
277
|
while (true) {
|
|
278
|
-
const
|
|
279
|
-
|
|
278
|
+
const headers = {};
|
|
279
|
+
_this.headers.forEach((value, key) => {
|
|
280
|
+
headers[key] = value;
|
|
281
|
+
});
|
|
282
|
+
if (attemptCount > 0) headers["X-Retry-Count"] = String(attemptCount);
|
|
280
283
|
let res$1;
|
|
281
284
|
try {
|
|
282
285
|
res$1 = await _fetch(_this.url.toString(), {
|
|
283
286
|
method: _this.method,
|
|
284
|
-
headers
|
|
287
|
+
headers,
|
|
285
288
|
body: JSON.stringify(_this.body, (_, value) => typeof value === "bigint" ? value.toString() : value),
|
|
286
289
|
signal: _this.signal
|
|
287
290
|
});
|
|
@@ -792,9 +795,9 @@ var PostgrestTransformBuilder = class extends PostgrestBuilder {
|
|
|
792
795
|
return this;
|
|
793
796
|
}
|
|
794
797
|
/**
|
|
795
|
-
* Limit the query result by `
|
|
798
|
+
* Limit the query result by `rows`.
|
|
796
799
|
*
|
|
797
|
-
* @param
|
|
800
|
+
* @param rows - The maximum number of rows to return
|
|
798
801
|
* @param options - Named parameters
|
|
799
802
|
* @param options.referencedTable - Set this to limit rows of referenced
|
|
800
803
|
* tables instead of the parent table
|
|
@@ -891,9 +894,9 @@ var PostgrestTransformBuilder = class extends PostgrestBuilder {
|
|
|
891
894
|
* }
|
|
892
895
|
* ```
|
|
893
896
|
*/
|
|
894
|
-
limit(
|
|
897
|
+
limit(rows, { foreignTable, referencedTable = foreignTable } = {}) {
|
|
895
898
|
const key = typeof referencedTable === "undefined" ? "limit" : `${referencedTable}.limit`;
|
|
896
|
-
this.url.searchParams.set(key, `${
|
|
899
|
+
this.url.searchParams.set(key, `${rows}`);
|
|
897
900
|
return this;
|
|
898
901
|
}
|
|
899
902
|
/**
|
|
@@ -1336,13 +1339,13 @@ var PostgrestTransformBuilder = class extends PostgrestBuilder {
|
|
|
1336
1339
|
* Set the maximum number of rows that can be affected by the query.
|
|
1337
1340
|
* Only available in PostgREST v13+ and only works with PATCH and DELETE methods.
|
|
1338
1341
|
*
|
|
1339
|
-
* @param
|
|
1342
|
+
* @param rows - The maximum number of rows that can be affected
|
|
1340
1343
|
*
|
|
1341
1344
|
* @category Database
|
|
1342
1345
|
*/
|
|
1343
|
-
maxAffected(
|
|
1346
|
+
maxAffected(rows) {
|
|
1344
1347
|
this.headers.append("Prefer", "handling=strict");
|
|
1345
|
-
this.headers.append("Prefer", `max-affected=${
|
|
1348
|
+
this.headers.append("Prefer", `max-affected=${rows}`);
|
|
1346
1349
|
return this;
|
|
1347
1350
|
}
|
|
1348
1351
|
};
|