Skip to content

Commit

Permalink
fix(connection): Fix check for auto_commit mode
Browse files Browse the repository at this point in the history
We weren't actually checking if the auto_commit mode was off, so we were never sending commit commands to odbc.
This fixes the issue.
  • Loading branch information
PM-Pepsico committed Jan 12, 2023
1 parent 0b93424 commit fc90ad8
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions lib/snowflex/connection.ex
Original file line number Diff line number Diff line change
Expand Up @@ -164,10 +164,9 @@ defmodule Snowflex.Connection do
## Helpers

defp do_query(%Query{} = query, params, opts, state) do
if Keyword.get(state.conn_opts, :auto_commit, :on) do
do_query_without_commit(query, params, opts, state)
else
do_query_with_commit(query, params, opts, state)
case Keyword.get(state.conn_opts, :auto_commit) do
:off -> do_query_with_commit(query, params, opts, state)
_ -> do_query_without_commit(query, params, opts, state)
end
end

Expand Down

0 comments on commit fc90ad8

Please sign in to comment.