Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

docs: add comments for deleted subscriptions

Paul Copplestone2ef4d8133ac4
diff --git a/web/docs/client/generating-types.mdx b/web/docs/client/generating-types.mdx
index 0c500e387f5..cc012a97f37 100644
--- a/web/docs/client/generating-types.mdx
+++ b/web/docs/client/generating-types.mdx
@@ -12,9 +12,9 @@ Supabase will soon release native type generators that dump your database types
## Usage with TypeScript
-`supabase-js` ships with type definitions for usage with TypeScript and for convenient IntelliSense autocomplete and documentation in your editor.
+`supabase-js` ships with type definitions for usage with TypeScript and for convenient IntelliSense auto-complete and documentation in your editor.
-When using TypeScript, you can pass the type of database row as a type parameter to the `from` method to get better autocompletion support down the chain.
+When using TypeScript, you can pass the type of database row as a type parameter to the `from` method to get better auto-completion support down the chain.
If you don't provide a type for the row you need to explicitly pass `from<any>('tableName')`.
```ts
@@ -25,13 +25,13 @@ type Message = {
user_id: string;
channel_id: number;
author: { username: string };
-};
+}
const response = await supabase
.from<Message>('messages') // Message maps to the type of the row in your database.
.select('*, author:user_id(username)')
- .match({ channel_id: 2 }) // Your IDE will be able to help with automcompletion.
-response.data // Response body will be of type Array<Message>.
+ .match({ channel_id: 2 }) // Your IDE will be able to help with auto-completion.
+response.data // Response data will be of type Array<Message>.
// If you don't provide a type for the row you need to explicitly pass `from<any>('tableName')`.
const response = await supabase
@@ -51,10 +51,10 @@ The Swagger specification for your Supabase project can be accessed as follows:
https://your-project.supabase.co/rest/v1/?apikey=your-anon-key
```
-Using the open source [swagger-to-ts](https://github.com/drwpow/openapi-typescript#%EF%B8%8F-reading-specs-from-remote-resource) tool you can generate your types and store them locally:
+Using the open source [swagger-to-ts](https://github.com/manifoldco/swagger-to-ts#%EF%B8%8F-reading-specs-from-remote-resource) tool you can generate your types and store them locally:
```bash
-npx openapi-typescript https://your-project.supabase.co/rest/v1/?apikey=your-anon-key --output types/supabase.ts
+npx @manifoldco/swagger-to-ts https://your-project.supabase.co/rest/v1/?apikey=your-anon-key --output types/supabase.ts
```
**Note:** Do note that your local types won't automatically stay in sync with your database, so make sure to regenerate your types after your make changes to your database.
diff --git a/web/docs/client/subscribe.mdx b/web/docs/client/subscribe.mdx
index 85b3dd2a99e..ee2db72f550 100644
--- a/web/docs/client/subscribe.mdx
+++ b/web/docs/client/subscribe.mdx
@@ -204,6 +204,8 @@ const mySubscription = supabase
### Listening to updates
+By default Supabase will send only the updated record. If you want to receive the previous values as well you can
+enable full replication for the table you are listening too: `alter table "your_table" replica identity full;`
<Tabs
@@ -237,6 +239,8 @@ const mySubscription = supabase
### Listening to deletes
+By default Supabase not send deleted records. If you want to receive the deleted record you can
+enable full replication for the table you are listening too: `alter table "your_table" replica identity full;`
<Tabs
diff --git a/web/spec/supabase.yml b/web/spec/supabase.yml
index 33801428e5c..08e9d32cf89 100644
--- a/web/spec/supabase.yml
+++ b/web/spec/supabase.yml
@@ -149,9 +149,9 @@ pages:
## Usage with TypeScript
- `supabase-js` ships with type definitions for usage with TypeScript and for convenient IntelliSense autocomplete and documentation in your editor.
+ `supabase-js` ships with type definitions for usage with TypeScript and for convenient IntelliSense auto-complete and documentation in your editor.
- When using TypeScript, you can pass the type of database row as a type parameter to the `from` method to get better autocompletion support down the chain.
+ When using TypeScript, you can pass the type of database row as a type parameter to the `from` method to get better auto-completion support down the chain.
If you don't provide a type for the row you need to explicitly pass `from<any>('tableName')`.
```ts
@@ -162,20 +162,20 @@ pages:
user_id: string;
channel_id: number;
author: { username: string };
- };
+ }
const response = await supabase
.from<Message>('messages') // Message maps to the type of the row in your database.
.select('*, author:user_id(username)')
- .match({ channel_id: 2 }); // Your IDE will be able to help with automcompletion.
- response.body // Response body will be of type Array<Message>.
+ .match({ channel_id: 2 }) // Your IDE will be able to help with auto-completion.
+ response.data // Response data will be of type Array<Message>.
// If you don't provide a type for the row you need to explicitly pass `from<any>('tableName')`.
const response = await supabase
.from<any>('messages')
.select('*, author:user_id(username)')
- .match({ channel_id: 2 });
- response.body // Response body will be of type Array<any>.
+ .match({ channel_id: 2 })
+ response.data // Response data will be of type Array<any>.
```
### Generate database types from Swagger OpenAPI specification
@@ -713,6 +713,9 @@ pages:
# Not yet implemented
```
- name: Listening to updates
+ description: |
+ By default Supabase will send only the updated record. If you want to receive the previous values as well you can
+ enable full replication for the table you are listening too: `alter table "your_table" replica identity full;`
js: |
```js
const mySubscription = supabase
@@ -727,6 +730,9 @@ pages:
# Not yet implemented
```
- name: Listening to deletes
+ description: |
+ By default Supabase not send deleted records. If you want to receive the deleted record you can
+ enable full replication for the table you are listening too: `alter table "your_table" replica identity full;`
js: |
```js
const mySubscription = supabase