We have a big release for you today 🎉 🎉 ! We're including some big performance improvements ⚡ and long-awaited bugfixes 🐞! Remember to stay tuned for our 0.12 release soon.
This release includes some major breaking changes, so you won't be able to use your old databases with this version. Run spacetime local clear
to remove them.
Important changes
Major
- ⚡ We removed our usage of protobuf, in favor of our own internal format (#1077) - this is a big performance improvement on the client and the server!
- ⌛ We removed the server-side
schedule!
macro and its equivalents in favor of table-based timers (#1449). Please check our server module docs for more info on how to use the new system.
Here is some example code which uses the new timer tables:
// The `scheduled` attribute links this table to a reducer.
#[spacetimedb(table, scheduled(send_message))]
struct SendMessageTimer {
text: String,
}
// Reducers linked to the scheduler table should have their first argument as `ReducerContext`
// and the second as an instance of the table struct it is linked to.
#[spacetimedb(reducer)]
fn send_message(ctx: ReducerContext, arg: SendMessageTimer) -> Result<(), String> {
// ...
}
// Scheduling reducers inside `init` reducer
fn init() {
// Scheduling a reducer for a specific Timestamp
SendMessageTimer::insert(SendMessageTimer {
scheduled_id: 0,
text:"bot sending a message".to_string(),
//`spacetimedb::Timestamp` implements `From` trait to `ScheduleAt::Time`.
scheduled_at: ctx.timestamp.plus(Duration::from_secs(10)).into()
});
// Scheduling a reducer to be called at fixed interval of 100 milliseconds.
SendMessageTimer::insert(SendMessageTimer {
scheduled_id: 0,
text:"bot sending a message".to_string(),
//`std::time::Duration` implements `From` trait to `ScheduleAt::Duration`.
scheduled_at: duration!(100ms).into(),
});
}
CLI changes
- CLI subcommands consistently use
--server
and--identity
args consistently instead of anonymous args (#1482) - We have a new
subscribe
subcommand! (#1343) - Bugfix: Update help text suggesting
spacetime server fingerprint
to have the correct-s
param (#1457) - Bugfix:
spacetime server add
- Remove trailing/
s from server URIs (#1552)
Web API
- Recovery code APIs are now under /identity and using POST (#1492)
- /identity GET returns an empty success if the email address is not found (#1491)
C#
- Use latest C# in BSATN.Runtime (#1548)
- Fixed exceptions in C# SDK when someone disconnects or when a transaction originates from CLI (#1461)
- Include BSATN.Codegen in nuget pack (#1424)
- Generate tagged enums in C# client code (#1421)
- Restructure NuGet packaging (#1440)
- Restructure C# SpacetimeDB runtime (#1455)
- Implement the module rng proposal for C# (#1425)
- Roslyn cacheability testing and fixes (#1420)
Using SpacetimeDB as a library
- table: Make
with_mut_schema
clone-on-write (#1530) - Fix running 'cargo test' in crates/lib (#1478)
- Move
db
module fromspacetimedb_sats
tospacetimedb_lib
(#1479) - Move schemas to
schema
crate, renameDef
toRawDefV8
(#1498) - core: Simplify custom bootstrap (#1404)
TableDef
: clarifygenerated_*
methods (#1419)- Make some commitlog helpers public (#1390)
- perf(1351): Add a row count metric for subscriptions (#1435)
Bugfixes
- ST sequences: respect allocated amount on restart (#1532)
- Drain scheduler Actor channel before start (#1529)
Table::is_row_present
: don't panic (#1526)- Ignore some sequence allocation mismatches when checking for compatible updates (#1524)
- Fix inconsistent auth/identity creation (#735)
ColList
: preserve list order onlist.push(..)
(#1474)- HACK: Tweak
schema_updates
to allow adding/removing non-unique indices (#1434) - Fix index removal and additions + add smoketest (#1444)
- fix(1409): Counter metric names (#1411)
- core: Downgrade host log verbosity (#1446)
- Implement a temporary type check validation on sql compiling (#1456)
- core: Replace host scheduler on update (#1453)
Changelog
- Remove unused file table.rs by @Centril in #1417
- fix(1409): Counter metric names by @joshua-spacetime in #1411
- chore: Remove already tracked subscription counter by @joshua-spacetime in #1412
- refactor: Record txn-level metrics in a single utility by @joshua-spacetime in #1414
- Generate tagged enums in C# client code by @RReverser in #1421
- Include BSATN.Codegen in nuget pack by @kurtismullins in #1424
TableDef
: clarifygenerated_*
methods by @Centril in #1419- Add small 'realistic' workload benchmark integration test by @mamcx in #714
- Impl subscribe subcommand & subscription smoketests by @coolreader18 in #1343
- HACK: Tweak
schema_updates
to allow adding/removing non-unique indices by @Centril in #1434 - Update tools/publish-crates.sh by @bfops in #1426
- refactor: Reconfigure histogram buckets for certain metrics by @joshua-spacetime in #1436
- perf(1351): Add a row count metric for subscriptions by @joshua-spacetime in #1435
- Implement the module rng proposal for C# by @RReverser in #1425
- Bump version to 0.10.1 by @bfops in #1443
- Roslyn cacheability testing and fixes by @RReverser in #1420
- Restructure NuGet packaging by @RReverser in #1440
- Fix index removal and additions + add smoketest by @Centril in #1444
- core: Downgrade host log verbosity by @kim in #1446
- Smoketest auto-disconnect after restart by @kim in #1367
- core: Simplify custom bootstrap by @kim in #1404
- core: Replace host scheduler on update by @kim in #1453
- CLI - Update help text suggesting
spacetime server fingerprint
to have the correct-s
param by @bfops in #1457 - Fix inconsistent auth/identity creation by @coolreader18 in #735
- Fixed exceptions in C# SDK when someone disconnects or when a transaction originates from CLI by @SteveBoytsun in #1461
- Ensure MacOS builds from CI are executable by @kurtismullins in #1462
- Automated Discord post when a PR merges by @bfops in #1470
- Fix C# module smoketests by @bfops in #1475
- smoketests: Add test for module hotswapping by @kim in #1403
ColList
: preserve list order onlist.push(..)
by @Centril in #1474- CLI: Put some common params in a central place by @bfops in #1484
- Implement a temporary type check validation on sql compiling by @mamcx in #1456
- Make some commitlog helpers public by @lcodes in #1390
- Adding benchmark for deserialize json & product value by @mamcx in #1035
- CLI: Use
--server
and--identity
args consistently instead of anonymous args by @bfops in #1482 - Fix running 'cargo test' in crates/lib by @kazimuth in #1478
- Restructure C# SpacetimeDB runtime by @RReverser in #1455
- Protobufectomy: server by @coolreader18 in #1077
- refactor(1494): Remove SQL DDL per 1.0 SQL spec by @joshua-spacetime in #1499
- C# smoketests use
nuget.config
by @bfops in #1500 - CI - SpacetimeDB PRs run the C# SDK tests by @bfops in #1503
- Timer Table Implementation by @Shubham8287 in #1449
- CI - Post-to-discord workflow only fires if the PR merged to
master
by @bfops in #1520 - Return empty success from /identity GET by @lcodes in #1491
- Moving recovery code APIs under /identity and using POST by @lcodes in #1492
Table::is_row_present
: don't panic by @gefjon in #1526- Move
db
module fromspacetimedb_sats
tospacetimedb_lib
by @kazimuth in #1479 - Ignore some sequence allocation mismatches when checking for compatible updates by @gefjon in #1524
- Add some helper scripts by @kazimuth in #1501
- Drain scheduler Actor channel before start by @Shubham8287 in #1529
- commitlog: Fix single-commit bitflip test by @kim in #1528
- Bump version to 0.11.0 by @bfops in #1531
- ST sequences: respect allocated amount on restart by @gefjon in #1532
- Don't run bot tests on every master commit whoops by @kazimuth in #1441
- Move schemas to
schema
crate, renameDef
toRawDefV8
by @kazimuth in #1498 spacetime generate
- make the source args optional by @bfops in #1537- C#: ignore fields in partial declaration not marked with BSATN attribute by @RReverser in #1545
- ABI BREAK: Add versioning for RawModuleDef by @kazimuth in #1518
- C#: remove
using SpacetimeDB.ClientApi;
by @RReverser in #1546 - broadcast schedule table deletion by @Shubham8287 in #1547
spacetime server add
- Remove trailing/
s from server URIs by @bfops in #1552- core: Singular system table names by @kim in #1550
- Add ErrorStream combinator by @kazimuth in #1543
- Use latest C# in BSATN.Runtime by @RReverser in #1548
- table: Make
with_mut_schema
clone-on-write by @kim in #1530
Full Changelog: v0.10.1-beta...v0.11.0-beta