Dynamic read replicas

I have a use case that read replicas are dynamically located using Service Discovery and I need to store the underlying Client so that I can access it.

Is there a way to access the underlying client from drizzle? From what I can see you can't, that's why I need to store the underlying replicas client on some variable.

I could create an array of postgres-js client then map it like x.map(c => drizzle(c, { schema})) then pass this mapped array to withReplicas, but got myself a TypeError from typescript.

REF: https://orm.drizzle.team/docs/read-replicas
image.png
Drizzle ORM is a lightweight and performant TypeScript ORM with developer experience in mind.
Was this page helpful?