Function: bindingPort()
function bindingPort(config: BindingPortConfig): EntityStatePort;Defined in: server/lifecycle/binding-port.ts:76
The default EntityStatePort over a registered Prisma model — the
common "single id column + status column" case. Reads and compare-and-sets
through the ambient transaction (no explicit tx argument), so it composes
with the engine's send transaction.
This adapter does not add tenant predicates. A tenant-enabled engine requires the entity table to enforce tenant ownership, typically through RLS under the same role, GUC, and transaction, or a custom port that performs authorization.
Concurrency:
- WITHOUT
versionColumn: CAS isupdateMany({ where: { id, state: expectedFrom }, data: { state: to } }), succeeding iff exactly one row changed. This can't distinguish a self-transition from a no-op, so the engine refusesallowSelfedges against a version-less port. - WITH
versionColumn: CAS additionally matches the observed counter and bumps it (data: { state: to, version: expectedVersion + 1 }), serializing concurrent writers — including self-transitions.
Parameters
| Parameter | Type |
|---|---|
config | BindingPortConfig |