GeezerVison is showing github.com — C# Async IDC by lisandroct · Pull Request #6620 · clockworklabs/SpacetimeDB
Conversation
lisandroct
commented
Nov 17, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
Description of Changes
Follows Rust and TypeScript implementation of asynchronous inter-database communication in C#.
-
spacetime generate now generates C# module bindings, both from --bindings module --lang csharp and from spacetime.json dependencies.
-
You can declare outbox tables with [Table(Outbox = typeof(Gw.Reducers.X))] or [Outbox(typeof(...)] on an empty struct.
-
You can remap parameters with [Param].
-
[OnResult(typeof(Row))] marks the reducer that gets each call's result.
-
Outbox tables are only allowed in the root assembly.
-
To have schema parity with module-test, I also made it so a single-column index declared on a unique column now becomes that column's unique index, as in Rust.
API and ABI breaking changes
One breaking change for C# modules that declare [Index.BTree] on a [Unique] or [PrimaryKey] column: before the table had two accessors, the column-named unique index and the declared index; now the one declared accessor remains, and it is the unique index, with Find/Update/Delete and no Filter.
Rollback safety impact
n/a
Expected complexity level and risk
3/5. It has the breaking change I mentioned above and modifies source generation quite extensively.
Testing
I added:
-
Codegen.Tests snapshots and diagnostics:
- outbox tables declared with
[Table(Outbox)] and with [Outbox];
[OnResult];
- every new error;
- outbox tables in a referenced assembly;
- snake-case conversion checked against Rust's
convert_case.
-
Codegen crate tests:
- a snapshot of the C# receiver bindings;
- dependency-scoped type names;
- the checked-in
module-test-cs/Receiver bindings stay up to date.
-
CLI tests: namespace defaults, overrides and rejections.
-
module-test-cs: a port of module-test's IDC fixtures. The existing ensure_same_schema test checks its schema matches Rust's.
-
Smoketest: a C# sender calls a Rust receiver, and checks:
- plain and nested-type calls;
- a rejected call reaching
OnResult with its error;
- one transaction calling both dependencies;
- enums from both dependencies surviving NativeAOT.
-
All of the tests above are passing.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
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.
Tested end to end with a throw away project and looks solid!
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
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.