Commit Graph

3186 Commits

Author SHA1 Message Date
james gilles cc0747c169 Add shared ScheduleAt type (#88)
* Add shared ScheduleAt type

* Lint

---------

Co-authored-by: Tyler Cloutier <cloutiertyler@aol.com>
Co-authored-by: Tyler Cloutier <cloutiertyler@users.noreply.github.com>
2025-02-08 13:29:27 -05:00
Phoebe Goldman f86104f92c Add Timestamp to the SDK, moving it out of client_api (#114)
* Add `Timestamp` to the SDK, moving it out of `client_api`

Companion to SpacetimeDB#1836

* Add `TimeDuration` class

* Add forgotten return type annotation

* 🤦

* Prettier

* Update `client_api` schema to use `TimeDuration`

* Micros, not nanos

From SpacetimeDB 072c2ea3a3:

Prioritize BSATN and BFLATN compat with 0.12

Timestamp and TimeDuration store `micros: i64`, not `nanos: i64`.
This means that old commitlogs and snapshots should still be compatible,
assuming they don't include timestamps greater than `i64::MAX`,
as previously we used `micros: u64`. This seems unlikely.

* Ran new code gen

* Fixed rebase conflicts

---------

Co-authored-by: Tyler Cloutier <cloutiertyler@aol.com>
2025-02-08 13:26:45 -05:00
Tyler Cloutier 249910b079 Implemented the new EventContext types in Typescript codegen (#2224) 2025-02-08 18:00:34 +00:00
Tyler Cloutier b882aeeb17 Updates the TypesScript SDK to use the new EventContext variants (#136)
* Updated the quickstart to use the new 1.0 API

* Ran prettier

* Updated CSS

* Removed server code

* Moved out of the client dir

* Updated lockfile

* Added new workflow

* Small fixes

* Updated PR template

* Ran prettier

* Fixes to workflwo

* Workflow fixes

* Fixes the toolchain thing

* Added SpacetimeDB integration test

* Fix workflow hopefully

* Fix workflow

* Prettier

* Updated pull request template to better reflect the reality

* Fixed path in workflow

* Prettier after codegen

* Regenerate

* Say yes to deleting data

* Updated codegen to latest master of SpacetimeDB

* debug actions

* Formatting

* Implemented EventContext update

* Removed unused imports

* Fix merge marker
2025-02-08 00:42:57 -05:00
Phoebe Goldman 6c11c8609e Style guide: add formatting advice for GUI elements and menu paths (#129)
* Style guide: add formatting advice for menu items

* Generalize guidance to all GUI elements, not just menu paths
2025-02-08 00:39:35 -05:00
Tyler Cloutier f26e9cc912 Small TS SDK Quickstart Fixes (#157)
Updated quickstart url
2025-02-08 00:38:59 -05:00
Tyler Cloutier fa25bedff6 Updated the quickstart to use the new 1.0 API (#130)
* Updated the quickstart to use the new 1.0 API

* Ran prettier

* Updated CSS

* Removed server code

* Moved out of the client dir

* Updated lockfile

* Added new workflow

* Small fixes

* Updated PR template

* Ran prettier

* Fixes to workflwo

* Workflow fixes

* Fixes the toolchain thing

* Added SpacetimeDB integration test

* Fix workflow hopefully

* Fix workflow

* Prettier

* Updated pull request template to better reflect the reality

* Fixed path in workflow

* Prettier after codegen

* Regenerate

* Say yes to deleting data

* Updated codegen to latest master of SpacetimeDB

* debug actions

* Formatting

* add README steps

* Ran lints

---------

Co-authored-by: Zeke Foppa <bfops@users.noreply.github.com>
2025-02-07 21:29:07 -05:00
joshua-spacetime f0361525bd Error handling for incremental evaluation (#2223) 2025-02-07 23:31:27 +00:00
Zeke Foppa f966144f3a Update DLLs (#241)
## Description of Changes
This seems to fix the unity testsuite, which otherwise is failing when
pointed at master.

## API

No breaking changes.

## Requires SpacetimeDB PRs
None

## Testsuite
This is meant to fix pointing at master.

SpacetimeDB branch name: master

## Testing
- [x] Unity testsuite now passes

---------

Co-authored-by: Zeke Foppa <bfops@users.noreply.github.com>
2025-02-07 15:21:32 -08:00
james gilles 9f58828caa Rework event contexts in C# (#240)
## Description of Changes
https://github.com/clockworklabs/SpacetimeDB/pull/2226

## API

 - [x] This is an API breaking change to the SDK

callbacks are better

## Requires SpacetimeDB PRs
https://github.com/clockworklabs/SpacetimeDB/pull/2226

## Testsuite

SpacetimeDB branch name: jgilles/csharp-better-events

## Testing

- [x] quickstart
- [x] blackholio
2025-02-07 22:03:55 +00:00
james gilles 9c92edd861 Rework event contexts in C# SDK (#2226) 2025-02-07 21:29:16 +00:00
james gilles b4aa612239 Make Timestamp and TimeDuration special types (#233)
## Description of Changes

C# part of https://github.com/clockworklabs/SpacetimeDB/pull/1836
Needs to be rebased onto
https://github.com/clockworklabs/com.clockworklabs.spacetimedbsdk/pull/220
once that is merged.

## API

 - [x] This is an API breaking change to the SDK

ScheduleAt is now constructed in slightly different ways.

## Requires SpacetimeDB PRs
*List any PRs here that are required for this SDK change to work*

## 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: phoebe/timestamp-special-type

## Testing
Will need an update to blackholio as well.
2025-02-07 14:17:45 -05:00
Phoebe Goldman 91327d585e Make Timestamp a special SATS type (#1836)
Signed-off-by: Phoebe Goldman <phoebe@goldman-tribe.org>
Co-authored-by: James Gilles <jameshgilles@gmail.com>
Co-authored-by: Zeke Foppa <196249+bfops@users.noreply.github.com>
2025-02-07 18:17:53 +00:00
Jeffrey Dallatezza e10273f16d Add metrics for fuel usage and reducer runtime totals. (#2217) 2025-02-07 16:51:24 +00:00
Mazdak Farrokhzad b50b6841f1 Add direct indices to datastore (#2221) 2025-02-07 01:06:38 +00:00
Zeke Foppa a2a1b5d9b2 CLI - Clarify helptext for spacetime login (#2219)
Co-authored-by: Zeke Foppa <bfops@users.noreply.github.com>
2025-02-06 21:47:52 +00:00
Zeke Foppa 09fe2756b8 CLI - Better module language inference (#2218)
Co-authored-by: Zeke Foppa <bfops@users.noreply.github.com>
2025-02-06 21:24:00 +00:00
Noa e6775eb93a Finish spacetimedb-update functionality (#2126) 2025-02-06 20:32:46 +00:00
joshua-spacetime 75ab91d36d Handle optimization and execution errors on initial subscription (#2213) 2025-02-06 19:14:44 +00:00
Jeffrey Dallatezza e171a01cd8 Register data size metrics for standalone. (#2216) 2025-02-06 18:41:16 +00:00
Ingvar Stepanyan fed2a9db3e Fix handling of multi-tables (#229)
## Description of Changes

Unfortunately, none of our tests currently cover this, but while working
on the V9 upgrade, I noticed that this code still relies on `type(Row)`
as a unique table identifier.

That no longer holds with multi-tables as several tables can share the
same `Row` type. In that case, subscription updates would be grouped
incorrectly and always applied to the same first table that uses `Row`
for its data storage.

This PR fixes that by using the table handle itself as a key (compared
by reference).

If transaction updates are already grouped uniquely by table, it should
be possible to simplify this code much further, but I'm not sure if such
guarantee exists, so leaving that untouched.

## 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*

## 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: master

## Testing
*Write instructions for a test that you performed for this PR*

- [x] I did `dotnet test`, but as mentioned in the description, this
requires adding tests for multi-table subscriptions, which I'm afraid I
won't have time to do, so have to leave to follow-up devs.

---------

Co-authored-by: james gilles <jameshgilles@gmail.com>
2025-02-06 17:54:12 +00:00
Mario Montoya 02a61b26bc Fix multi-column index scan (#2208) 2025-02-06 15:29:03 +00:00
Mazdak Farrokhzad 1a3f3af255 add direct indices, except for in datastore & C# (#2205) 2025-02-06 00:40:46 +00:00
james gilles 636e7fed28 Update for new codegen (#18)
* Fix C# server build process & get rid of dead link in client manifest.json

* Fix unfinished paste

* Update for new c# codegen

* Update generated code and package jsons

* Revert server-rust dependency override
2025-02-05 17:25:02 -05:00
Ingvar Stepanyan 88090ec73a Rewrite C# codegen to the new Lang infra + fixes (#2184)
Co-authored-by: James Gilles <jameshgilles@gmail.com>
2025-02-05 22:07:45 +00:00
Ingvar Stepanyan cefc727b76 Rewrite C# codegen to the new Lang infra + fixes (#220)
## 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>
2025-02-05 16:48:15 -05:00
Mazdak Farrokhzad 25d74091c3 Make MutTxId::update really idempotent wrt. TxData (#2212) 2025-02-05 20:40:02 +00:00
Ingvar Stepanyan f4cc0b33d6 Improve CI caching (#228)
## Description of Changes

Use SpacetimeDB commit hash in the cache key and skip
rebuild/reinstallation altogether if we got an exact hit.

This saves 6-8 minutes off CI time on reruns.

## 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*

## 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: master

## Testing
*Write instructions for a test that you performed for this PR*

- [x] CI testing forth and back until it worked correctly.
2025-02-05 13:01:49 -05:00
Phoebe Goldman 2d90657dbc Rust client SDK: rework EventContext into multiple types (#2189) 2025-02-05 00:50:55 +00:00
Phoebe Goldman 3a126bca5a Rust SDK: remove anyhow, use thiserror w/ structured error types (#2169) 2025-02-05 00:01:37 +00:00
joshua-spacetime e4e36ec478 Return errors for invariant violations during query planning (#2209) 2025-02-04 21:58:14 +00:00
Noa fbb5c9ecdc Fix ctrl-c handling (#2200) 2025-02-04 20:08:22 +00:00
joshua-spacetime ad36d13335 Update sql literals to match spec (#2196) 2025-02-04 15:35:02 +00:00
Mazdak Farrokhzad 2fc0361d68 Match datastore semantics more closely: btree_scan => index_scan_range (#2203) 2025-02-04 00:34:33 +00:00
joshua-spacetime 8355ac2630 docs(70): The 1.0 SQL spec
Closes #70.
2025-02-03 15:20:08 -08:00
Phoebe Goldman ad49494e85 prop_assume!(a != b) in some tests to fix spurious failures (#2199) 2025-02-03 15:33:03 +00:00
Phoebe Goldman d839657008 Data size SKU for billing (#2098) 2025-02-03 14:15:30 +00:00
Mazdak Farrokhzad 7937784a8d InstanceEnv: make the inspect_err closures cold (#2197) 2025-01-31 18:40:14 +00:00
Jeffrey Dallatezza e2ffc07997 Implement incremental subscriptions on the client (#2111)
Co-authored-by: Zeke Foppa <196249+bfops@users.noreply.github.com>
2025-01-31 18:02:50 +00:00
joshua-spacetime 6aa75bd0eb Track compute metrics for sql dml with new engine (#2190) 2025-01-31 17:59:33 +00:00
Zeke Foppa 382db47f9b CLI - Just-in-time login flow (#2158)
Co-authored-by: Zeke Foppa <bfops@users.noreply.github.com>
2025-01-31 17:45:44 +00:00
Mazdak Farrokhzad 6f20597600 Make check_and_insert & find_old_row and friends do less checks (#2192) 2025-01-31 15:00:19 +00:00
Noa d4a905d355 Fix CI on master (#2193) 2025-01-30 21:00:03 +00:00
Noa 986354e2f2 Log errmsg if reducer fails (#2186) 2025-01-29 23:39:53 +00:00
joshua-spacetime 4b4484a3aa Track query and datastore cpu usage metrics (#2140) 2025-01-29 21:30:41 +00:00
Zeke Foppa 82ad0a069f Bump version to 1.0.0-rc4 (#225)
## Description of Changes
Corresponding change to
https://github.com/clockworklabs/SpacetimeDB/pull/2177. See that PR for
more details.

~~Note that this PR only bumps the versions, but does **not** update the
DLLs. This is because SpacetimeDB will likely have further changes, so
the DLLs will just need to be updated again (in principle, they should
be updated every time we push to SpacetimeDB `master`, which isn't
really feasible. For this reason, users should not use `staging` without
having their own copy of the SpacetimeDB repo as well).~~

## API

 - [ ] This is an API breaking change to the SDK

No breaking changes.

## Requires SpacetimeDB PRs
https://github.com/clockworklabs/SpacetimeDB/pull/2177

## Testsuite
SpacetimeDB branch name: master

## Testing
- [x] CI passes with that branch name
- [x] The branch name has been changed back to `master` after that PR
merges and CI still passes

---------

Co-authored-by: Zeke Foppa <bfops@users.noreply.github.com>
2025-01-29 10:51:26 -08:00
Noa 696fa45847 Meter wasm memory usage (#2187) 2025-01-29 18:03:47 +00:00
Mazdak Farrokhzad 6630a90ee1 Switch DeleteTable impl to one based on FixedBitSet (#2183) 2025-01-29 17:15:17 +00:00
Noa 293aebaef9 Bump to Rust 1.84 (#2001) 2025-01-28 23:11:29 +00:00
Mazdak Farrokhzad 5b5a0a6515 Cache whether a Table is a scheduler table, avoiding fetching the schema (#2141) 2025-01-28 19:57:15 +00:00