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 socket_options instead using keywork merge, concat default options with assigned options #183

Merged
merged 4 commits into from
May 20, 2024

Conversation

iagocavalcante
Copy link
Contributor

No description provided.

@@ -43,8 +47,7 @@ defmodule MyXQL.Client do
ssl_opts: Keyword.get(opts, :ssl_opts, []),
connect_timeout: Keyword.get(opts, :connect_timeout, @default_timeout),
handshake_timeout: Keyword.get(opts, :handshake_timeout, @default_timeout),
socket_options:
Keyword.merge([mode: :binary, packet: :raw, active: false], opts[:socket_options] || []),
socket_options: @sock_opts ++ (opts[:socket_options] || []),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we want the opposite order because what comes first wins. Maybe we can also write a test? You can set socket_options: [:inet] for the test.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed, I will do that.

lib/myxql/client.ex Outdated Show resolved Hide resolved
test/myxql_test.exs Outdated Show resolved Hide resolved
test/myxql_test.exs Outdated Show resolved Hide resolved
test/myxql_test.exs Outdated Show resolved Hide resolved
@wojtekmach wojtekmach merged commit a474c0e into elixir-ecto:master May 20, 2024
10 checks passed
@wojtekmach
Copy link
Member

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants