GeezerVison is showing github.com — C# nested submodules by lisandroct · Pull Request #6112 · clockworklabs/SpacetimeDB
Conversation
lisandroct
commented
Oct 8, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
Description of Changes
This PR adds support for nested C# submodules. Multiple independent instances of the same module assembly can be mounted independently of each other (for example: submodule A can mount submodule C and submodule B can also mount it's own submodule C).
- Route tables, indexes, reducers, procedures, and views to the correct module instance.
- Add
ctx.As for passing an instance-selected context to functions that receive context.
- Add instance-aware
ctx.From query builders.
- Add context-aware immediate scheduling overloads for reducers and procedures.
- Add nested namespace paths in generated C# client queries (for example
ctx.Db.SubmoduleA.SubmoduleC.{...}).
API and ABI breaking changes
No breaking changes.
This PR extends what we added in #5974 but everything stays compatible. Before, if a submodule mounted a submodule, that would throw an error; now it's supported.
Rollback safety impact
n/a
Expected complexity level and risk
4/5. This PR touches a lot of things: it changes module composition, generated accessors, function dispatch, runtime context handling, SQL name generation...
Testing
I added generator diagnostics and snapshot coverage, a nested-module host integration fixture, and client regressions targeting .NET 8 and .NET 10. Coverage includes independent tables and caches, deep namespace paths, dispatch, queries and joins, context selection, transaction commit/rollback, and immediate scheduling.
- Run C# generator tests on .NET 8 and .NET 10.
- Run the namespace_csharp standalone integration tests.
- Run the C# client regression harness against the updated local SDK packages.
Sorry, something went wrong.
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.
Just one comment but other wise this is 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.
cloutiertyler
added a commit
that referenced
this pull request
Nov 4, 2026
C# gained ctx.As selection and nested/repeated mounts in 2.14 (#6112), so
the skills no longer say C# lacks ctx.As or that only the root can mount an
assembly once. TypeScript omits primary keys from argument-bearing view rows
instead of rejecting them, and nothing prevents mounting a TS module twice.
Reviewers
bfops
Awaiting requested review from bfops
jdetter
Awaiting requested review from jdetter
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.
|