Read replica + schema

Hello!

I want to start using read replicas: https://orm.drizzle.team/docs/read-replicas

Current I'm doing

export const db = drizzle(client, {
  schema: {
    ...userSchema,
    // etc
  },
});


Should I add the config object to the read replica as well? Like this:

const config = {
  schema: {
    ...userSchema,
    // etc
  },
};

const primaryDb = drizzle(primaryPool, config);
const read1 = drizzle(read1Pool, config);

export const db = withReplicas(primaryDb, [read1]);
Was this page helpful?