Skip to content

Commit

Permalink
Merge pull request plausible#3 from plausible/use-opts
Browse files Browse the repository at this point in the history
use opts
  • Loading branch information
ukutaht authored Oct 5, 2022
2 parents 490e9b2 + d0ab8f2 commit e6b7cc5
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions lib/clickhousex/protocol.ex
Original file line number Diff line number Diff line change
Expand Up @@ -165,12 +165,12 @@ defmodule Clickhousex.Protocol do

## Private functions

defp do_query(query, params, _opts, state) do
base_address = state.base_address
username = state.conn_opts[:username]
password = state.conn_opts[:password]
timeout = state.conn_opts[:timeout]
database = state.conn_opts[:database]
defp do_query(query, params, opts, state) do
%{base_address: base_address, conn_opts: conn_opts} = state
username = opts[:username] || conn_opts[:username]
password = opts[:password] || conn_opts[:password]
timeout = opts[:timeout] || conn_opts[:timeout]
database = opts[:database] || conn_opts[:database]

query
|> Client.send(params, base_address, timeout, username, password, database)
Expand Down

0 comments on commit e6b7cc5

Please sign in to comment.