-
Notifications
You must be signed in to change notification settings - Fork 10
feat: implement set_client_data() [WPB-10919] #757
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
Merged
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
0695105
chore: add consumer_data table to SQLite schema
SimonThormeyer c0331d1
chore: add consumer_data indexedDB store
SimonThormeyer 23fafcc
chore: implement count() and find_one() in unique entity
SimonThormeyer 7a00966
chore: add consumer data struct to keystore
SimonThormeyer 7747ff0
feat: implement set_data() and get_data() on context [WPB-10919]
SimonThormeyer bdd00c7
chore: expose set_data() and get_data() in wasm bindings
SimonThormeyer e56c0c0
chore: expose set_data() and get_data() in uniffi bindings
SimonThormeyer 8ac1aff
chore: add test for set_data()
SimonThormeyer File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 4 additions & 0 deletions
4
keystore/src/connection/platform/generic/migrations/V13__consumer_data.sql
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| CREATE TABLE consumer_data ( | ||
| id INTEGER PRIMARY KEY CHECK ( id = 0 ), | ||
| content BLOB | ||
| ); | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| /// Consumers of this library can use this to specify data to be persisted at the end of | ||
| /// a transaction. | ||
| #[derive(Debug, Clone, PartialEq, Eq)] | ||
| #[cfg_attr( | ||
| any(target_family = "wasm", feature = "serde"), | ||
| derive(serde::Serialize, serde::Deserialize) | ||
| )] | ||
| pub struct ConsumerData { | ||
| pub content: Vec<u8>, | ||
| } | ||
|
|
||
| impl From<Vec<u8>> for ConsumerData { | ||
| fn from(content: Vec<u8>) -> Self { | ||
| Self { content } | ||
| } | ||
| } | ||
|
|
||
| impl From<ConsumerData> for Vec<u8> { | ||
| fn from(consumer_data: ConsumerData) -> Self { | ||
| consumer_data.content | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This appears to enforce that
idis only ever equal to 0. Is this to enforce that there is only ever one row in the table?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, exactly. This pattern can also be seen in other tables where we only ever expect one record, such as
e2ei_acme_ca.