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

fix(electric): Use the same TCP options for epgsql and Ecto connections #1292

Merged
merged 2 commits into from
Jun 4, 2024
Merged
Show file tree
Hide file tree
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
5 changes: 5 additions & 0 deletions .changeset/thin-impalas-bathe.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@core/electric": patch
---

Use the same TCP options for database connections regardless of whether they are initiated by epgsql or the Ecto repo.
3 changes: 3 additions & 0 deletions components/electric/lib/electric/postgres/repo.ex
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ defmodule Electric.Postgres.Repo do
password: conn_opts.password,
database: conn_opts.database,
ssl: conn_opts.ssl == :required,
msfstef marked this conversation as resolved.
Show resolved Hide resolved
# Pass TCP options to the Postgrex adapter. This is used to let the adapter know to
# connect to the DB using IPv6, for example.
socket_options: Map.get(conn_opts, :tcp_opts, []),
msfstef marked this conversation as resolved.
Show resolved Hide resolved
pool_size: Keyword.get(opts, :pool_size, @default_pool_size),
log: false,
after_connect: {__MODULE__, :set_display_settings, []}
Expand Down
Loading