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
},
});
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]);
const config = {
schema: {
...userSchema,
// etc
},
};

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

export const db = withReplicas(primaryDb, [read1]);
0 Replies
No replies yetBe the first to reply to this messageJoin

Did you find this page helpful?