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 db column for message owner #533

Merged
merged 6 commits into from
Aug 4, 2022

Conversation

leviathanbeak
Copy link
Contributor

solves #520

  • added the column for storing the [MessageId]
  • updated insert() and remove() methods so that MessageIds get persisted
  • added owned_message_ids() query method to the Database
  • added a test that verifies the functionality of the changes

@@ -13,12 +19,31 @@ impl Storage<MessageId, DaMessage> for Database {
key: &MessageId,
value: &DaMessage,
) -> Result<Option<DaMessage>, KvStoreError> {
// insert secondary record by owner
Database::insert(
Copy link
Member

Choose a reason for hiding this comment

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

It seems like we should do the primary insert of the record before the updating the index. Just in case something tries to query the index and the underlying data isn't persisted yet.

Voxelot
Voxelot previously approved these changes Aug 4, 2022
@leviathanbeak leviathanbeak merged commit 5688aa6 into master Aug 4, 2022
@leviathanbeak leviathanbeak deleted the leviathanbeak/add_db_column_for_message_owner branch August 4, 2022 19:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants