Open
Conversation
Tests case conversion of names with digit boundaries against the sdk-test-case-conversion-ts module: - Table accessors: player_1(), person_2(), players_at_level_2() - Fields with digits: player_1_id, current_level_2, status_3_field, age_value_1, person_2_id - Enum variants: Player2Status::Active1, Player2Status::BannedUntil - Nested structs: Person3Info with digit-boundary fields - Reducers: create_player_1, add_person_2, ban_player_1 (explicit name) - Views: Level2Players (canonical) → players_at_level_2 (accessor) - SQL queries using canonical wire names 5 test cases: insert-player: insert + verify field names + enum insert-person: insert + verify nested struct fields ban-player: update via reducer with explicit name subscribe-view: subscribe to view with case-converted accessor subscribe-canonical-names: verify canonical names in SQL queries
All subscriptions now use .add_query() instead of raw SQL strings.
Tests:
insert-player: query builder subscribe to player_1 table
insert-person: query builder subscribe to player_1 + person_2
ban-player: query builder subscribe + update via explicit-name reducer
query-builder-filter: filter on digit-boundary column (current_level_2 == 5)
query-builder-join: person_2 RIGHT SEMIJOIN player_1 ON player_ref = player_1_id
Tests that digit-boundary column names work in join predicates
and that joined results flow through case-converted accessors
- View renamed: Level2Players → Level2Person, accessor: person_at_level_2() - View now returns Person2 rows (matching rightSemijoin semantics) - player_name: Vec<String> → String - IDs: u64 → u32 with autoInc - BannedUntil: u64 → u32 - Regenerated all bindings - Updated join test to listen for Person2 inserts (right side of join)
Rust equivalent of sdk-test-case-conversion-ts for testing case conversion with digit-boundary names. Includes: - Player2Status enum (Active1, BannedUntil(u32)) - Person3Info struct (AgeValue1, ScoreTotal) - Player1Canonical table (Player1Id, player_name, currentLevel2, status3Field) - Person2 table (Person2Id, FirstName, playerRef, personInfo) - CreatePlayer1, AddPerson2 reducers - banPlayer1 reducer (explicit name) - Level2Person view (join via playerRef)
- Create TypeScript client test for sdk-test-case-conversion (Rust module) - Add case_conversion_rust test module to test.rs - Tests cover table subscriptions, reducer calls, query builder usage - Verifies case-converted names work correctly from TypeScript → Rust - Complements existing case_conversion_ts (Rust → TypeScript) tests
- Correct path from ../../typescript to ../typescript - Change script from 'npm run test' to 'npm run start' to match test framework expectations
split_command_string() is a naive space-splitter that doesn't understand shell operators like &&. npm was receiving '&&' as a package name argument. Wrap the compound command in sh -c '...' so the shell interprets it.
- Rewrites case-conversion-test-client/src/index.ts to test the Rust module sdk-test-case-conversion from a TypeScript client - Tests: insert-player, insert-person, ban-player, query-builder-filter, query-builder-join - Verifies digit-boundary field names, nested structs, enum variants, explicit reducer names, and query builder filters/joins all work through case conversion from TypeScript - Adds case_conversion_rust_ts_client test module in sdks/rust/tests/test.rs
5152305 to
e558d54
Compare
- Add case-conversion-test-client to pnpm-workspace.yaml so 'spacetimedb: workspace:*' resolves to the local SDK - Restore subcommand dispatch in index.ts (was WIP/commented out) - Fix dbNameOrPanic() to read from env var properly - Add case_conversion_rust_ts_client test module in sdks/rust/tests/test.rs (uses pnpm install + pnpm build to compile the TS client) - Add README with instructions to run locally - Add .gitignore for node_modules/ and dist/
Shubham8287
commented
Feb 25, 2026
| "clean": "rm -rf dist", | ||
| "build": "tsc", | ||
| "watch": "tsc -w", | ||
| "start": "node dist/index.js", |
Contributor
Author
There was a problem hiding this comment.
@coolreader18 can you look at this test, help me how can I run this ?
pnpm start throws can not find modules pointing to some bindings.
Also, is it even the right place to put this test? Can you recommend a better way to setup it?
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.
Description of Changes
API and ABI breaking changes
Expected complexity level and risk
Testing