go-sqlite3 icon indicating copy to clipboard operation
go-sqlite3 copied to clipboard

always close db connection on error in Open

Open charlievieth opened this issue 1 year ago • 3 comments

This commit fixes a bug where the db connection would not always be closed when an error occurred in Open. Additionally, it makes sure that we always unregister any callbacks associated with the connection, which previously did not always happen. This change consolidates the error handling logic (previously, it had to be done for each return statement) which should make it more difficult to introduce this type of bug in the future.

charlievieth avatar Dec 09 '24 01:12 charlievieth

:warning: Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

Attention: Patch coverage is 14.28571% with 90 lines in your changes missing coverage. Please review.

Project coverage is 47.60%. Comparing base (18cdded) to head (0ae71f8). Report is 5 commits behind head on master.

Files with missing lines Patch % Lines
sqlite3.go 14.28% 69 Missing and 21 partials :warning:

:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1302      +/-   ##
==========================================
+ Coverage   47.16%   47.60%   +0.44%     
==========================================
  Files          12       12              
  Lines        1533     1523      -10     
==========================================
+ Hits          723      725       +2     
+ Misses        669      657      -12     
  Partials      141      141              

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov-commenter avatar Dec 09 '24 01:12 codecov-commenter

Please fix conflict

mattn avatar Dec 09 '24 11:12 mattn

Conflict fixed and thank you for the quick review!

charlievieth avatar Dec 11 '24 02:12 charlievieth