Skip to content

Conversation

@oleksiikhr
Copy link
Contributor

@oleksiikhr oleksiikhr commented Aug 9, 2023

I am using Read & Write Connection (with a few tricks) and Laravel Octane.

My site is read-heavy, very few where I need to use write connection to work with DB. So most endpoints only require read DB connection.

Also, I started using a new feature from laravel 10.x, it's toRawSql, to simplify key creation for caching queries. As it turns out, queries that only require a read-only connection now also require a write connection to the database.

And at possible unavailability of write database, my site goes down, although it is quite enough only read-connection for processing current requests.

@taylorotwell
Copy link
Member

I'm curious - could we just always use getReadPdo here? It will fallback to getPdo if it needs to based on my reading of the method. Am I wrong?

@oleksiikhr oleksiikhr force-pushed the fix-force-write-db-connection branch from 2ecb087 to 78e7771 Compare August 10, 2023 05:36
@taylorotwell taylorotwell merged commit bfae965 into laravel:10.x Aug 10, 2023
@oleksiikhr oleksiikhr deleted the fix-force-write-db-connection branch August 10, 2023 16:44
tpetry added a commit to tpetry/laravel-postgresql-enhanced that referenced this pull request Sep 4, 2025
jschultz1027 added a commit to jschultz1027/laravel_postgresql that referenced this pull request Sep 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants