Commit Graph

104 Commits

Author SHA1 Message Date
Noa f6bc6dcfe5 Switch Rust codegen to use new ModuleDef (#1675) 2024-09-17 18:32:35 +00:00
joshua-spacetime f047bb14f7 feat: sql type checking and logical plan (#1708) 2024-09-17 15:41:19 +00:00
james gilles f3e3d924f7 Add schema::type_for_generate, update validation to use it (#1661)
Signed-off-by: james gilles <jameshgilles@gmail.com>
Co-authored-by: Ingvar Stepanyan <me@rreverser.com>
2024-09-11 15:38:56 -04:00
Ingvar Stepanyan 607f7ce6b8 Auto-generate C# ModuleDef bindings from Rust (#1680) 2024-09-09 18:22:17 +00:00
james gilles 2be42156b2 Allow converting new ModuleDef to old TableSchema (#1630) 2024-08-29 18:17:29 +00:00
james gilles 98faf7d4e1 Add backwards-compatible validation for RawModuleDefV8. (#1606) 2024-08-29 10:10:53 +00:00
james gilles 6e6bee2a9c ABI v9 validation code (#1572)
Signed-off-by: james gilles <jameshgilles@gmail.com>
2024-08-27 20:02:26 +00:00
james gilles 747eb71830 Make ScheduleAt special + Typespace::is_valid_for_client_code_generation (#1590) 2024-08-22 17:05:04 +00:00
Mazdak Farrokhzad 3be5c83d99 [WASM ABI 1.0] __call_reducer__ receives Identity & Address by value (#1607)
Signed-off-by: Mazdak Farrokhzad <twingoow@gmail.com>
Co-authored-by: Ingvar Stepanyan <me@rreverser.com>
Co-authored-by: Noa <coolreader18@gmail.com>
2024-08-19 22:20:57 +00:00
Mazdak Farrokhzad 1ca9b1a933 [WASM ABI 1.0] Change ColId from u32 to u16 (#1597) 2024-08-19 17:56:28 +00:00
Mazdak Farrokhzad 6a08674ccb Allow empty ColList (#1588) 2024-08-15 16:08:51 +00:00
james gilles 1b48555a42 Add lib::db::{column_ordering, raw_def::v9} (#1542)
Signed-off-by: james gilles <jameshgilles@gmail.com>
Co-authored-by: Mazdak Farrokhzad <twingoow@gmail.com>
2024-08-07 19:13:18 +00:00
james gilles afddf01dd5 ABI BREAK: Add versioning for RawModuleDef (#1518) 2024-07-25 17:24:47 +00:00
james gilles 45b2ceee9a Move schemas to schema crate, rename Def to RawDefV8 (#1498) 2024-07-24 17:38:30 +00:00
Phoebe Goldman 1d26575d87 ST sequences: respect allocated amount on restart (#1532)
Co-authored-by: Kim Altintop <kim@eagain.io>
2024-07-24 14:43:07 +00:00
james gilles f81f2a7492 Move db module from spacetimedb_sats to spacetimedb_lib (#1479) 2024-07-17 20:59:44 +00:00
Shubham Mishra 276387d2b3 Timer Table Implementation (#1449)
Co-authored-by: Ingvar Stepanyan <me@rreverser.com>
2024-07-16 08:38:56 +00:00
Noa 10b151b999 Protobufectomy: server (#1077)
Co-authored-by: Phoebe Goldman <phoebe@goldman-tribe.org>
Co-authored-by: Jeremie Pelletier <jeremiep@gmail.com>
2024-07-12 18:02:18 +00:00
Mazdak Farrokhzad 220ff471d3 Remove unused file table.rs (#1417) 2024-06-13 12:27:21 +00:00
Mario Montoya 114aa994bf Fix output of binary, Identity, Address for SQL output and the 'Display' of them to show a full hex value (#1087) 2024-06-10 16:49:46 +00:00
Noa a54399495d Prune bindings deps (#1290) 2024-06-07 20:36:33 +00:00
Mazdak Farrokhzad c8225db8f5 1. Reduce visibilities, preparing to extract datastore crate (#1306)
2. More direct imports, preparing to extract datastore crate
3. Remove some dead code
2024-05-28 17:46:07 +00:00
Noa 471f4ff2ca recv-style abi (#1002)
* Bump module abi version

* recv abi module side

* recv abi host side

* Update csharp module sdk

* Fix name

* Address comments
2024-05-22 23:01:44 +00:00
Noa 0c7530ffc6 Disallow calling random lifecycle reducers (#1114)
* Disallow calling random lifecycle reducers

* Add lifecycle reducer smoketest
2024-04-29 19:11:05 +00:00
Mazdak Farrokhzad 5e78223ae7 nuke DataKey (#1093) 2024-04-16 06:49:14 +00:00
Mazdak Farrokhzad d6815ebf9c Shrink AV and AT to 24 & 16 bytes respectively, and also friends. (#1047) 2024-04-13 16:51:18 +00:00
Mario Montoya 29970d219a Implement 'sql' parsing for 'Identity, Address' in hex format (#786) 2024-04-11 17:31:08 +00:00
Noa abdaf88563 Move lib::{name,recovery} to client-api-messages (#570) 2024-04-10 20:24:05 +00:00
joshua-spacetime 5203b01fa6 refactor(1058): Remove feature flag for disabling metrics (#1059)
Closes #1058.
2024-04-09 20:25:32 +00:00
Noa 7d3bdc308b Prune deps from bindings dependency tree (#1014) 2024-04-03 01:54:36 +00:00
Mazdak Farrokhzad 9141a42622 Bump Rust to 1.77 + fix warnings + use Bound::map (#1020)
* bump Rust to 1.77 + fix warnings + use Bound::map

* use .truncate(true) for OpenOptions
2024-03-25 20:27:08 +00:00
Shubham Mishra 71d435d096 proto changes (#924)
* proto changes

* messageId -> requestId

* fix oneoffquery

* add metrics for subscription

* requestId for reducer

* timer for reducer

* revert oneOffQeury related changes

* request_id u32 -> bytes

* use default RequestId for rust sdk

* added json changes

* added test

* clippy
2024-03-06 16:13:52 +00:00
joshua-spacetime 313f592db9 perf(747): Single query execution for multiple subscriptions (#917)
Closes #747.

Before this change,
we would evaluate each and every query,
for each and every subscription,
on each and every row update.

If N subscriptions had a query Q in common,
it would be evaluated N different times.

With this change,
distinct queries are evaluated once,
and the results copied for each client.

So in the example above, Q would be evaluated once,
with the results transmitted to N different clients.
2024-03-05 16:52:24 +00:00
joshua-spacetime b19de57522 perf(831): Remove row_pk computation from query (#908)
* perf(831): Remove row_pk computation from query

Closes #831.

* perf(831): remove Op, use identical TableOp.

perf(831): remove unnecesary .into_iter().map_into().collect()

perf(831): cleanup evaluators and make them lazier

* nix PrimaryKey & UniqueValue

* add TableOp::{insert, delete}

---------

Co-authored-by: Mazdak Farrokhzad <twingoow@gmail.com>
2024-02-29 17:04:04 +00:00
John Detter 79fd5ad75e Fix publish issues 0.8.2 (#853)
* Fix some issues related to publishing 0.8.2

* Added phoebe's fix

* Reverting file

---------

Co-authored-by: John Detter <no-reply@boppygames.gg>
2024-02-15 23:29:37 +00:00
Noa 92e5a62ae1 Reduce allocations for prometheus with_label_values (#810) 2024-02-14 20:17:05 +00:00
Noa 37658aae7e Add rust-version to Cargo.toml (#802)
* Add rust-version to Cargo.toml

* Use workspace inheritance to make bumping the spacetime version easier
2024-02-07 20:02:05 +00:00
Mazdak Farrokhzad 80d9372b48 SATS: add support needed for BFLATN => BSATN directly (#750)
* sats: add support needed for bflatn -> bsatn directly

Also some associated refactoring

* integrate phoebe's suggestions

Co-authored-by: Phoebe Goldman <phoebe@clockworklabs.io>
Signed-off-by: Mazdak Farrokhzad <twingoow@gmail.com>

* bflatn -> bsatn: add 'debug_assert's

---------

Signed-off-by: Mazdak Farrokhzad <twingoow@gmail.com>
Co-authored-by: Phoebe Goldman <phoebe@clockworklabs.io>
2024-01-24 16:53:47 +00:00
John Detter 8524d244f3 Version upgrade to 0.8.1 (#729)
Co-authored-by: John Detter <no-reply@boppygames.gg>
2024-01-18 18:16:58 +00:00
joshua-spacetime b0e80c6697 chore: Move table size metrics back into core (#719)
* chore: Remove unused metrics

* chore: Move table size metrics back into core

Table size metrics were previously moved out of core.
This was due to the query planner needing access to them.
However that dependency was ultimately managed differently via #677.
2024-01-12 22:07:00 +00:00
joshua-spacetime eed3be2ad2 fix(683): Label table metrics with table name (#712)
Fixes #683.

Previously we were labeling metrics with the table id only.
However the table name is almost always desired for diagnostics.
2024-01-11 01:21:49 +00:00
joshua-spacetime 09b2d0f033 refactor(metrics): Move table size metric into lib (#636)
Query optimization will soon need this metric.
Therefore it must be moved out of core and into lib.
Eventually we might want to move all metrics into lib.
2023-12-08 14:20:56 -08:00
joshua-spacetime c265ed195f refactor(metrics): Move metric builder macros into their own crate 2023-12-05 10:26:41 -08:00
John Detter 79ff6dffc6 Version upgrade to 0.8.0 (#622)
Co-authored-by: John Detter <no-reply@boppygames.gg>
2023-12-04 13:19:25 -06:00
Mario Montoya 4ef1bd5296 Refactoring bootstrapping and adding full support for constraints & multi-column indexes (#596)
* Refactoring bootstrapping and adding full support for constraints & multi-column indexes

* Removed deleted code and add some comments

* Add comment for Constraints

* Update crates/core/src/db/datastore/locking_tx_datastore/mod.rs

Co-authored-by: Mazdak Farrokhzad <twingoow@gmail.com>
Signed-off-by: Mario Montoya <mamcx@elmalabarista.com>

* Update crates/core/src/db/datastore/locking_tx_datastore/mod.rs

Co-authored-by: Mazdak Farrokhzad <twingoow@gmail.com>
Signed-off-by: Mario Montoya <mamcx@elmalabarista.com>

* Addressing some PR comments & remove cloning

* Adding details for when fail to decode rows in replay

* Apply Kim's fix for replay bug

* Addressing some PR comments

* Merge

* Fix conflicts

* Fix conflicts

* Fix test

* Fix generation of code for csharp & typescript, now it generate FilterBy for all columns

* Fix for index generation

* Fixing C# index generation

* Merge

* Fix compilation on csharp bindings

---------

Signed-off-by: Mario Montoya <mamcx@elmalabarista.com>
Co-authored-by: Mazdak Farrokhzad <twingoow@gmail.com>
Co-authored-by: John Detter <no-reply@boppygames.gg>
2023-12-04 12:04:38 -05:00
Mario Montoya 4d49b14ee6 Format binary data as hex in sql/satn (#521)
* Format binary data as hex in sql/satn

* Add json test for identity

* Addressing some PR comments

* Fix test

---------

Signed-off-by: Mario Montoya <mamcx@elmalabarista.com>
2023-11-29 13:01:55 -05:00
Noa 5a2b37b401 Update to rust 1.74 (#589)
* Update to rust 1.74

* Fix 1.74 clippy lints
2023-11-21 21:04:31 +00:00
Mario Montoya b3ccc13dab Refactoring IDs for system objects (#439)
* Refactoring IDs for system objects

* fixup

* Fix stray constraints text on refactor

* Fix conflict

* Merge

---------

Co-authored-by: Mazdak Farrokhzad <twingoow@gmail.com>
2023-11-15 10:21:20 -05:00
Tyler Cloutier e5d3f422cf Fixes client API breaks introduced by #460 (#558)
* Fixes client API breaks introduced by #460

* lints
2023-11-14 11:06:45 +01:00
Mario Montoya f12a238237 Moving object defs to SATS (#460)
* Moving object defs to SATS

* move ColumnIndexAttribute to primitives, nix path attr

* revert unnecessary reformating

* ProductValue: don't take ColId
ProductValues can be more than rows and can be nested

* simplify sats::db::def wrt. Constraints + impl ser/de

* cargo fmt

---------

Co-authored-by: Mazdak Farrokhzad <twingoow@gmail.com>
2023-11-13 12:21:56 +00:00