Skip to content

Identity and ConnectionId should implement IComparable #2348

@rekhoff

Description

@rekhoff

Issue:

When attempting to create a table that uses Identity as an index of a BTree like:

#[index(btree)]
pub identity: Identity,

Generated code in C# will throw the error:
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>'

This is because SpacetimeDB.Identity does not implement the IComparable interface:

public readonly record struct Identity

While we are at it, it makes sense to implement IComparable for ConnectionId as well:

public readonly record struct ConnectionId

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions