-
Notifications
You must be signed in to change notification settings - Fork 92
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
migration library: specify schema without search path DSN? #603
Comments
Search path is currently the only way for the migrator to execute migrations against an alternate schema. I think to do otherwise we would probably need to evolve some sort of string interpolation for schema into our migrations. Might be something we tackle when trying to solve alternate schemas more broadly (there are still a number of other compatibility issues mostly stemming from sqlc not offering a way to inject a schema name dynamically). |
@bgentry I think you can do this without modifying existing queries altogether using |
That’s going to be a session level change which persists on the connection even after it’s returned in the database pool, right? My understanding is the only way to reliably dynamically change the schema for specific queries is to inject it into the query string. |
There is a way to make it scoped to a transaction, is that applicable? |
Hi,
is it possible to make migrate do its migration inside a postgres schema and then connect to it with a client without actually spawning an entire new pgxpool(with
search_path
in the DSN string)?The text was updated successfully, but these errors were encountered: