Skip to content

Commit 8f1ef29

Browse files
authored
fix search_path parameter definition in guide (#4684)
1 parent eb0a160 commit 8f1ef29

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

guides/howtos/Multi tenancy with query prefixes.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ By default, connections to Postgres' databases run on the "public" prefix. When
8484

8585
Luckily Postgres allows us to change the prefix our database connections run on by setting the "schema search path". The best moment to change the search path is during the setup of the database connection, ensuring all of our queries will run on that particular prefix, throughout the connection life-cycle.
8686

87-
To do so, let's change our database configuration in "config/config.exs" and set a `:search_path` parameter in the `:parameters` option. The `:search_path` parameter expects a list of strings that define the search path for the connection:
87+
To do so, let's change our database configuration in "config/config.exs" and set a `:search_path` parameter in the `:parameters` option. The `:search_path` parameter expects a comma separated string of prefixes that define the search path for the connection:
8888

8989
```elixir
9090
config :my_app, MyApp.Repo,
@@ -93,7 +93,7 @@ config :my_app, MyApp.Repo,
9393
database: "demo_dev",
9494
hostname: "localhost",
9595
pool_size: 10,
96-
parameters: [search_path: ["connection_prefix"]]
96+
parameters: [search_path: "connection_prefix,public"]
9797
```
9898

9999
Now let's try to run the same query as before:

0 commit comments

Comments
 (0)