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

feat: improve SQLite performance #1024

Draft
wants to merge 21 commits into
base: master
Choose a base branch
from
Draft

Conversation

fmartingr
Copy link
Member

@fmartingr fmartingr commented Dec 10, 2024

  • Trying to improve SQLite performance by tuning some parameters when opening the connection.
  • Using different connections for reading and writting
  • Added a new withTxRetry method to try and avoid database is busy errors.
  • Code formatting

@fmartingr fmartingr self-assigned this Dec 10, 2024
Copy link

codecov bot commented Dec 10, 2024

Codecov Report

Attention: Patch coverage is 40.00000% with 99 lines in your changes missing coverage. Please review.

Project coverage is 34.89%. Comparing base (87bc7a8) to head (8eda47a).

Files with missing lines Patch % Lines
internal/database/sqlite.go 39.72% 76 Missing and 12 partials ⚠️
internal/database/sqlite_noncgo.go 50.00% 5 Missing and 2 partials ⚠️
internal/database/mysql.go 0.00% 2 Missing ⚠️
internal/database/pg.go 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1024      +/-   ##
==========================================
+ Coverage   34.71%   34.89%   +0.18%     
==========================================
  Files          61       61              
  Lines        5326     5413      +87     
==========================================
+ Hits         1849     1889      +40     
- Misses       3253     3289      +36     
- Partials      224      235      +11     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

fmartingr and others added 13 commits December 10, 2024 13:15
refactor: Replace errors.WithStack with fmt.Errorf and add proper error handling

fix: Handle potential database connection errors with improved error wrapping

refactor: Replace errors.WithStack with fmt.Errorf and improve error handling

refactor: Replace error handling with fmt.Errorf and proper nil checks

refactor: Replace errors.WithStack with fmt.Errorf and add nil error checks

refactor: Replace errors.WithStack with fmt.Errorf and add nil checks in sqlite.go

refactor: Replace errors.WithStack with fmt.Errorf and add nil checks

refactor: Replace errors.WithStack with fmt.Errorf and improve error handling

refactor: Replace remaining errors.WithStack with fmt.Errorf in sqlite.go
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.

1 participant