Skip to content

Commit

Permalink
docs: add limitation on pulse type generation
Browse files Browse the repository at this point in the history
  • Loading branch information
ankur-arch committed Mar 20, 2024
1 parent aa68437 commit 8874dc5
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions content/400-pulse/500-known-limitations.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,29 @@ Prisma Pulse subscriptions cannot be initiated directly within client-side code.
## Limited to Postgres versions 12 or higher

Prisma Pulse is currently supported with Postgres versions 12 or higher. It should work with most Postgres providers that expose Postgres’ native logical replication feature.

## Subscription type limitation with custom publication slots

Our advanced onboarding flow enables you to provide a [custom publication slot](/pulse/database-setup/general-database-instructions#manage-your-own-publication-slot). Should that custom publication slot only contains a subset of your database tables, the Prisma Client generated with the Pulse Client Extension will continue to permit subscriptions to all models based on the entirety of your Prisma Schema definitions.

For example, if you have two models in your schema, the `User` and `Post` model. And you opt to create a publication to monitor changes in the `User` model exclusively:

```sql
CREATE PUBLICATION user_publication FOR TABLE users;
```

> To learn more about creating custom publication slots, see [managing your publication slot](https://www.prisma.io/docs/pulse/database-setup/general-database-instructions#manage-your-own-publication-slot).
Your resulting subscription code would be:

```ts
const userSubscription = prisma.user.subscribe()
```

However, despite the absence of publication coverage, the generated Prisma client permits subscriptions for all models, such as the `Post` model:

```ts
const postSubscription = prisma.post.subscribe()
```

> We are actively working on enhancing type generation for custom publications as part of our ongoing efforts to further refine Prisma Pulse.

0 comments on commit 8874dc5

Please sign in to comment.