interface PrismaCompositeKeyOptions
Since 0.2.0

Per-entity overrides for the Prisma adapter.

Used to customise how the adapter addresses compound-key fields on a Prisma model — in particular the PrismaCompositeKeyOptions.compositeKeyName override that is mandatory when a model uses a named @@id constraint.

Properties

Since 0.2.0
readonly
optional
compositeKeyName: string

Override for the derived compound-key field name.

Prisma generates an unnamed @@id([a, b]) as a_b; a named @@id([...], name: "custom") generates only custom. When the derived name does not match the schema (e.g. a named @@id), set this to the Prisma-side generated field name so findById/update/delete emit the correct compound-key where argument.

Since 0.2.0
readonly
optional
keyColumns: readonly string[]

The primary-key columns for this entity, in Prisma schema declaration order.

Required when compositeKeyName is set: the adapter needs the column names to build the compound-key object that Prisma expects inside the where argument. Omitting it while naming a compositeKeyName leaves the columns at the scalar default ['id'], and every composite key is refused for missing the id column — measured against live PostgreSQL in the M79 live suite. Supply every column, in declaration order, for both unnamed @@id (derived field tenantId_userId) and named @@id models.

Defaults to ['id'] when absent (scalar-key path).

Usage

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