Skip to main content

Prisma

Migrations

Customize a migration to include an unsupported feature.

First, use the --create-only flag to generate a new migration without applying it:

npx prisma migrate dev --create-only

Open the generated migration.sql file and add the electrify call:

ALTER TABLE items ENABLE ELECTRIC;

Apply the migration:

npx prisma migrate dev

Generator

Electric uses a customised version of the zod-prisma-types Prisma client generator to generate the Electric Client.

Event sourcing

Prisma provides Pulse, a type-safe API for subscribing to database change events.