Hello, I was wondering how hard it was to do something like this. We have a replicated Mysql database that gets data from higher up, for developers to test their code against before making it into production. To help test writes and such, we make a full copy of the replicated database to a new database name in mysql, and give the devs access to this copied database to make actual changes (that will go away eventually), while giving merely read access to the replicated database.
It has occurred a few times that devs either forget to, or are unable to, update the database name they are trying to connect to, which leads to application errors about permissions that aren't obvious at first as to why they fail (same table names and everything). As such, we were hoping to use ProxySQL and it's query rewrites to force all connections from certain users and against one schemename to always go to a new schemaname. After searching around, the only solution I found was to make rules, one per table name, that rewrote the queries to be of the form new_db_name.table_name instead. I never saw any easier option for rewriting all queries coming to one schemaname to go to another schemaname. Am I missing some easier setup for this type of thing?
Thanks for any help.