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

Simplify update handling as per consistent filtering proposal #93

Merged
merged 9 commits into from
May 28, 2024

Conversation

RReverser
Copy link
Member

@RReverser RReverser commented May 22, 2024

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

  • 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

@RReverser RReverser requested a review from jdetter May 22, 2024 14:47
RReverser added a commit to clockworklabs/SpacetimeDB that referenced this pull request May 22, 2024
- 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.
@RReverser RReverser changed the title Ingvar/consistent-filtering Simplify comparisons and primary key handling as per consistent filtering proposal May 22, 2024
@RReverser RReverser requested a review from kazimuth May 22, 2024 14:52
@RReverser RReverser changed the title Simplify comparisons and primary key handling as per consistent filtering proposal Simplify update handling as per consistent filtering proposal May 23, 2024
Copy link
Collaborator

@jdetter jdetter left a comment

Choose a reason for hiding this comment

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

Small nit but overall this is a good refactor. I have not tested it myself but will be doing an overall test of the C#/Unity SDK later this week so this should get tested as part of that.

RReverser added a commit to clockworklabs/SpacetimeDB that referenced this pull request May 28, 2024
- 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.
github-merge-queue bot pushed a commit to clockworklabs/SpacetimeDB that referenced this pull request May 28, 2024
* Update C# codegen to consistent filtering rules

- 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.

* Add using for System.Linq

* Update snapshot
@RReverser RReverser merged commit 025a84c into master May 28, 2024
2 checks passed
@RReverser RReverser deleted the ingvar/consistent-filtering branch May 28, 2024 14:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants