You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The issue #214 and its PR #220 added ability to change search_path, however, it seems to only allow single schema/parameter. If you specify comma-separated string of multiple schemas then it constructs wrong kind of SET statement.
For example, suppose you have a schema "myschema" where you plan to have some tables and then you want to have a common schema "extensions" to store extensions in. A scenario described in this StackOverflow answer: https://stackoverflow.com/a/43937189
The above scenario should have following search_path set:
SET search_path ="myschema", "extensions";
Unfortunately bun's pgdriver.WithConnParams formats parameters as a single string. So this...
... would properly separate each string element into its own quoted element in SET statement like this ...
SET search_path ="myschema", "extensions";
Let me know if something is unclear! Thanks!
The text was updated successfully, but these errors were encountered:
tomalaci
changed the title
Allow search_path to have multiple schemas
Bug: pgdriver.WithConnParams search_path does not allow multiple parameters/schemas
Jul 10, 2022
This issue has been automatically marked as stale because it has not had activity in the last 30 days. If there is no update within the next 7 days, this issue will be closed.
The issue #214 and its PR #220 added ability to change search_path, however, it seems to only allow single schema/parameter. If you specify comma-separated string of multiple schemas then it constructs wrong kind of SET statement.
For example, suppose you have a schema "myschema" where you plan to have some tables and then you want to have a common schema "extensions" to store extensions in. A scenario described in this StackOverflow answer: https://stackoverflow.com/a/43937189
The above scenario should have following search_path set:
Unfortunately bun's pgdriver.WithConnParams formats parameters as a single string. So this...
... becomes this ...
... and that doesn't seem to work for correctly finding common extensions.
I also tried specifying search_path parameters with
[]string
type but it failed withpgdriver: unexpected arg: []string
.Suggestion for solution
You should allow
[]string
values inpgdriver.WithConnParams
. So specifying this:... would properly separate each string element into its own quoted element in SET statement like this ...
Let me know if something is unclear! Thanks!
The text was updated successfully, but these errors were encountered: