I've got a complex question, I hope you will help me.
I'm using Doctrine DBAL in my application because I would like to make it works in Postgres and Mysql.
The problem is that I want to switch over the 5 schemas that I have.
For example I would to do this thing :
Action 1 --> Select schema 1
Action 2 --> Make a SQL request like this : "SELECT * FROM users"
Action 3 --> Select schema 2
Action 4 --> Make an other SQL request like this "SELECT * FROM users"
What I don't want to do :
Action 1 --> Make a SQL request like this : "SELECT * FROM schema1.users"
Action 2 --> Make an other SQL request like this "SELECT * FROM schema2.users"
What I tried (but don't work =S):
$connection->getConnection()->exec("SET SEARCH_PATH schema1");
$stmt = $connection->getConnection()->executeQuery("SELECT * FROM users");
Is anyone have an idea how I can solve my problem ? I will be very thankful if you could bring me some help.
Thank you.
Freezer