basalt / prisma/src / ReadReplicaOptions
Interface: ReadReplicaOptions<TClient>
Defined in: prisma/src/replicas.ts:26
Type Parameters
TClient
TClient extends object
Properties
extend?
> optional extend?: (client) => TClient
Defined in: prisma/src/replicas.ts:39
Apply the SAME extension (e.g. tenancyExtension()) to the primary AND every replica, guaranteeing identical query scoping across all of them. Strongly recommended for multi-tenant setups: passing a raw, un-extended replica would route reads around your tenant filter and leak every tenant's rows.
Parameters
client
TClient
Returns
TClient
primary
> primary: TClient
Defined in: prisma/src/replicas.ts:28
The read-write primary — every write and transaction goes here.
rawReadsOnReplica?
> optional rawReadsOnReplica?: boolean
Defined in: prisma/src/replicas.ts:46
Route $queryRaw / $queryRawUnsafe to a replica too. OFF by default: raw SQL can mutate (e.g. a WITH ... INSERT CTE) and a read used for an auth/permission decision must not read a lagged replica. Opt in only for genuinely read-only raw queries; otherwise they run on the primary.
readOps?
> optional readOps?: string[]
Defined in: prisma/src/replicas.ts:32
Extra model methods to treat as reads (e.g. a Prisma extension's).
replicas
> replicas: TClient[]
Defined in: prisma/src/replicas.ts:30
One or more read-only replicas. Reads round-robin across them.