clockworklabs / clockworklabs/SpacetimeDB
Implement column aliases in C# and Rust modules
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 25.2k
- Forks
- 1.1k
- Avg merge
- 2d 7h
- Merged PRs (30d)
- 46
Description
We'd like to be able to do something like this:
// We're using this table as a singleton, so in this table
// there only be one element where the `id` is 0.
[Table(Name = "config", Public = true)]
public partial struct Config
{
[PrimaryKey]
[Column(Name = "id")]
public uint Id;
[Column(Name = "world_size")]
public ulong WorldSize;
}
// We're using this table as a singleton, so in this table
// there only be one element where the `id` is 0.
#[spacetimedb::table(name = config, public)]
pub struct Config {
#[primary_key]
pub id: u32,
#[column(name = "foobar")]
pub foobar: u64,
}
Exactly spelling not proposed. Needs design work. This is a common feature in ORMs:
https://orm.drizzle.team/docs/sql-schema-declaration#tables-and-columns-declaration
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by comparing the C# and Rust table and column attribute examples in the issue, then review the linked ORM reference for naming conventions. Define the alias behavior and syntax before implementation; done means both modules can map a field name to a different database column name, with the final design documented and tested.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp, rust
- Domain
- databases
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100