From 1aed2169de78bb06fa892a337a6825bbd7ebbaa5 Mon Sep 17 00:00:00 2001 From: "supabase-supabase-autofixer[bot]" <248690971+supabase-supabase-autofixer[bot]@users.noreply.github.com> Date: Tue, 9 Jun 2026 19:17:12 +0300 Subject: [PATCH] docs: update js sdk docs (2.108.1) (#46785) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Updates JS sdk documentation following stable release. Ran `make download.tsdoc.v2` in apps/docs/spec and refreshed the reference-content snapshot. **Details:** - **Version:** `2.108.1` - **Source:** `manual` - **Changes:** Regenerated tsdoc files from latest spec files 🤖 Auto-generated from @supabase/supabase-js stable release. Co-authored-by: mandarini <6603745+mandarini@users.noreply.github.com> --- .../build-reference-content.v2.json | 508 +++++++----------- 1 file changed, 189 insertions(+), 319 deletions(-) diff --git a/apps/docs/scripts/__snapshots__/build-reference-content.v2.json b/apps/docs/scripts/__snapshots__/build-reference-content.v2.json index d7d17c8dd43..f15c6ac0e19 100644 --- a/apps/docs/scripts/__snapshots__/build-reference-content.v2.json +++ b/apps/docs/scripts/__snapshots__/build-reference-content.v2.json @@ -42,13 +42,6 @@ "product": "database", "type": "function" }, - "geojson": { - "id": "geojson", - "title": "geojson", - "slug": "geojson", - "product": "database", - "type": "function" - }, "insert": { "id": "insert", "title": "insert", @@ -56,34 +49,6 @@ "product": "database", "type": "function" }, - "maxaffected": { - "id": "maxaffected", - "title": "maxAffected", - "slug": "maxaffected", - "product": "database", - "type": "function" - }, - "retry": { - "id": "retry", - "title": "retry", - "slug": "retry", - "product": "database", - "type": "function" - }, - "returns": { - "id": "returns", - "title": "returns", - "slug": "returns", - "product": "database", - "type": "function" - }, - "rollback": { - "id": "rollback", - "title": "rollback", - "slug": "rollback", - "product": "database", - "type": "function" - }, "rpc": { "id": "rpc", "title": "rpc", @@ -105,20 +70,6 @@ "product": "database", "type": "function" }, - "setheader": { - "id": "setheader", - "title": "setHeader", - "slug": "setheader", - "product": "database", - "type": "function" - }, - "throwonerror": { - "id": "throwonerror", - "title": "throwOnError", - "slug": "throwonerror", - "product": "database", - "type": "function" - }, "update": { "id": "update", "title": "update", @@ -355,6 +306,13 @@ "product": "database", "type": "function" }, + "using-modifiers-geojson": { + "id": "using-modifiers-geojson", + "title": "geojson", + "slug": "using-modifiers-geojson", + "product": "database", + "type": "function" + }, "using-modifiers-limit": { "id": "using-modifiers-limit", "title": "limit", @@ -362,6 +320,13 @@ "product": "database", "type": "function" }, + "using-modifiers-maxaffected": { + "id": "using-modifiers-maxaffected", + "title": "maxAffected", + "slug": "using-modifiers-maxaffected", + "product": "database", + "type": "function" + }, "using-modifiers-maybesingle": { "id": "using-modifiers-maybesingle", "title": "maybeSingle", @@ -390,6 +355,13 @@ "product": "database", "type": "function" }, + "using-modifiers-retry": { + "id": "using-modifiers-retry", + "title": "retry", + "slug": "using-modifiers-retry", + "product": "database", + "type": "function" + }, "using-modifiers-returns": { "id": "using-modifiers-returns", "title": "returns", @@ -397,6 +369,13 @@ "product": "database", "type": "function" }, + "using-modifiers-rollback": { + "id": "using-modifiers-rollback", + "title": "rollback", + "slug": "using-modifiers-rollback", + "product": "database", + "type": "function" + }, "using-modifiers-select": { "id": "using-modifiers-select", "title": "select", @@ -404,6 +383,13 @@ "product": "database", "type": "function" }, + "using-modifiers-setheader": { + "id": "using-modifiers-setheader", + "title": "setHeader", + "slug": "using-modifiers-setheader", + "product": "database", + "type": "function" + }, "using-modifiers-single": { "id": "using-modifiers-single", "title": "single", @@ -418,6 +404,13 @@ "product": "database", "type": "function" }, + "using-modifiers-throwonerror": { + "id": "using-modifiers-throwonerror", + "title": "throwOnError", + "slug": "using-modifiers-throwonerror", + "product": "database", + "type": "function" + }, "auth": { "id": "auth", "title": "Overview", @@ -1716,7 +1709,6 @@ "[Circular]", "[Circular]", "[Circular]", - "[Circular]", "[Circular]" ], "sections": [ @@ -1728,13 +1720,6 @@ "type": "category", "title": "Database", "items": [ - "[Circular]", - "[Circular]", - "[Circular]", - "[Circular]", - "[Circular]", - "[Circular]", - "[Circular]", "[Circular]", "[Circular]", "[Circular]", @@ -1801,6 +1786,12 @@ "[Circular]", "[Circular]", "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", + "[Circular]", "[Circular]" ] } @@ -2088,30 +2079,10 @@ "id": "from", "$ref": "@supabase/postgrest-js.PostgrestClient.from" }, - { - "id": "geojson", - "$ref": "@supabase/postgrest-js.PostgrestFilterBuilder.geojson" - }, { "id": "insert", "$ref": "@supabase/postgrest-js.PostgrestQueryBuilder.insert" }, - { - "id": "maxaffected", - "$ref": "@supabase/postgrest-js.PostgrestFilterBuilder.maxAffected" - }, - { - "id": "retry", - "$ref": "@supabase/postgrest-js.PostgrestBuilder.retry" - }, - { - "id": "returns", - "$ref": "@supabase/postgrest-js.PostgrestBuilder.returns" - }, - { - "id": "rollback", - "$ref": "@supabase/postgrest-js.PostgrestFilterBuilder.rollback" - }, { "id": "rpc", "$ref": "@supabase/postgrest-js.PostgrestClient.rpc" @@ -2124,14 +2095,6 @@ "id": "select", "$ref": "@supabase/postgrest-js.PostgrestQueryBuilder.select" }, - { - "id": "setheader", - "$ref": "@supabase/postgrest-js.PostgrestBuilder.setHeader" - }, - { - "id": "throwonerror", - "$ref": "@supabase/postgrest-js.PostgrestBuilder.throwOnError" - }, { "id": "update", "$ref": "@supabase/postgrest-js.PostgrestQueryBuilder.update" @@ -2309,10 +2272,18 @@ "id": "using-modifiers-explain", "$ref": "@supabase/postgrest-js.PostgrestFilterBuilder.explain" }, + { + "id": "using-modifiers-geojson", + "$ref": "@supabase/postgrest-js.PostgrestFilterBuilder.geojson" + }, { "id": "using-modifiers-limit", "$ref": "@supabase/postgrest-js.PostgrestFilterBuilder.limit" }, + { + "id": "using-modifiers-maxaffected", + "$ref": "@supabase/postgrest-js.PostgrestFilterBuilder.maxAffected" + }, { "id": "using-modifiers-maybesingle", "$ref": "@supabase/postgrest-js.PostgrestFilterBuilder.maybeSingle" @@ -2329,14 +2300,26 @@ "id": "using-modifiers-range", "$ref": "@supabase/postgrest-js.PostgrestFilterBuilder.range" }, + { + "id": "using-modifiers-retry", + "$ref": "@supabase/postgrest-js.PostgrestBuilder.retry" + }, { "id": "using-modifiers-returns", - "$ref": "@supabase/postgrest-js.PostgrestFilterBuilder.returns" + "$ref": "@supabase/postgrest-js.PostgrestBuilder.returns" + }, + { + "id": "using-modifiers-rollback", + "$ref": "@supabase/postgrest-js.PostgrestFilterBuilder.rollback" }, { "id": "using-modifiers-select", "$ref": "@supabase/postgrest-js.PostgrestFilterBuilder.select" }, + { + "id": "using-modifiers-setheader", + "$ref": "@supabase/postgrest-js.PostgrestBuilder.setHeader" + }, { "id": "using-modifiers-single", "$ref": "@supabase/postgrest-js.PostgrestFilterBuilder.single" @@ -2345,6 +2328,10 @@ "id": "using-modifiers-stripnulls", "$ref": "@supabase/postgrest-js.PostgrestBuilder.stripNulls" }, + { + "id": "using-modifiers-throwonerror", + "$ref": "@supabase/postgrest-js.PostgrestBuilder.throwOnError" + }, { "id": "auth", "title": "Overview", @@ -11306,7 +11293,7 @@ } }, "comment": { - "shortText": "Initializes the client session either from the url or from storage.\nThis method is automatically called when instantiating the client, but should also be called\nmanually when checking for an error from an auth redirect (oauth, magiclink, password recovery, etc)." + "shortText": "Initialize the auth client by loading the session from storage or\ndetecting it from the URL after an OAuth, magic-link, or password-recovery\nredirect.\n\n**Most callers do not need to invoke this directly.** The client calls it\nautomatically during construction, and to react to sign-in events (including\npost-redirect events) you should subscribe to `onAuthStateChange` rather\nthan awaiting `initialize()`.\n\nYou only need to call it manually when you have opted out of the automatic\ncall by passing `skipAutoInitialize: true` — for example, in an SSR context\nwhere you need to control initialization timing. In that case, awaiting\n`initialize()` returns the resolved session result (or any error encountered\nwhile detecting it from the URL)." } }, "@supabase/auth-js.GoTrueClient.isThrowOnErrorEnabled": { @@ -34904,6 +34891,9 @@ "type": { "type": "intrinsic", "name": "string" + }, + "comment": { + "shortText": "HTTP header name" } }, { @@ -34911,6 +34901,9 @@ "type": { "type": "intrinsic", "name": "string" + }, + "comment": { + "shortText": "HTTP header value" } } ], @@ -34921,7 +34914,7 @@ } }, "comment": { - "shortText": "Set an HTTP header for the request." + "shortText": "Set an HTTP header on this single PostgREST request, overriding any header\nwith the same name set on the client.\n\nThis is an advanced escape hatch for one-off needs (passing a custom\n`Authorization` for a single query, attaching a tracing header, etc.).\nMost callers do not need it: configure client-wide headers via the\n`headers` option when constructing the client, and authentication via\nSupabase Auth." } }, "@supabase/postgrest-js.PostgrestBuilder.stripNulls": { @@ -35047,6 +35040,12 @@ "@supabase/postgrest-js.PostgrestBuilder.throwOnError": { "name": "@supabase/postgrest-js.PostgrestBuilder.throwOnError", "params": [], + "ret": { + "type": { + "type": "nameOnly", + "name": "PostgrestBuilder" + } + }, "comment": { "shortText": "If there's an error with the query, throwOnError will reject the promise by\nthrowing the error instead of returning it as part of a successful response.\n\nhttps://github.com/supabase/supabase-js/issues/92" } @@ -38600,7 +38599,14 @@ } }, "comment": { - "shortText": "Rollback the query.\n\n`data` will still be returned, but the query is not committed." + "shortText": "Dry-run this request: execute the query but discard the changes.\n\nServer-side, PostgREST runs the query inside a transaction and rolls it back\ninstead of committing. The response still contains the data that *would* have\nbeen returned — `RETURNING` clauses execute and RLS, triggers, and constraints\nare all evaluated — but no row is actually inserted, updated, or deleted.\n\nThis affects only the single request it is chained to. The JS caller has no\nhandle on the transaction: supabase-js does not group multiple queries into\none transaction. For multi-statement transactional logic, use a database\nfunction (`supabase.rpc(...)`).\n\nSets the `Prefer: tx=rollback` header. See PostgREST's docs on transaction\npreferences for the underlying mechanism.", + "examples": [ + { + "id": "validate-an-insert-without-persisting", + "name": "Validate an insert without persisting", + "code": "```ts\nconst { data, error } = await supabase\n .from('countries')\n .insert({ name: 'France' })\n .select()\n .rollback()\n// `data` shows what would have been inserted; nothing is saved.\n```" + } + ] } }, "@supabase/postgrest-js.PostgrestFilterBuilder.select": { @@ -38647,6 +38653,9 @@ "type": { "type": "intrinsic", "name": "string" + }, + "comment": { + "shortText": "HTTP header name" } }, { @@ -38654,6 +38663,9 @@ "type": { "type": "intrinsic", "name": "string" + }, + "comment": { + "shortText": "HTTP header value" } } ], @@ -38664,7 +38676,7 @@ } }, "comment": { - "shortText": "Set an HTTP header for the request." + "shortText": "Set an HTTP header on this single PostgREST request, overriding any header\nwith the same name set on the client.\n\nThis is an advanced escape hatch for one-off needs (passing a custom\n`Authorization` for a single query, attaching a tracing header, etc.).\nMost callers do not need it: configure client-wide headers via the\n`headers` option when constructing the client, and authentication via\nSupabase Auth." } }, "@supabase/postgrest-js.PostgrestFilterBuilder.single": { @@ -38891,118 +38903,7 @@ "type": "function", "params": [ { - "name": "value", - "type": { - "type": "union", - "name": "PostgrestSingleResponse", - "subTypes": [ - { - "type": "object", - "name": "PostgrestResponseSuccess", - "properties": [ - { - "name": "count", - "type": { - "type": "union", - "subTypes": [ - { - "type": "literal", - "value": null - }, - { - "type": "intrinsic", - "name": "number" - } - ] - } - }, - { - "name": "data", - "type": { - "type": "nameOnly", - "name": "@supabase/postgrest-js.default.Result" - } - }, - { - "name": "error", - "type": { - "type": "literal", - "value": null - } - }, - { - "name": "status", - "type": { - "type": "intrinsic", - "name": "number" - } - }, - { - "name": "statusText", - "type": { - "type": "intrinsic", - "name": "string" - } - }, - { - "name": "success", - "type": { - "type": "literal", - "value": true - } - } - ] - }, - { - "type": "object", - "name": "PostgrestResponseFailure", - "properties": [ - { - "name": "count", - "type": { - "type": "literal", - "value": null - } - }, - { - "name": "data", - "type": { - "type": "literal", - "value": null - } - }, - { - "name": "error", - "type": { - "type": "nameOnly", - "name": "PostgrestError" - } - }, - { - "name": "status", - "type": { - "type": "intrinsic", - "name": "number" - } - }, - { - "name": "statusText", - "type": { - "type": "intrinsic", - "name": "string" - } - }, - { - "name": "success", - "type": { - "type": "literal", - "value": false - } - } - ] - } - ] - } + "name": "value" } ], "ret": { @@ -39085,6 +38986,12 @@ "@supabase/postgrest-js.PostgrestFilterBuilder.throwOnError": { "name": "@supabase/postgrest-js.PostgrestFilterBuilder.throwOnError", "params": [], + "ret": { + "type": { + "type": "nameOnly", + "name": "PostgrestFilterBuilder" + } + }, "comment": { "shortText": "If there's an error with the query, throwOnError will reject the promise by\nthrowing the error instead of returning it as part of a successful response.\n\nhttps://github.com/supabase/supabase-js/issues/92" } @@ -40830,7 +40737,14 @@ } }, "comment": { - "shortText": "Rollback the query.\n\n`data` will still be returned, but the query is not committed." + "shortText": "Dry-run this request: execute the query but discard the changes.\n\nServer-side, PostgREST runs the query inside a transaction and rolls it back\ninstead of committing. The response still contains the data that *would* have\nbeen returned — `RETURNING` clauses execute and RLS, triggers, and constraints\nare all evaluated — but no row is actually inserted, updated, or deleted.\n\nThis affects only the single request it is chained to. The JS caller has no\nhandle on the transaction: supabase-js does not group multiple queries into\none transaction. For multi-statement transactional logic, use a database\nfunction (`supabase.rpc(...)`).\n\nSets the `Prefer: tx=rollback` header. See PostgREST's docs on transaction\npreferences for the underlying mechanism.", + "examples": [ + { + "id": "validate-an-insert-without-persisting", + "name": "Validate an insert without persisting", + "code": "```ts\nconst { data, error } = await supabase\n .from('countries')\n .insert({ name: 'France' })\n .select()\n .rollback()\n// `data` shows what would have been inserted; nothing is saved.\n```" + } + ] } }, "@supabase/postgrest-js.PostgrestTransformBuilder.select": { @@ -40877,6 +40791,9 @@ "type": { "type": "intrinsic", "name": "string" + }, + "comment": { + "shortText": "HTTP header name" } }, { @@ -40884,6 +40801,9 @@ "type": { "type": "intrinsic", "name": "string" + }, + "comment": { + "shortText": "HTTP header value" } } ], @@ -40894,7 +40814,7 @@ } }, "comment": { - "shortText": "Set an HTTP header for the request." + "shortText": "Set an HTTP header on this single PostgREST request, overriding any header\nwith the same name set on the client.\n\nThis is an advanced escape hatch for one-off needs (passing a custom\n`Authorization` for a single query, attaching a tracing header, etc.).\nMost callers do not need it: configure client-wide headers via the\n`headers` option when constructing the client, and authentication via\nSupabase Auth." } }, "@supabase/postgrest-js.PostgrestTransformBuilder.single": { @@ -40961,85 +40881,7 @@ "type": "function", "params": [ { - "name": "value", - "type": { - "type": "union", - "name": "PostgrestSingleResponse", - "subTypes": [ - { - "type": "object", - "name": "PostgrestResponseSuccess", - "properties": [ - { - "name": "count", - "type": { - "type": "union", - "subTypes": [ - "[Circular]", - "[Circular]" - ] - } - }, - { - "name": "data", - "type": { - "type": "nameOnly", - "name": "@supabase/postgrest-js.default.Result" - } - }, - { - "name": "error", - "type": "[Circular]" - }, - { - "name": "status", - "type": "[Circular]" - }, - { - "name": "statusText", - "type": "[Circular]" - }, - { - "name": "success", - "type": "[Circular]" - } - ] - }, - { - "type": "object", - "name": "PostgrestResponseFailure", - "properties": [ - { - "name": "count", - "type": "[Circular]" - }, - { - "name": "data", - "type": "[Circular]" - }, - { - "name": "error", - "type": { - "type": "nameOnly", - "name": "PostgrestError" - } - }, - { - "name": "status", - "type": "[Circular]" - }, - { - "name": "statusText", - "type": "[Circular]" - }, - { - "name": "success", - "type": "[Circular]" - } - ] - } - ] - } + "name": "value" } ], "ret": { @@ -41122,6 +40964,12 @@ "@supabase/postgrest-js.PostgrestTransformBuilder.throwOnError": { "name": "@supabase/postgrest-js.PostgrestTransformBuilder.throwOnError", "params": [], + "ret": { + "type": { + "type": "nameOnly", + "name": "PostgrestTransformBuilder" + } + }, "comment": { "shortText": "If there's an error with the query, throwOnError will reject the promise by\nthrowing the error instead of returning it as part of a successful response.\n\nhttps://github.com/supabase/supabase-js/issues/92" } @@ -63959,7 +63807,7 @@ } }, "comment": { - "shortText": "Initializes the client session either from the url or from storage.\nThis method is automatically called when instantiating the client, but should also be called\nmanually when checking for an error from an auth redirect (oauth, magiclink, password recovery, etc)." + "shortText": "Initialize the auth client by loading the session from storage or\ndetecting it from the URL after an OAuth, magic-link, or password-recovery\nredirect.\n\n**Most callers do not need to invoke this directly.** The client calls it\nautomatically during construction, and to react to sign-in events (including\npost-redirect events) you should subscribe to `onAuthStateChange` rather\nthan awaiting `initialize()`.\n\nYou only need to call it manually when you have opted out of the automatic\ncall by passing `skipAutoInitialize: true` — for example, in an SSR context\nwhere you need to control initialization timing. In that case, awaiting\n`initialize()` returns the resolved session result (or any error encountered\nwhile detecting it from the URL)." } }, "@supabase/supabase-js.GoTrueClient.isThrowOnErrorEnabled": { @@ -78652,6 +78500,9 @@ "type": { "type": "intrinsic", "name": "string" + }, + "comment": { + "shortText": "HTTP header name" } }, { @@ -78659,6 +78510,9 @@ "type": { "type": "intrinsic", "name": "string" + }, + "comment": { + "shortText": "HTTP header value" } } ], @@ -78669,7 +78523,7 @@ } }, "comment": { - "shortText": "Set an HTTP header for the request." + "shortText": "Set an HTTP header on this single PostgREST request, overriding any header\nwith the same name set on the client.\n\nThis is an advanced escape hatch for one-off needs (passing a custom\n`Authorization` for a single query, attaching a tracing header, etc.).\nMost callers do not need it: configure client-wide headers via the\n`headers` option when constructing the client, and authentication via\nSupabase Auth." } }, "@supabase/supabase-js.PostgrestBuilder.stripNulls": { @@ -78795,6 +78649,12 @@ "@supabase/supabase-js.PostgrestBuilder.throwOnError": { "name": "@supabase/supabase-js.PostgrestBuilder.throwOnError", "params": [], + "ret": { + "type": { + "type": "nameOnly", + "name": "PostgrestBuilder" + } + }, "comment": { "shortText": "If there's an error with the query, throwOnError will reject the promise by\nthrowing the error instead of returning it as part of a successful response.\n\nhttps://github.com/supabase/supabase-js/issues/92" } @@ -81620,7 +81480,14 @@ } }, "comment": { - "shortText": "Rollback the query.\n\n`data` will still be returned, but the query is not committed." + "shortText": "Dry-run this request: execute the query but discard the changes.\n\nServer-side, PostgREST runs the query inside a transaction and rolls it back\ninstead of committing. The response still contains the data that *would* have\nbeen returned — `RETURNING` clauses execute and RLS, triggers, and constraints\nare all evaluated — but no row is actually inserted, updated, or deleted.\n\nThis affects only the single request it is chained to. The JS caller has no\nhandle on the transaction: supabase-js does not group multiple queries into\none transaction. For multi-statement transactional logic, use a database\nfunction (`supabase.rpc(...)`).\n\nSets the `Prefer: tx=rollback` header. See PostgREST's docs on transaction\npreferences for the underlying mechanism.", + "examples": [ + { + "id": "validate-an-insert-without-persisting", + "name": "Validate an insert without persisting", + "code": "```ts\nconst { data, error } = await supabase\n .from('countries')\n .insert({ name: 'France' })\n .select()\n .rollback()\n// `data` shows what would have been inserted; nothing is saved.\n```" + } + ] } }, "@supabase/supabase-js.PostgrestFilterBuilder.select": { @@ -81667,6 +81534,9 @@ "type": { "type": "intrinsic", "name": "string" + }, + "comment": { + "shortText": "HTTP header name" } }, { @@ -81674,6 +81544,9 @@ "type": { "type": "intrinsic", "name": "string" + }, + "comment": { + "shortText": "HTTP header value" } } ], @@ -81684,7 +81557,7 @@ } }, "comment": { - "shortText": "Set an HTTP header for the request." + "shortText": "Set an HTTP header on this single PostgREST request, overriding any header\nwith the same name set on the client.\n\nThis is an advanced escape hatch for one-off needs (passing a custom\n`Authorization` for a single query, attaching a tracing header, etc.).\nMost callers do not need it: configure client-wide headers via the\n`headers` option when constructing the client, and authentication via\nSupabase Auth." } }, "@supabase/supabase-js.PostgrestFilterBuilder.single": { @@ -81878,21 +81751,7 @@ "type": "function", "params": [ { - "name": "value", - "type": { - "type": "union", - "name": "PostgrestSingleResponse", - "subTypes": [ - { - "type": "nameOnly", - "name": "PostgrestResponseSuccess" - }, - { - "type": "nameOnly", - "name": "PostgrestResponseFailure" - } - ] - } + "name": "value" } ], "ret": { @@ -81975,6 +81834,12 @@ "@supabase/supabase-js.PostgrestFilterBuilder.throwOnError": { "name": "@supabase/supabase-js.PostgrestFilterBuilder.throwOnError", "params": [], + "ret": { + "type": { + "type": "nameOnly", + "name": "PostgrestFilterBuilder" + } + }, "comment": { "shortText": "If there's an error with the query, throwOnError will reject the promise by\nthrowing the error instead of returning it as part of a successful response.\n\nhttps://github.com/supabase/supabase-js/issues/92" } @@ -83693,7 +83558,14 @@ } }, "comment": { - "shortText": "Rollback the query.\n\n`data` will still be returned, but the query is not committed." + "shortText": "Dry-run this request: execute the query but discard the changes.\n\nServer-side, PostgREST runs the query inside a transaction and rolls it back\ninstead of committing. The response still contains the data that *would* have\nbeen returned — `RETURNING` clauses execute and RLS, triggers, and constraints\nare all evaluated — but no row is actually inserted, updated, or deleted.\n\nThis affects only the single request it is chained to. The JS caller has no\nhandle on the transaction: supabase-js does not group multiple queries into\none transaction. For multi-statement transactional logic, use a database\nfunction (`supabase.rpc(...)`).\n\nSets the `Prefer: tx=rollback` header. See PostgREST's docs on transaction\npreferences for the underlying mechanism.", + "examples": [ + { + "id": "validate-an-insert-without-persisting", + "name": "Validate an insert without persisting", + "code": "```ts\nconst { data, error } = await supabase\n .from('countries')\n .insert({ name: 'France' })\n .select()\n .rollback()\n// `data` shows what would have been inserted; nothing is saved.\n```" + } + ] } }, "@supabase/supabase-js.PostgrestTransformBuilder.select": { @@ -83740,6 +83612,9 @@ "type": { "type": "intrinsic", "name": "string" + }, + "comment": { + "shortText": "HTTP header name" } }, { @@ -83747,6 +83622,9 @@ "type": { "type": "intrinsic", "name": "string" + }, + "comment": { + "shortText": "HTTP header value" } } ], @@ -83757,7 +83635,7 @@ } }, "comment": { - "shortText": "Set an HTTP header for the request." + "shortText": "Set an HTTP header on this single PostgREST request, overriding any header\nwith the same name set on the client.\n\nThis is an advanced escape hatch for one-off needs (passing a custom\n`Authorization` for a single query, attaching a tracing header, etc.).\nMost callers do not need it: configure client-wide headers via the\n`headers` option when constructing the client, and authentication via\nSupabase Auth." } }, "@supabase/supabase-js.PostgrestTransformBuilder.single": { @@ -83824,21 +83702,7 @@ "type": "function", "params": [ { - "name": "value", - "type": { - "type": "union", - "name": "PostgrestSingleResponse", - "subTypes": [ - { - "type": "nameOnly", - "name": "PostgrestResponseSuccess" - }, - { - "type": "nameOnly", - "name": "PostgrestResponseFailure" - } - ] - } + "name": "value" } ], "ret": { @@ -83921,6 +83785,12 @@ "@supabase/supabase-js.PostgrestTransformBuilder.throwOnError": { "name": "@supabase/supabase-js.PostgrestTransformBuilder.throwOnError", "params": [], + "ret": { + "type": { + "type": "nameOnly", + "name": "PostgrestTransformBuilder" + } + }, "comment": { "shortText": "If there's an error with the query, throwOnError will reject the promise by\nthrowing the error instead of returning it as part of a successful response.\n\nhttps://github.com/supabase/supabase-js/issues/92" }