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 find_groups method #324

Merged
merged 1 commit into from
Nov 13, 2023
Merged

Add find_groups method #324

merged 1 commit into from
Nov 13, 2023

Conversation

neekolas
Copy link
Contributor

@neekolas neekolas commented Nov 9, 2023

Summary

  • Adds methods for reading groups from the database and mapping the results into MlsGroup instances
  • Stores the created_at_ns time on the group instance itself, so that callers can use their latest returned group as a starting time for future queries.

@neekolas neekolas marked this pull request as ready for review November 9, 2023 18:25
@neekolas neekolas requested review from a team, insipx and richardhuaaa and removed request for a team November 9, 2023 18:25
@@ -94,6 +94,25 @@ where
Ok(group)
}

pub fn find_groups(
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we put this directly on the Group struct, with &Client as an argument? Same with create_group(). Would prefer not to have every DB-related method replicated on the Client class

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think in the FFI world it's going to make life easier to have all the group administration (list, create) live on the Client that we return to the native SDK. That way they don't have to deal with a bunch of different foreign object types and passing around references.

We could still do that mapping in the bindings, but it's messier. How about we leave it for now and we can always move things around later if we decide that it isn't as ergonomic?

xmtp_mls/src/groups/mod.rs Show resolved Hide resolved
@neekolas neekolas merged commit 3294846 into main Nov 13, 2023
4 checks passed
@neekolas neekolas deleted the nmolnar/basic-query-apis branch November 13, 2023 01:25
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.

2 participants