Skip to content
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 new method WithTx for Database #108

Merged
merged 3 commits into from
Jul 24, 2019
Merged

Conversation

Xuyuanp
Copy link
Contributor

@Xuyuanp Xuyuanp commented Jul 19, 2019

Add a new method WithTx for Database, allowing use like

err := db.WithTx(func(tx *TxDatabase) error {
    // do something with tx
    return nil
})

@codecov
Copy link

codecov bot commented Jul 19, 2019

Codecov Report

Merging #108 into master will decrease coverage by 0.04%.
The diff coverage is 60%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #108      +/-   ##
==========================================
- Coverage   86.35%   86.31%   -0.05%     
==========================================
  Files          38       38              
  Lines        2800     2805       +5     
==========================================
+ Hits         2418     2421       +3     
- Misses        330      331       +1     
- Partials       52       53       +1
Impacted Files Coverage Δ
database.go 93.79% <60%> (-1.21%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c7d8e67...014eb28. Read the comment docs.

@codecov
Copy link

codecov bot commented Jul 19, 2019

Codecov Report

Merging #108 into master will increase coverage by 0.09%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #108      +/-   ##
==========================================
+ Coverage   86.35%   86.45%   +0.09%     
==========================================
  Files          38       38              
  Lines        2800     2805       +5     
==========================================
+ Hits         2418     2425       +7     
+ Misses        330      329       -1     
+ Partials       52       51       -1
Impacted Files Coverage Δ
database.go 96.55% <100%> (+1.55%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c7d8e67...36be327. Read the comment docs.

@doug-martin
Copy link
Owner

@Xuyuanp thanks for the PR! If you could add a few more tests to cover your changes I'll get this into the next release.

@Xuyuanp
Copy link
Contributor Author

Xuyuanp commented Jul 22, 2019

it seems better this time

@doug-martin doug-martin merged commit 8edff69 into doug-martin:master Jul 24, 2019
doug-martin added a commit that referenced this pull request Jul 24, 2019
* [FIXED] literalTime use t.UTC() , This behavior is different from the original sql.DB #106 - @chen56
* [ADDED] Add new method WithTx for Database #108 - @Xuyuanp
@doug-martin doug-martin mentioned this pull request Jul 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants