* make user tables private by default and define privacy via attribute
* switch to spacetimedb(table(public)) syntax
* accept codegen snap changes
* sdk: use public in define_tables!
* bindings-macro: adjust some doc comments
* sdk-test-connect-disconnect: make Connected/Disconnected public tables
* Make Public Private again
* Add script to dispatch bot tests to BitCraftBots
* Make sure results are named correctly, whoops
* Move results to a private bucket, whoops
* Pull in various fixes
* Safer for merge, don't run bot tests on every PR...
* Fix tracing patch
* Remove accidental file
* Test commit
* Test
* Test
* Fix results upload
* Address review comments
Looks like these constants got missed during upgrade, making AOT version ABI-incompatible.
Unfortunately, there's no way to use a central constant here, so we probably should add it to some "steps to do during ABI version bump" doc.
* Fix FilterBy regression in C#
Fixes regression accidentally introduced in #1277: if FindBy returns null, FilterBy will return an iterable with a single null item instead of an empty iterable.
* Fix snapshots
The new `record struct` construct is the same as `struct`, but automatically derives equality and hashing by walking through the fields - exactly what we need for those 2 types.
## Description of Changes
Just bumps the version number. Since 0.9.1 has been released, we are now
on 0.9.2+!
## API
- [ ] This is an API breaking change to the SDK
*If the API is breaking, please state below what will break*
## Requires SpacetimeDB PRs
*List any PRs here that are required for this SDK change to work*
Co-authored-by: Zeke Foppa <github.com/bfops>
* commitlog: Panic on fsync failure
Errors returned by `fsync(2)` are particularly nefarious, as it is
mostly undefined what the state of the page cache is in this case.
Since the log is synced asynchronously and not after every write, it is
impossible to know up to which commit data can be considered durable --
except by reading the most recent segment from disk.
Therefore, the reasonable thing to do is to prevent any further use of
the log, and force users to re-load it from disk.
Note that this is only half of the solution: an application restart may
still read data from the page cache, which could be gone after a system
restart.
To fix this, we would need to employ direct I/O (i.e. `O_DIRECT`), which
however is beyond the scope of this patch as it invalidates the use of
most of `std::io`.
* commitlog: Handle duplicate commits when iterating
We cannot exclude the possibility of a false failure in I/O operations.
In particular, `EIO` errors are difficult to attribute to a particular
write, as they happen asynchronously during flush of the page cache.
Because we do not bypass the page cache, the possibility exists that a
particular commit is lost when it isn't, or that it is considered
durable when it isn't. The former could lead to duplicate commits
appearing in the log, while the latter could lead to a matching offset
number, but with different commit payload.
This patch thus ignores duplicates, and introduces a new error variant
in the event the offset matches but the checksum doesn't.
* durability: Manage the flush-and-sync task in this crate
Since syncing the commitlog may now panic, it is more obvious to handle
all async tasks here, so as to be able to handle the panic cases.
Namely, if the `FlushAndSyncTask` panics, the `PersisterTask` is
aborted. This will lead to the channel receiver being dropped, which in
turn will cause the next `append_tx` call to panic.
* commitlog: Remove async flush-and-sync
Due to panic behaviour, it is now preferable to manage periodic sync at
the use site of the commitlog crate.
Hence remove `flush_and_sync_every` method, and with it the dependency
on tokio.
- Limit types to those defined in the consistent filtering proposal (#1256).
- Make `filterBy` a lazy iterable for consistency and performance reasons.
- Add `findBy` for unique fields as per proposal.
## Description of Changes
As a result of the consistent filtering rules proposal
(clockworklabs/SpacetimeDB#1256), all equatable types are now natively
equatable in C# as well.
This allows us to compare objects directly, without holding and
comparing AlgebraicValue in the entries map as well, which has a bit of
a domino effect and allows to optimise, simplify or even remove some
parts of the SDK.
## API
- [x] This is an API breaking change to the SDK
New filtering rules limit types on which filtering can be done, as well
as change the return type of `FilterBy` functions to always be iterable.
## Requires SpacetimeDB PRs
https://github.com/clockworklabs/SpacetimeDB/pull/1277
* Update C# codegen to consistent filtering rules
- Limit types as per proposal.
- Add `Query` client-side SDK helper for API parity with server-side modules (on client-side it's a simple wrapper around Iter + Where).
- Change return type of `FilterBy` to always be iterable, with new `FindBy` function for unique fields.
- Simplify the way primary keys are handled - must go with https://github.com/clockworklabs/spacetimedb-csharp-sdk/pull/93 for the client SDK counterpart.
* Add using for System.Linq
* Update snapshot
* Extend codegen tests to Rust
* Replace cursive-chat module_bindings with symlink
* Implement consistent filtering rules for Rust
* Fixup
* Regenerate tests
* Fix non-deterministic import order
* cargo fmt
* Fix chat examples
* Change symlinks to files themselves
* Revert accidental change
This needs to wait for server-side API break to be implemented as well.
## Description of Changes
Ignore duplicate inserts in the same subscription update
## API
- [ ] This is an API breaking change to the SDK
*If the API is breaking, please state below what will break*
## Requires SpacetimeDB PRs
*List any PRs here that are required for this SDK change to work*
* Add smoketest to add table without migration, currently failing
* Add more logging to smoketests, add_table_pseudomigration passing
* Fix test failing for the wrong reason
## Description of Changes
Bumped the version number to 0.9.0 as this was forgotten in the previous
release. Includes all changes to date.
## API
- [X] This is an API breaking change to the SDK
*If the API is breaking, please state below what will break*
Not sure but its going out with the latest release. The previous package
was 5 months ago.
## Requires SpacetimeDB PRs
*List any PRs here that are required for this SDK change to work*
2. Only call system_tables() once in bootstrap_system_tables.
3. Take `TableId` by value more
4. Rename `table_exists` -> `table_name`
5. Dedup `table_name` by using `get_schema()`.
6. Other misc deduping.
Reserves an unreasonably large number of sequence values for use by system
tables. This means that user-created tables will draw id values starting
from the reserved range + 1, as opposed to number of values taken by
system tables + 1.
Adding new system tables is thus unlikely to interfere with already-assigned
values in existing databases.
Make it so `HostController` manages both the module host (wasm
machinery) and the database (`RelationalDB` / `DatabaseInstanceContext`)
of spacetime databases deployed to a server.
The `DatabaseInstanceContextController` (DBIC) is removed in the
process.
This allows to make database accesses panic-safe, in that uncaught
panics will cause all resouces to be released and the database to be
restarted on subsequent access. This is a prerequisite for #985.
It also allows to move towards storage of the module binary directly in
the database / commitlog. This patch, however, makes some contortions in
order to **not** introduce a breaking change just yet.