[STABILITY] [PROPOSAL] Formulate the LINQ plan for Rust and C# APIs for accessing database data to be consistent
All types of queries should look the same:
- Client querying local db
- Client querying remote db
- Module querying spacetime db
- Client subscribing to remote db
And this should have some kind of LINQ syntax which generates a query datastructure/representation of the query which gets passed to spacetimedb to be executed.
For example see the following pseudocode/temporary syntax for the idea
let players = Player::filter_by_x(5).filter_by_z(0).execute();
// Where Player::filter_by_x(5).filter_by_z(0) actually just builds a query like
// "SELECT * FROM Player WHERE x = 5 AND z = 0" and then `.execute` executes it against the db
// except that we don't actually want to use SQL necessarily (and probably represented as AlgebraicValue).
I will also note, that we should probably move away from the Player:: syntax as this does not allow for the same type to be used by multiple tables.
as this does not allow for the same type to be used by multiple tables.
Not sure what you mean.
I mean we should be able to have a SignedInPlayer table and SignedOutPlayer table that both use the same Rust struct type:
struct Player {
}
I am moving this to be a P2 for 1.0 because with @joshua-spacetime's proposal for the physical index access methods we no longer need a LINQ plan for 1.0 and further more Phoebe should describe the entire surface area of the API here:
https://github.com/clockworklabs/SpacetimeDBPrivate/pull/866