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

Implement Query in new PostgreSQL backend #3411

Merged
merged 9 commits into from Sep 22, 2023

Conversation

chilagrow
Copy link
Contributor

@chilagrow chilagrow commented Sep 22, 2023

Description

Closes #3388.

Query tests for test-integration-postgresql fail now #3411 (comment), I think I need to implement insert.

Readiness checklist

  • I added/updated unit tests (and they pass).
  • I added/updated integration/compatibility tests (and they pass).
  • 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), Milestone (Next), Labels, Project and project's Sprint fields.
  • I marked all done items in this checklist.

@chilagrow chilagrow added the code/chore Code maintenance improvements label Sep 22, 2023
@chilagrow chilagrow added this to the Next milestone Sep 22, 2023
@chilagrow chilagrow self-assigned this Sep 22, 2023
@codecov
Copy link

codecov bot commented Sep 22, 2023

Codecov Report

Merging #3411 (f194cb1) into main (d976d8c) will decrease coverage by 0.31%.
The diff coverage is 0.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #3411      +/-   ##
==========================================
- Coverage   74.62%   74.31%   -0.31%     
==========================================
  Files         414      415       +1     
  Lines       25766    25859      +93     
==========================================
- Hits        19227    19217      -10     
- Misses       5398     5497      +99     
- Partials     1141     1145       +4     
Files Changed Coverage
internal/backends/postgresql/backend.go 0.00%
internal/backends/postgresql/collection.go 0.00%
internal/backends/postgresql/database.go 0.00%
internal/backends/postgresql/query_iterator.go 0.00%
Flag Coverage Δ
filter-true 69.76% <0.00%> (-0.29%) ⬇️
hana-1 ?
hana-2 ?
hana-3 ?
integration 69.76% <0.00%> (-0.29%) ⬇️
mongodb-1 4.67% <0.00%> (-0.02%) ⬇️
pg-1 42.99% <0.00%> (-0.16%) ⬇️
pg-2 42.72% <0.00%> (-0.16%) ⬇️
pg-3 43.17% <0.00%> (-0.26%) ⬇️
postgresql-1 ∅ <ø> (∅)
postgresql-2 ∅ <ø> (∅)
postgresql-3 ∅ <ø> (∅)
sort-false 69.76% <0.00%> (-0.29%) ⬇️
sqlite-1 41.87% <0.00%> (-0.21%) ⬇️
sqlite-2 41.38% <0.00%> (-0.16%) ⬇️
sqlite-3 42.21% <0.00%> (-0.27%) ⬇️
unit 24.58% <0.00%> (-0.10%) ⬇️

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

@chilagrow
Copy link
Contributor Author

chilagrow commented Sep 22, 2023

Okay current implementation will not pass Query tests for test-integration-postgresql 😞

Integration test inserts documents using old pg backend, so documents are stored in the database but metadata in new postgresql is not updated and kept empty. When attempt to query, it returns empty document.
It's because insert in new postgresql backend does nothing.

I could:

  1. implement insert in new backend and make integration test use new backend for insertion when use-new-pg flag is set.
  2. fetch metadata from db every call in new backend
  3. leave as it is for now, knowing tests fail (pushdown assertion also fails)

@chilagrow chilagrow marked this pull request as ready for review September 22, 2023 06:48
@AlekSi AlekSi enabled auto-merge (squash) September 22, 2023 08:26
@AlekSi
Copy link
Member

AlekSi commented Sep 22, 2023

Let's do nothing for now

AlekSi
AlekSi previously approved these changes Sep 22, 2023
internal/backends/postgresql/collection.go Outdated Show resolved Hide resolved
Co-authored-by: Alexey Palazhchenko <alexey.palazhchenko@gmail.com>
Copy link
Member

@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.

LGTM!

@AlekSi AlekSi merged commit dabbeb3 into FerretDB:main Sep 22, 2023
27 of 32 checks passed
@chilagrow chilagrow removed the code/chore Code maintenance improvements label Sep 25, 2023
@chilagrow chilagrow added the code/feature Some user-visible feature is not implemented yet label Sep 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code/feature Some user-visible feature is not implemented yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Implement Query
3 participants