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

Refactor SQLite handler #2731

Merged
merged 4 commits into from
Jun 6, 2023
Merged

Refactor SQLite handler #2731

merged 4 commits into from
Jun 6, 2023

Conversation

AlekSi
Copy link
Member

@AlekSi AlekSi commented May 29, 2023

Description

It might be easier to review a result than changes:

Readiness checklist

  • I added/updated unit tests.
  • I added/updated integration/compatibility tests.
  • I added/updated comments and checked rendering.
  • I made spot refactorings.
  • I updated user documentation.
  • I ran task all, and it passed.
  • I ensured that PR title is good enough for the changelog.
  • (for maintainers only) I set Reviewers (@FerretDB/core), Labels, Project and project's Sprint fields.
  • I marked all done items in this checklist.

@AlekSi AlekSi added the code/chore Code maintenance improvements label May 29, 2023
@AlekSi AlekSi added this to the Next milestone May 29, 2023
@AlekSi AlekSi self-assigned this May 29, 2023
@AlekSi AlekSi added the not ready Issues that are not ready to be worked on; PRs that should skip CI label May 29, 2023
@codecov
Copy link

codecov bot commented May 29, 2023

Codecov Report

Merging #2731 (41b8520) into main (27dab48) will increase coverage by 0.64%.
The diff coverage is 23.38%.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #2731      +/-   ##
==========================================
+ Coverage   26.07%   26.71%   +0.64%     
==========================================
  Files         441      442       +1     
  Lines       22740    22520     -220     
==========================================
+ Hits         5929     6016      +87     
+ Misses      16201    15887     -314     
- Partials      610      617       +7     
Impacted Files Coverage Δ
integration/setup/listener.go 0.00% <0.00%> (ø)
integration/setup/setup_compat.go 9.62% <0.00%> (+0.34%) ⬆️
internal/backends/backend.go 0.00% <0.00%> (ø)
internal/backends/collection.go 0.00% <ø> (ø)
internal/backends/database.go 0.00% <0.00%> (ø)
internal/backends/error.go 20.58% <0.00%> (+2.16%) ⬆️
internal/backends/sqlite/backend.go 0.00% <0.00%> (ø)
internal/backends/sqlite/collection.go 0.00% <0.00%> (ø)
internal/backends/sqlite/database.go 0.00% <0.00%> (ø)
internal/backends/sqlite/metadata/registry.go 0.00% <0.00%> (ø)
... and 11 more
Flag Coverage Δ
integration 5.00% <0.80%> (+0.06%) ⬆️
mongodb 5.00% <0.80%> (+0.06%) ⬆️
unit 25.19% <23.14%> (+0.64%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

@mergify
Copy link
Contributor

mergify bot commented Jun 2, 2023

@AlekSi this pull request has merge conflicts.

@mergify mergify bot added conflict PRs that have merge conflicts and removed conflict PRs that have merge conflicts labels Jun 2, 2023
@mergify
Copy link
Contributor

mergify bot commented Jun 2, 2023

@AlekSi this pull request has merge conflicts.

@mergify mergify bot added conflict PRs that have merge conflicts and removed conflict PRs that have merge conflicts labels Jun 2, 2023
@AlekSi AlekSi removed the not ready Issues that are not ready to be worked on; PRs that should skip CI label Jun 2, 2023
@AlekSi AlekSi modified the milestones: v1.3.0, Next Jun 5, 2023
@AlekSi AlekSi added not ready Issues that are not ready to be worked on; PRs that should skip CI and removed not ready Issues that are not ready to be worked on; PRs that should skip CI labels Jun 5, 2023
@AlekSi AlekSi marked this pull request as ready for review June 5, 2023 16:21
@AlekSi AlekSi requested a review from a team as a code owner June 5, 2023 16:21
@AlekSi AlekSi requested review from w84thesun and chilagrow June 5, 2023 16:21
@AlekSi AlekSi enabled auto-merge (squash) June 5, 2023 16:21
@AlekSi AlekSi requested review from a team, rumyantseva and noisersup June 5, 2023 16:22
chilagrow
chilagrow previously approved these changes Jun 6, 2023
Copy link
Member

@chilagrow chilagrow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, just a couple of question

internal/backends/sqlite/collection.go Show resolved Hide resolved
internal/backends/sqlite/collection.go Show resolved Hide resolved
internal/handlers/sqlite/msg_insert.go Outdated Show resolved Hide resolved
@AlekSi AlekSi requested review from chilagrow and a team June 6, 2023 06:22
Copy link
Member

@chilagrow chilagrow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀

@AlekSi AlekSi mentioned this pull request Jun 6, 2023
9 tasks
Copy link
Contributor

@rumyantseva rumyantseva left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mostly checked structure and what is in which package. The approach looks reasonable!

I need an explanation about packages inside sqlite handler: why pool is inside metadata and what is considered as metadata in geneal.

internal/backends/error.go Show resolved Hide resolved
@AlekSi
Copy link
Member Author

AlekSi commented Jun 6, 2023

That's exactly the problem I mentioned on DS calls. Basically, metadata and pool could be in the same package – except that they will be able to access each other's unexported methods and fields, and that would be a mess.

@AlekSi AlekSi merged commit 6ddbc37 into FerretDB:main Jun 6, 2023
@AlekSi AlekSi deleted the metadata branch June 6, 2023 08:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code/chore Code maintenance improvements
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants