Skip to content

Commit

Permalink
add support for DATABASE_SEARCH_PATH
Browse files Browse the repository at this point in the history
  • Loading branch information
ruslandoga committed May 7, 2024
1 parent 02d4709 commit 13424d3
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions config/runtime.exs
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,7 @@ config :plausible, PlausibleWeb.Endpoint,
maybe_ipv6 = if System.get_env("ECTO_IPV6"), do: [:inet6], else: []

db_cacertfile = get_var_from_path_or_env(config_dir, "DATABASE_CACERTFILE", CAStore.file_path())
db_search_path = get_var_from_path_or_env(config_dir, "DATABASE_SEARCH_PATH")

if is_nil(db_socket_dir) do
config :plausible, Plausible.Repo,
Expand All @@ -336,6 +337,11 @@ else
database: get_var_from_path_or_env(config_dir, "DATABASE_NAME", "plausible")
end

if db_search_path do
config :plausible, Plausible.Repo,
after_connect: {Postgrex, :query!, ["SET search_path TO #{db_search_path}", []]}
end

sentry_app_version = runtime_metadata[:version] || app_version

config :sentry,
Expand Down

0 comments on commit 13424d3

Please sign in to comment.