Skip to content

Support for create a Firebase Document Reference and offset query#181

Open
lucasdidur wants to merge 2 commits intowovalle:masterfrom
lucasdidur:master
Open

Support for create a Firebase Document Reference and offset query#181
lucasdidur wants to merge 2 commits intowovalle:masterfrom
lucasdidur:master

Conversation

@lucasdidur
Copy link
Copy Markdown

Because in my project I need to use document references and the fireorm still doesn't have support for references, both for searching and for creating new documents, I implemented a function to facilitate the manipulation to get a native data of firebase.

I also implemented support for query offset, very useful in document pagination.

@codecov
Copy link
Copy Markdown

codecov Bot commented Aug 18, 2020

Codecov Report

❌ Patch coverage is 37.50000% with 10 lines in your changes missing coverage. Please review.
✅ Project coverage is 92.68%. Comparing base (f66fe7e) to head (11fa721).
⚠️ Report is 151 commits behind head on master.

Files with missing lines Patch % Lines
src/QueryBuilder.ts 33.33% 4 Missing ⚠️
src/AbstractFirestoreRepository.ts 25.00% 3 Missing ⚠️
src/BaseFirestoreRepository.ts 50.00% 2 Missing ⚠️
.../Transaction/BaseFirestoreTransactionRepository.ts 50.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #181      +/-   ##
==========================================
- Coverage   94.36%   92.68%   -1.68%     
==========================================
  Files          21       21              
  Lines         532      547      +15     
  Branches       83       86       +3     
==========================================
+ Hits          502      507       +5     
- Misses         30       40      +10     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@skalashnyk
Copy link
Copy Markdown
Contributor

skalashnyk commented Sep 17, 2020

offset is something that is not recommended to use by google - https://cloud.google.com/firestore/docs/best-practices#read_and_write_operations

Do not use offsets. Instead, use cursors. Using an offset only avoids returning the skipped documents to your application, but these documents are still retrieved internally. The skipped documents affect the latency of the query, and your application is billed for the read operations required to retrieve them.

Oh, this is your 2nd attempt #132 :-)

Copy link
Copy Markdown

@justusburger justusburger left a comment

Choose a reason for hiding this comment

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

This is exactly what I need now - the ability to specify an offset in order to do pagination.

@wovalle
Copy link
Copy Markdown
Owner

wovalle commented Sep 26, 2024

Hi @lucasdidur!

In order to deploy this I'd still need two things:

  • Fix the branch conflicts
  • Add a unit test for the offset

But nonetheless, great job!

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.

4 participants