-
Notifications
You must be signed in to change notification settings - Fork 0
Introduce DB#ExecTx() method
#63
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
Conversation
dcd45ea to
486f869
Compare
486f869 to
db40fe1
Compare
db40fe1 to
f802918
Compare
|
Just fixed the outdated commit message which was referring to the now renamed method |
database/db.go
Outdated
| func (db *DB) ExecTx(ctx context.Context, fn func(context.Context, *sqlx.Tx) error) error { | ||
| tx, err := db.BeginTxx(ctx, nil) | ||
| if err != nil { | ||
| return errors.Wrap(err, "cannot start transaction") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry to be pedantic but we're using can't instead of cannot everywhere. Same for the other error message.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Quite ironic that we have replaced all such abbreviations in Icinga Notifications :-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't know that :). If we want to use more formal error messages, I have no problem with that. However, we should then change all error messages in the lib.
f802918 to
29c5d9d
Compare
|
@oxzi do you want to look over the changes again since you previously approved it? |
Introduces a
DB#ExecTx()method on theDBreceiver (cherry-picked from #18)