query.primaryKeys() function

Return names of primary key fields for a given model.

Signature:

export function primaryKeys(model: typeof BaseModel): string[];

Parameters

Parameter

Type

Description

model

typeof BaseModel

Model to read the keys of.

Returns:

string[]

The primary key attribute names, in declaration order.

Read this page as plain markdown — no HTML, no navigation. For pasting into an LLM, or for an agent to fetch.