Skip to content

basalt / prisma/src / readReplica

Function: readReplica() ​

> readReplica<TClient>(options): TClient & object

Defined in: prisma/src/replicas.ts:54

Wrap a primary + replicas into one client that routes reads to the replicas and writes to the primary. With no replicas it returns the primary unchanged (plus $primary), so the same wiring works in every environment.

Type Parameters ​

TClient ​

TClient extends object

Parameters ​

options ​

ReadReplicaOptions<TClient>

Returns ​

TClient & object

Released under the MIT License.