-
Notifications
You must be signed in to change notification settings - Fork 54
Add individual binds #298
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
Add individual binds #298
Changes from 8 commits
e1f7d87
895de04
1711dad
25ea4f2
a0d98e9
9870daa
e5f6094
5640d4c
c384bd1
fa2cff4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -652,12 +652,12 @@ defmodule Exqlite.Connection do | |
|
||
defp bind_params(%Query{ref: ref, statement: statement} = query, params, state) | ||
when ref != nil do | ||
case Sqlite3.bind(state.db, ref, params) do | ||
:ok -> | ||
{:ok, query} | ||
|
||
{:error, reason} -> | ||
{:error, %Error{message: to_string(reason), statement: statement}, state} | ||
try do | ||
Sqlite3.bind(ref, params) | ||
rescue | ||
e -> {:error, %Error{message: Exception.message(e), statement: statement}, state} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We lose There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we reraise with a reformed error and retain the stack trace? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe. I don't have much context on this function or how DBConnection handles exceptions "from within" .... I think it's safer for now to keep the previous behavior of not raising and returning an error triplet. I tried to think of various scenarios in #298 (comment) and right now I don't see anything useful being lost. |
||
else | ||
:ok -> {:ok, query} | ||
end | ||
end | ||
|
||
|
Uh oh!
There was an error while loading. Please reload this page.