Repository.upsert() method

Insert a row, or update the one already holding its key.

Signature:

upsert<Row = Entity, Input extends object = Record<string, unknown>>(args: {
        input: Input;
        conflictOn?: readonly string[] | undefined;
        select?: Select | undefined;
    }): Promise<Row>;

Parameters

Parameter

Type

Description

args

{ input: Input; conflictOn?: readonly string[] | undefined; select?: Select | undefined; }

Returns:

Promise<Row>

Remarks

The key is the id unless conflictOn names another unique — a queue keyed by (portfolioId, kind, reference) has no id to upsert on, and reading first and then writing is a race the unique index would lose.

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