The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.
TypeScript aialternativeauthdatabasedenoembeddingsexamplefirebasenextjsoauth2pgvectorpostgispostgrespostgresqlpostgrestrealtimesupabasevectorswebsockets
docs(js): add example for deleting a record and returning it (#26855)
Bobbie Soedirgoea9cfb921a20
diff --git a/apps/docs/spec/supabase_js_v2.yml b/apps/docs/spec/supabase_js_v2.ymlindex 9b3610b84c6..36c9820dbfd 100644--- a/apps/docs/spec/supabase_js_v2.yml+++ b/apps/docs/spec/supabase_js_v2.yml@@ -4102,7 +4102,7 @@ functions:name: Delete a single recordcode: |```ts- const { error } = await supabase+ const response = await supabase.from('countries').delete().eq('id', 1)@@ -4128,11 +4128,47 @@ functions:hideCodeBlock: trueisSpotlight: true+ - id: delete-records-and-return-it+ name: Delete a record and return it+ code: |+ ```ts+ const { data, error } = await supabase+ .from('countries')+ .delete()+ .eq('id', 1)+ .select()+ ```+ data:+ sql: |+ ```sql+ create table+ countries (id int8 primary key, name text);++ insert into+ countries (id, name)+ values+ (1, 'Spain');+ ```+ response: |+ ```json+ {+ "data": [+ {+ "id": 1,+ "name": "Spain"+ }+ ],+ "status": 200,+ "statusText": "OK"+ }+ ```+ hideCodeBlock: true+- id: delete-multiple-recordsname: Delete multiple recordscode: |```ts- const { error } = await supabase+ const response = await supabase.from('countries').delete().in('id', [1, 2, 3])@@ -4155,8 +4191,7 @@ functions:"statusText": "No Content"}```- hideCodeBlock: false- isSpotlight: false+ hideCodeBlock: true- id: rpctitle: 'Postgres functions: rpc()'