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

Persister for IndexDB #25

Merged
merged 12 commits into from
Feb 21, 2024
Merged

Persister for IndexDB #25

merged 12 commits into from
Feb 21, 2024

Conversation

nicoburniske
Copy link
Member

@nicoburniske nicoburniske commented Feb 20, 2024

Changes

  • Add impl for indexed_db using https://github.com/Alorel/rust-indexed-db
  • Gated behind indexed_db feature
  • Add ?Send to QueryPersister async trait
    • By adding ?Send to the async_trait macro, it indicates that the futures produced by the trait methods do not have to be Send, which is fine because everything is single threaded.

Indexdb connection is eagerly initialized using AsyncCell. All operations will await the connection being initialized (and the database created if need be)`. DB name and Object store name are customizable

In testing,

  • db setup takes 50ms
  • retrievals take between 3-10ms (probably averaging around 5ms) for a small database.

Misc Changes

  • Breakup persister module into separate files (local_storage, index_db)
  • Added cargo.lock to examples/start_axum which was being ignored for some reason

@nicoburniske nicoburniske merged commit 1d5bec0 into main Feb 21, 2024
1 check passed
@nicoburniske nicoburniske deleted the indexdb branch March 9, 2024 16:13
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