Table accessor + capabilities trait - #85
Merged
Merged
Conversation
This was
linked to
issues
Aug 14, 2026
onx2
marked this pull request as ready for review
August 14, 2026 00:59
Contributor
There was a problem hiding this comment.
Pull request overview
This PR refactors table binding/registration to use SpacetimeDB SDK “table accessor + capability traits” (e.g., TableAccessor, TableLike, WithInsert/WithDelete/WithUpdate), replacing the previous binder-struct API and updating documentation/examples accordingly.
Changes:
- Replace
TableBinder/ViewBinder/etc. with capability-based binding helpers (bind_table,bind_table_without_pk,bind_insert). - Update
StdbPluginbuilder methods to register tables/views/event tables via generated*TableAccessormarker types. - Bump
bevy_stdbto0.13.0, update SpacetimeDB dependency versions, and refresh the example bindings/lockfiles.
Reviewed changes
Copilot reviewed 11 out of 13 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/table/mod.rs | Switches table module exports to the new bind helper functions. |
| src/table/bind.rs | Implements capability-trait-based binding helpers for insert/delete/update/insert-update. |
| src/plugin.rs | Updates StdbPlugin table/view/event-table registration API to use TableAccessor + capability bounds. |
| src/lib.rs | Updates crate-level docs to reflect the new accessor-based API. |
| README.md | Updates usage examples and explanation text for accessor-based registration. |
| examples/simple/server/Cargo.toml | Updates SpacetimeDB server dependency requirement. |
| examples/simple/client/src/stdb.rs | Updates example client to register a table via *TableAccessor. |
| examples/simple/client/src/module_bindings/player_table.rs | Adds generated TableAccessor + TableLike + capability trait impls for the player table handle. |
| examples/simple/client/src/module_bindings/mod.rs | Updates generated-by SpacetimeDB CLI version comment. |
| examples/simple/client/Cargo.toml | Updates spacetimedb-sdk dependency version (including wasm target dep). |
| examples/simple/Cargo.lock | Updates example lockfile versions for the new dependency set. |
| Cargo.toml | Bumps crate version and updates spacetimedb-sdk dependency requirement. |
| Cargo.lock | Updates lockfile to bevy_stdb 0.13.0 and newer SpacetimeDB-related crates. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Update
bevy_stdbto use SpacetimeDB's generatedTableAccessormarkers and granular table capability traits.Table registration no longer requires a lifetime-sensitive callback:
Binding internals now use the precise SDK capabilities:
TableLikeWithInsertWithDeleteWithUpdateThis removes the need to rely on broader semantic traits such as
Table,TableWithPrimaryKey, andEventTable.The result is simpler registration, better lifetime handling, and more precise compile-time guarantees. For example, insert-only sources only require
WithInsert, while update bindings requireWithUpdateexplicitly. Views with primary keys can therefore support updates when their generated handle provides that capability.