You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
## 🎟️ Tracking
https://bitwarden.atlassian.net/browse/PM-12612
## 📔 Objective
A continuation of #213,
this PR implements some simple SDK managed data store based on SQLite
(on non-wasm) and IndexedDB (on wasm).
Both databases are wrapped in a `Database` trait and conditionally
compiled based on platform. Then from each database we can get multiple
`Repository` implementations that can be used to read and write data
persistently. Each repository is mapped to a separate table in SQLite
and Object Store in IndexedDb.
Some limitations of the current system:
- The database currently needs to be initialized as a separate step to
both the SdkClient and the client-managed repositories, I feel like
ideally we can do that as part of Client initialization, but that would
require us to make initialization async. I've left that for the future.
- Currently we don't have any indexes beyond the main key, but both
sqlite and indexeddb support adding more.
- The current structure doesn't have any migration capabilities, which
are required for indexeddb to create the object stores, this PR
temporarily adds version numbers to the `register_repository_item`
calls, just to get something working, but note that this is removed in
#410 and replaced with a
better migration system.
## ⏰ Reminders before review
- Contributor guidelines followed
- All formatters and local linters executed and passed
- Written new unit and / or integration tests where applicable
- Protected functional changes with optionality (feature flags)
- Used internationalization (i18n) for all UI strings
- CI builds passed
- Communicated to DevOps any deployment requirements
- Updated any necessary documentation (Confluence, contributing docs) or
informed the documentation
team
## 🦮 Reviewer guidelines
<!-- Suggested interactions but feel free to use (or not) as you desire!
-->
- 👍 (`:+1:`) or similar for great changes
- 📝 (`:memo:`) or ℹ️ (`:information_source:`) for notes or general info
- ❓ (`:question:`) for questions
- 🤔 (`:thinking:`) or 💭 (`:thought_balloon:`) for more open inquiry
that's not quite a confirmed
issue and could potentially benefit from discussion
- 🎨 (`:art:`) for suggestions / improvements
- ❌ (`:x:`) or ⚠️ (`:warning:`) for more significant problems or
concerns needing attention
- 🌱 (`:seedling:`) or ♻️ (`:recycle:`) for future improvements or
indications of technical debt
- ⛏ (`:pick:`) for minor or nitpick changes
---------
Co-authored-by: Andreas Coroiu <[email protected]>
0 commit comments