Skip to content
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

add support for DATABASE_SEARCH_PATH #3823

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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