property PrismaCompositeKeyOptions.keyColumns
Since 0.2.0

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).

Examples

Example 1

// Named @@id: columns must be supplied explicitly.
entities: {
  Enrollment: { compositeKeyName: 'enrollmentKey', keyColumns: ['courseId', 'personId'] },
}

Type

readonly string[]

Usage

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