clockworklabs / SpacetimeDB

Multiplayer at the speed of light
https://spacetimedb.com
Other
4.41k stars 110 forks source link

`RawModuleDef` should include fewer names, allowing the host to generate names consistently #1893

Open kazimuth opened 4 weeks ago

kazimuth commented 4 weeks ago

With phoebe's addition of accessor_name for indexes, the name field in various RawModuleDefs become redundant. Currently, the module bindings are allowed to specify names for RawIndexDef / RawConstraintDef / RawScheduleDef. These names are (almost?) completely auto-generated. The user-specified name for indexes is already its own field, accessor_name, distinct from these.

The problem right now is that we have to re-implement name generation in both the C# and Rust module bindings. It's a pain to make these consistent. It's much easier to just not bother, and then have the host generate all names uniformly during RawModuleDef validation. Names are almost entirely an internal implementation detail anyway.