-
Notifications
You must be signed in to change notification settings - Fork 177
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
Update C# codegen to consistent filtering rules #1277
Conversation
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.
👍
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.
Small issue
- Limit types as per proposal. - Add `Query` client-side SDK helper for API parity with server-side modules (on client-side it's a simple wrapper around Iter + Where). - Change return type of `FilterBy` to always be iterable, with new `FindBy` function for unique fields. - Simplify the way primary keys are handled - must go with clockworklabs/com.clockworklabs.spacetimedbsdk#93 for the client SDK counterpart.
8f3a6b8
to
8ac9272
Compare
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.
Import issue fixed, thanks 👍
## Description of Changes As a result of the consistent filtering rules proposal (clockworklabs/SpacetimeDB#1256), all equatable types are now natively equatable in C# as well. This allows us to compare objects directly, without holding and comparing AlgebraicValue in the entries map as well, which has a bit of a domino effect and allows to optimise, simplify or even remove some parts of the SDK. ## API - [x] This is an API breaking change to the SDK New filtering rules limit types on which filtering can be done, as well as change the return type of `FilterBy` functions to always be iterable. ## Requires SpacetimeDB PRs clockworklabs/SpacetimeDB#1277
Fixes regression accidentally introduced in #1277: if FindBy returns null, FilterBy will return an iterable with a single null item instead of an empty iterable.
* Fix FilterBy regression in C# Fixes regression accidentally introduced in #1277: if FindBy returns null, FilterBy will return an iterable with a single null item instead of an empty iterable. * Fix snapshots
Description of Changes
Query
client-side SDK helper for API parity with server-side modules (on client-side it's a simple wrapper around Iter + Where).FilterBy
to always be iterable, with newFindBy
function for unique fields.API and ABI breaking changes
Limits equatable types and changes return type of
FilterBy
functions as per proposal.Expected complexity level and risk
2
How complicated do you think these changes are? Grade on a scale from 1 to 5,
where 1 is a trivial change, and 5 is a deep-reaching and complex change.
This complexity rating applies not only to the complexity apparent in the diff,
but also to its interactions with existing and future code.
If you answered more than a 2, explain what is complex about the PR,
and what other components it interacts with in potentially concerning ways.
Testing
Describe any testing you've done, and any testing you'd like your reviewers to do,
so that you're confident that all the changes work as expected!