property PrismaAdapterOptions.entities
Since 0.2.0

Per-entity overrides for key resolution and other model-specific tuning.

The only override exercised today is compositeKeyName on entities that carry a named @@id constraint — Prisma generates the field name from the name: argument rather than joining column names with _, so the derived name is wrong for such models. Setting the override tells the adapter the correct field to address in the compound-key where argument.

Examples

Example 1

new PrismaAdapter({
  prismaClient,
  entities: {
    Enrollment: { compositeKeyName: 'enrollmentKey' },
  },
});

Type

Readonly<Record<string, PrismaCompositeKeyOptions>>

Usage

import { type PrismaAdapterOptions } from "database-plugin/src/index.ts";