Drizzle 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

Install Drizzle ORM and the appropriate database driver:

Configuration

  1. Define your schema using Drizzle's schema builder:
  1. Configure the c15t instance with the Drizzle adapter:

MySQL Configuration

SQLite Configuration

Usage Examples

Basic CRUD Operations

Transactions

Migrations

Use Drizzle Kit for schema migrations:

Type Safety

The Drizzle adapter provides excellent type safety:

Best Practices

  • Define schema using Drizzle's builders - Leverage type safety and schema validation
  • Use prepared statements - Drizzle uses prepared statements for all queries
  • Implement connection pooling - Configure appropriate pool sizes for production
  • Use migrations for schema changes - Manage schema changes with Drizzle Kit

Limitations

  • Some complex queries may require direct Drizzle client usage
  • Table names must match schema definitions