@supabase/postgrest-js 2.107.0 → 2.108.0-canary.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 CHANGED
@@ -275,13 +275,16 @@ var PostgrestBuilder = class {
275
275
  const executeWithRetry = async () => {
276
276
  let attemptCount = 0;
277
277
  while (true) {
278
- const requestHeaders = new Headers(_this.headers);
279
- if (attemptCount > 0) requestHeaders.set("X-Retry-Count", String(attemptCount));
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: requestHeaders,
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 `count`.
798
+ * Limit the query result by `rows`.
796
799
  *
797
- * @param count - The maximum number of rows to return
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(count, { foreignTable, referencedTable = foreignTable } = {}) {
897
+ limit(rows, { foreignTable, referencedTable = foreignTable } = {}) {
895
898
  const key = typeof referencedTable === "undefined" ? "limit" : `${referencedTable}.limit`;
896
- this.url.searchParams.set(key, `${count}`);
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 value - The maximum number of rows that can be affected
1342
+ * @param rows - The maximum number of rows that can be affected
1340
1343
  *
1341
1344
  * @category Database
1342
1345
  */
1343
- maxAffected(value) {
1346
+ maxAffected(rows) {
1344
1347
  this.headers.append("Prefer", "handling=strict");
1345
- this.headers.append("Prefer", `max-affected=${value}`);
1348
+ this.headers.append("Prefer", `max-affected=${rows}`);
1346
1349
  return this;
1347
1350
  }
1348
1351
  };