clockworklabs / clockworklabs/SpacetimeDB

Feature request: Custom types for indexes in modules

Open
#2,606 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feature-request
Dominant language
Rust
Stars
25.2k
Forks
1.1k
Avg merge
2d 7h
Merged PRs (30d)
46

Description

Created from discord issue: https://discord.com/channels/1037340874172014652/1353158092547817483/1353158092547817483

If you have a table in a C# module defined like this:

   [Table(Public = true)]
   [SpacetimeDB.Index.BTree(Name = "GetPos", Columns = [nameof(CharacterID), nameof(Pos)])]
   public partial class Test
   {
       [PrimaryKey, AutoInc]
       public uint RowID;
       public Vector2 Pos;
       public uint CharacterID;
   }

Vector2 is a struct defined within partial class Module. If you do this, this yields:

Image

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No implementation files or tests are named. Reproduce the C# table example with a Vector2 struct defined inside the partial Module, then determine the expected behavior for using that custom type in the BTree index and document a passing example or test as done.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
databases
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.