Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@prisma/extension-pulse

Package Overview
Dependencies
Maintainers
0
Versions
89
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@prisma/extension-pulse

Prisma Client extension for Pulse

  • 1.2.0
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
2.3K
decreased by-28.4%
Maintainers
0
Weekly downloads
 
Created
Source

Pulse Prisma Client extension

This is the package for the Prisma Client extension that enables usage of Prisma Pulse.

What is Prisma Pulse?

Prisma Pulse is a managed Change Data Capture (CDC) service that makes it easy to react to changes in your databases with type-safe model streams.

It enables developers to build real-time apps by streaming database changes into their application in a type-safe way — with just a few lines of code:

// 1. Subscribe to all changes on the `User` table
const stream = await prisma.user.stream();

// 2. Wait for changes to happen in the DB so that new events arrive
for await (let event of stream) {
  // 3. Do something with an event, e.g. log the its details to the terminal
  console.log(`Something happened in the database: `, event);
}

Here is an overview of the main features Prisma Pulse provides:

  • Type-safe reactions to database changes
  • Delivery guarantees for events: "at least once" and in the "right order"
  • Resumable event streams in case your server goes down
  • Unidirectional data flow via Change Data Capture (CDC)
  • Great DX integrated with usage of Prisma ORM (easy setup, development and maintenance)
  • Compatibility with your existing database
  • Insights dashboard, so you can view and understand all database events captured by Pulse

Get started

Get started with Prisma Pulse by following the instructions in the docs.

If you want to learn more about Pulse, you can also check out these resoures:

Important

Using "moduleResolution": "bundler"

The Prisma Pulse extension offers separate implementations tailored for various runtimes, such as Node.js and Cloudflare Workers. If you're using bundler moduleResolution in your TSConfig, you must also explicitly set customConditions to either node or workerd depending on your target runtime. This will instruct TypeScript to match the correct type definitions of the Prisma Pulse extension, as well as any other packages that expose multiple entrypoints.

// tsconfig.json
{
  "compilerOptions": {
    // ...other options
    "target": "es2022",
    "moduleResolution": "bundler",
    "customConditions": ["workerd"] // or "node"
  }
}

Resources

FAQs

Package last updated on 09 Jul 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc