Skip to content

Create Test of C# Code Generation for Tables with BTree indexes of type Identity #2362

Closed
@rekhoff

Description

@rekhoff

Action to perform:

Add a test to com.clockworklabs.spacetimedbsdk that checks code generation of a Table with an index of type btree of an Identity type is generating C# code as intended.
Manually performed example from #2354 that should be reproduced in an automated test:

  1. Created a test project with a Rust server defining a table with a btree index like:
#[index(btree)]
pub identity: Identity,

and another where a table was defined with:
#[spacetimedb::table(name = period_timer, scheduled(period, at = scheduled_at), index(name = identity, btree(columns = [identity])))]
2. Published the server.
3. Created a C# client and generated the bindings.
4. Confirmed issue existed prior to change: IDE reports an error in the table definition of The type 'SpacetimeDB.Identity' must be convertible to 'System.IComparable<SpacetimeDB.Identity>' in order to use it as parameter 'Column' in the generic class 'SpacetimeDB.RemoteTableHandle<EventContext,Row>.BTreeIndexBase<Column>'
5. Made change contained in this PR.
6. Rebuilt SpacetimeDB executables, and C# SDK NuGet files.
7. Tested again by republishing and regenerating bindings.
8. Observed IDE no longer reports issue.

Ticket Generated from the comment:
#2354 (review)

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions