Skip to content

Allow plugins and query_parser_read_write_splitting without globally enabling query_parser_enabled #929

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

adis-io
Copy link

@adis-io adis-io commented May 20, 2025

Summary

With this PR it will be possible to use it following way

Config:

query_parser_enabled = false
query_parser_read_write_splitting = true

Example:

SET SERVER ROLE to 'auto' -- it will enable query parser in place
SET PRIMARY READS TO 'off' -- it will disable reads from primary
SELECT * FROM users WHERE id = <id> LIMIT 1
-- any other reads

-- following statement will be routed to primary and succeed
UPDATE users SET updated_at = NOW() WHERE id = 1

SET PRIMARY READS TO 'default' -- return default value
SET SERVER ROLE to 'default' -- return default role

Without query_parser_read_write_splitting auto will randomly route to primary and replica

Let me know what do you think about it.

…enabling query_parser_enabled

This was previously blocked by a config check, even though query_parser_enabled can be temporarily overridden. 

The check has been removed to allow independent use.
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.

1 participant