Skip to content

Commit c1423cf

Browse files
committed
Add docs for indexable types to C#
Includes references to changes made by clockworklabs/SpacetimeDB#2506 , which as of writing has not merged. We should not push this commit live until after that PR is released.
1 parent c61f006 commit c1423cf

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

docs/modules/c-sharp/index.md

+12-1
Original file line numberDiff line numberDiff line change
@@ -611,6 +611,17 @@ public partial struct AcademicPaper {
611611

612612
Any table supports getting an [`Index`](#class-index) using `ctx.Db.{table}.{index}`. For example, `ctx.Db.academic_paper.TitleAndDate` or `ctx.Db.academic_paper.Venue`.
613613

614+
## Indexable Types
615+
616+
SpacetimeDB supports only a restricted set of types as index keys:
617+
618+
- Signed and unsigned integers of various widths.
619+
- `bool`.
620+
- `string`.
621+
- [`Identity`](#struct-identity).
622+
- [`ConnectionId`](#struct-connectionid).
623+
- `enum`s annotated with [`SpacetimeDB.Type`](#attribute-spacetimedbtype).
624+
614625
## Class `Index`
615626

616627
```csharp
@@ -1391,4 +1402,4 @@ Stored in reducer-scheduling tables as a column.
13911402
[`DateTimeOffset`]: https://learn.microsoft.com/en-us/dotnet/api/system.datetimeoffset?view=net-9.0
13921403
[`TimeSpan`]: https://learn.microsoft.com/en-us/dotnet/api/system.timespan?view=net-9.0
13931404
[unix epoch]: https://en.wikipedia.org/wiki/Unix_time
1394-
[`System.Random`]: https://learn.microsoft.com/en-us/dotnet/api/system.random?view=net-9.0
1405+
[`System.Random`]: https://learn.microsoft.com/en-us/dotnet/api/system.random?view=net-9.0

0 commit comments

Comments
 (0)