Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[10.x] Fix forced use of write DB connection #48015

Merged
merged 1 commit into from Aug 10, 2023

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
20 checks passed
@oleksiikhr oleksiikhr deleted the fix-force-write-db-connection branch August 10, 2023 16:44
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.

None yet

2 participants