Prisma Adapter

April 15, 2025

Deprecated Feature

@c15t/backend v1 did not deliver the flexibility we wanted and fell short of our standards. It is now deprecated as we work on a full rewrite, with v2 entering canary soon. This does not affect consent.io deployments, which remain stable.

Installation

First, install Prisma and initialize your project:

Configuration

  1. Define your Prisma schema in prisma/schema.prisma:
  1. Generate the Prisma client:
  1. Configure the c15t instance with the Prisma adapter:

Usage Examples

Basic CRUD Operations

Transactions

Migrations

Run migrations using the Prisma CLI:

Type Safety

The Prisma adapter provides type safety when used with TypeScript:

Best Practices

  • Define schema in Prisma format - Use Prisma's schema format for auto-generated migration files
  • Use migrations for schema changes - Let Prisma handle database schema migrations
  • Enable query logging in development - Monitor query performance and debug issues
  • Consider connection pooling - Configure connection pools for production performance

Limitations

  • Table names must match Prisma model names
  • Some advanced query features may require direct Prisma client usage