Running db.execute on the read replica?

I have some code (see next message - ran out of characters). It uses the db.execute to run the command. Currently when it executes it runs on the primary instance:
[00:53:24.188] DEBUG (#38670): [utilities:drizzle]: [Primary: primary] Executing a query on database:
[Feb 25 2025 00:53:24 GMT+0000]: query: WITH RECURSIVE "sub_categories" ....
[00:53:24.188] DEBUG (#38670): [utilities:drizzle]: [Primary: primary] Executing a query on database:
[Feb 25 2025 00:53:24 GMT+0000]: query: WITH RECURSIVE "sub_categories" ....
I want this to run on the read replica which I've defined. Is there a way to execute this on the read replica?
2 Replies
TGTGamer
TGTGamerOP7d ago
The code (note using TS Effect but the drizzle side of things should be roughly the same)
TGTGamer
TGTGamerOP7d ago

Did you find this page helpful?