## Description of Changes
This is the companion PR for
https://github.com/clockworklabs/SpacetimeDB/pull/2184, please see the
other PR for full description.
On the client side main changes are:
- Regenerate .NET and Unity test client bindings and test snapshot.
- Remove `IDatabaseRow` since V9 multi-tables splits data types from
actual table definitions, so those "table data types" are no longer
special. Just using `IStructuralReadWrite` in its place now.
- Add base index classes as mentioned in the other PR.
- As a sub-improvement, the non-unique index class actually does
indexing instead of iterating over the entire table like we did before.
- Remove internal-but-not-really `InternalInvokeValueDeleted` and
`InternalInvokeValueInserted` methods in favour of private events.
## API
- [x] This is an API breaking change to the SDK
Removes some technically-visible but internal APIs.
## Requires SpacetimeDB PRs
https://github.com/clockworklabs/SpacetimeDB/pull/2184
## Testsuite
*If you would like to run the your SDK changes in this PR against a
specific SpacetimeDB branch, specify that here. This can be a branch
name or a link to a PR.*
SpacetimeDB branch name: ingvar/csharp-new-codegen
## Testing
*Write instructions for a test that you performed for this PR*
- [x] Manually tested Blackholio
---------
Co-authored-by: James Gilles <jameshgilles@gmail.com>
## Description of Changes
*Describe what has been changed, any new features or bug fixes*
Changed logging based on [this
proposal](https://github.com/clockworklabs/SpacetimeDBPrivate/pull/981)
## API
- [x] This is an API breaking change to the SDK
*If the API is breaking, please state below what will break*
Logging interface is different now. `Logger` has been renamed to `Log`,
and its methods have been renamed as well (ex. `Logger.LogError` is now
`Log.Error`)
## Requires SpacetimeDB PRs
*List any PRs here that are required for this SDK change to work*
---------
Co-authored-by: Zeke Foppa <196249+bfops@users.noreply.github.com>
Co-authored-by: Zeke Foppa <bfops@users.noreply.github.com>
Co-authored-by: Jeremie Pelletier <jeremiep@gmail.com>
Co-authored-by: Steve Boytsun <steve@clockwokrlabs.io>
Co-authored-by: Ingvar Stepanyan <me@rreverser.com>
Re: https://github.com/clockworklabs/SpacetimeDB/pull/840
This commit updates the C# SDK to no longer use the `row_pk` field
of the Protobuf client API,
as that field has been removed. (Will have been removed, as of merging.)
Where a table cache was previously keyed on `byte[] rowPk`,
it is now keyed on `byte[] rowBytes`,
where `rowBytes` is the BSATN-encoded bytes of the row.
This means we effectively store two copies of each row in the client cache:
the BSATN serialized format, and the decoded domain type.
An alternate implementation would be to make the table caches be sets of domain types,
discarding the BSATN bytes.
We find this undesirable for several reasons:
- Hashing and equality-comparing `byte[]` is almost certainly more efficient
than doing the same for domain types.
- Even if hashing and equality-comparing domain types were efficient,
we would still have to update codegen to emit hashing and equality methods
for all types in the module_bindings.
This implementation requires no changes to the module_bindings.
- We already have the BSATN bytes sitting around,
as they're necessarily part of the message we recieve from the server.
This change does no additional serialization or deserialization.
In essence, we're trading memory for time and simplicity.
Keeping the BSATN bytes live approximately doubles the table cache's memory usage,
but simplifies the implementation greatly,
and (we suspect) speeds up table cache insertions, deletions and lookups.