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

Add getRecords with offset and limit, Add getRecordsCount(str) -> double #32

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

joshua-software-dev
Copy link

When trying to retrieve a large number of large records, mono-wasm seems to choke on returns from IndexedDbManager.GetRecords. In my particular use case, it broke at around 300 records, and when I had 10000 records I needed to retrieve, this was a major blocker for me.

I have added two functions:

  1. Task<List> IndexedDbManager.GetRecords(string storeName, uint limit, uint offset = 0)

The parameter limit does what it says on the tin, limit the amount of records returned, and offset chooses how far to offset into the retrieved records before returning results. This version is an alternative to the regular GetRecords function, which remains as is.

  1. Task IndexedDbManager.GetRecordsCount(string storeName)

This function provides a count of the number of records that are in a store without having to spend time serializing them to determine this. When dealing with a lot of records, using this paginated return to retrieve the results works, but is somewhat slow, and memory intensive when all I need is the count. This function alleviates this particular concern.

Tests of these new functions have been added to the test blazor page.

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