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 Aug 27, 2024
1 parent 3adbf96 commit af0d0fa
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 @@ -238,10 +238,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 af0d0fa

Please sign in to comment.