Hi! We use a lot of sql patterns where we have comments at the beginning of custom queries in blocks or in-line, use ctes like 'WITH' , etc. Is it possible to customize the sql checker that decides whether to use the primary or replica? If not, do you mind me asking where that occurs within your repo?
This is what we currently use with makara if that's helpful! Hoping to make the switch to yours (as of course makara is no longer maintained)
CUSTOM_SQL_REPLICA_MATCHERS = [
# Match comment blocks + inline comments and whitespace, finding queries with the 'with' or 'select' keywords
/\A\s*((--.\n\s)|(/*.?*/\s))*\b(select|with)\b/i
].freeze
Hi! We use a lot of sql patterns where we have comments at the beginning of custom queries in blocks or in-line, use ctes like 'WITH' , etc. Is it possible to customize the sql checker that decides whether to use the primary or replica? If not, do you mind me asking where that occurs within your repo?
This is what we currently use with makara if that's helpful! Hoping to make the switch to yours (as of course makara is no longer maintained)
CUSTOM_SQL_REPLICA_MATCHERS = [
# Match comment blocks + inline comments and whitespace, finding queries with the 'with' or 'select' keywords
/\A\s*((--.\n\s)|(/*.?*/\s))*\b(select|with)\b/i
].freeze