Skip to content

Extract spacetimedb-memory-usage & Nix bindings dep on spacetimedb-data-structures #2919

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 4, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 17 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ spacetimedb-durability = { path = "crates/durability", version = "1.2.0" }
spacetimedb-execution = { path = "crates/execution", version = "1.2.0" }
spacetimedb-expr = { path = "crates/expr", version = "1.2.0" }
spacetimedb-lib = { path = "crates/lib", default-features = false, version = "1.2.0" }
spacetimedb-memory-usage = { path = "crates/memory-usage", version = "1.2.0", default-features = false }
spacetimedb-metrics = { path = "crates/metrics", version = "1.2.0" }
spacetimedb-paths = { path = "crates/paths", version = "1.2.0" }
spacetimedb-physical-plan = { path = "crates/physical-plan", version = "1.2.0" }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
source: crates/bindings/tests/deps.rs
expression: "cargo tree -p spacetimedb -f {lib} -e no-dev"
---
total crates: 66
total crates: 61
spacetimedb
├── bytemuck
├── derive_more
Expand Down Expand Up @@ -69,22 +69,6 @@ spacetimedb
│ ├── hex
│ ├── itertools (*)
│ ├── spacetimedb_bindings_macro (*)
│ ├── spacetimedb_data_structures
│ │ ├── ahash
│ │ │ ├── cfg_if
│ │ │ ├── once_cell
│ │ │ └── zerocopy
│ │ │ [build-dependencies]
│ │ │ └── version_check
│ │ ├── hashbrown
│ │ │ └── equivalent
│ │ ├── nohash_hasher
│ │ ├── smallvec
│ │ └── thiserror
│ │ └── thiserror_impl
│ │ ├── proc_macro2 (*)
│ │ ├── quote (*)
│ │ └── syn (*)
│ ├── spacetimedb_primitives (*)
│ ├── spacetimedb_sats
│ │ ├── anyhow
Expand Down Expand Up @@ -117,8 +101,11 @@ spacetimedb
│ │ │ └── keccak
│ │ ├── smallvec
│ │ ├── spacetimedb_bindings_macro (*)
│ │ ├── spacetimedb_data_structures (*)
│ │ ├── spacetimedb_primitives (*)
│ │ └── thiserror (*)
│ │ └── thiserror
│ │ └── thiserror_impl
│ │ ├── proc_macro2 (*)
│ │ ├── quote (*)
│ │ └── syn (*)
│ └── thiserror (*)
└── spacetimedb_primitives (*)
2 changes: 1 addition & 1 deletion crates/bindings/tests/ui/reducers.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,12 @@ error[E0277]: the reducer argument `Test` does not implement `SpacetimeType`
= help: the following other types implement trait `SpacetimeType`:
&T
()
AlgebraicType
AlgebraicTypeRef
Arc<T>
ArrayType
Box<T>
ColId
ColumnAttribute
and $N others
= note: required for `Test` to implement `ReducerArg`

Expand Down
14 changes: 7 additions & 7 deletions crates/bindings/tests/ui/tables.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ error[E0277]: the column type `Test` does not implement `SpacetimeType`
= help: the following other types implement trait `SpacetimeType`:
&T
()
AlgebraicType
AlgebraicTypeRef
Alpha
Arc<T>
ArrayType
Box<T>
ColId
and $N others
= note: required for `Test` to implement `TableColumn`

Expand All @@ -40,12 +40,12 @@ error[E0277]: the trait bound `Test: SpacetimeType` is not satisfied
= help: the following other types implement trait `SpacetimeType`:
&T
()
AlgebraicType
AlgebraicTypeRef
Alpha
Arc<T>
ArrayType
Box<T>
ColId
and $N others

error[E0277]: the trait bound `Test: Deserialize<'de>` is not satisfied
Expand All @@ -61,11 +61,11 @@ error[E0277]: the trait bound `Test: Deserialize<'de>` is not satisfied
&'de [u8]
&'de str
()
AlgebraicType
AlgebraicTypeRef
Alpha
Arc<[T]>
ArrayType
Box<T>
and $N others
note: required by a bound in `spacetimedb::spacetimedb_lib::de::SeqProductAccess::next_element`
--> $WORKSPACE/crates/sats/src/de.rs
Expand All @@ -83,11 +83,11 @@ error[E0277]: the trait bound `Test: Deserialize<'_>` is not satisfied
&'de [u8]
&'de str
()
AlgebraicType
AlgebraicTypeRef
Alpha
Arc<[T]>
ArrayType
Box<T>
and $N others
note: required by a bound in `get_field_value`
--> $WORKSPACE/crates/sats/src/de.rs
Expand All @@ -104,12 +104,12 @@ error[E0277]: the trait bound `Test: Serialize` is not satisfied
= help: the following other types implement trait `Serialize`:
&T
()
AlgebraicType
AlgebraicTypeRef
AlgebraicValue
Alpha
Arc<T>
ArrayType
ArrayValue
Bound<T>
and $N others
note: required by a bound in `spacetimedb::spacetimedb_lib::ser::SerializeNamedProduct::serialize_element`
--> $WORKSPACE/crates/sats/src/ser.rs
Expand All @@ -135,7 +135,7 @@ error[E0277]: `&'a Alpha` cannot appear as an argument to an index filtering ope
&bool
&ethnum::int::I256
and $N others
note: required by a bound in `UniqueColumn::<Tbl, <Col as spacetimedb::table::Column>::ColType, Col>::find`
note: required by a bound in `UniqueColumn::<Tbl, <Col as Column>::ColType, Col>::find`
--> src/table.rs
|
| pub fn find(&self, col_val: impl Borrow<Col::ColType>) -> Option<Tbl::Row>
Expand Down
1 change: 1 addition & 0 deletions crates/core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ spacetimedb-lib = { workspace = true, features = ["serde", "metrics_impls"] }
spacetimedb-client-api-messages.workspace = true
spacetimedb-commitlog.workspace = true
spacetimedb-durability.workspace = true
spacetimedb-memory-usage.workspace = true
spacetimedb-metrics.workspace = true
spacetimedb-primitives.workspace = true
spacetimedb-paths.workspace = true
Expand Down
12 changes: 4 additions & 8 deletions crates/core/src/db/datastore/error.rs
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
use super::system_tables::SystemTable;
use enum_as_inner::EnumAsInner;
use spacetimedb_lib::buffer::DecodeError;
use spacetimedb_lib::{
db::{
error::LibError,
raw_def::{v9::RawSql, RawIndexDefV8},
},
AlgebraicType, AlgebraicValue, ProductValue,
};
use spacetimedb_lib::db::raw_def::{v9::RawSql, RawIndexDefV8};
use spacetimedb_primitives::{ColId, ColList, IndexId, SequenceId, TableId};
use spacetimedb_sats::buffer::DecodeError;
use spacetimedb_sats::{product_value::InvalidFieldError, satn::Satn};
use spacetimedb_sats::{AlgebraicType, AlgebraicValue, ProductValue};
use spacetimedb_schema::def::error::LibError;
use spacetimedb_snapshot::SnapshotError;
use spacetimedb_table::{
bflatn_to, read_column,
Expand Down
4 changes: 2 additions & 2 deletions crates/core/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ use thiserror::Error;
use crate::client::ClientActorId;
use crate::host::scheduler::ScheduleError;
use spacetimedb_lib::buffer::DecodeError;
use spacetimedb_lib::db::error::{LibError, RelationError, SchemaErrors};
use spacetimedb_lib::relation::FieldName;
use spacetimedb_primitives::*;
use spacetimedb_sats::hash::Hash;
use spacetimedb_sats::product_value::InvalidFieldError;
use spacetimedb_schema::def::error::{LibError, RelationError, SchemaErrors};
use spacetimedb_schema::relation::FieldName;
use spacetimedb_vm::errors::{ErrorKind, ErrorLang, ErrorType, ErrorVm};
use spacetimedb_vm::expr::Crud;

Expand Down
4 changes: 2 additions & 2 deletions crates/core/src/sql/ast.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ use spacetimedb_data_structures::map::{HashCollectionExt as _, IntMap};
use spacetimedb_expr::check::SchemaView;
use spacetimedb_expr::statement::compile_sql_stmt;
use spacetimedb_lib::db::auth::StAccess;
use spacetimedb_lib::db::error::RelationError;
use spacetimedb_lib::identity::AuthCtx;
use spacetimedb_lib::relation::{ColExpr, FieldName};
use spacetimedb_primitives::{ColId, TableId};
use spacetimedb_sats::{AlgebraicType, AlgebraicValue};
use spacetimedb_schema::def::error::RelationError;
use spacetimedb_schema::relation::{ColExpr, FieldName};
use spacetimedb_schema::schema::{ColumnSchema, TableSchema};
use spacetimedb_vm::errors::ErrorVm;
use spacetimedb_vm::expr::{Expr, FieldExpr, FieldOp};
Expand Down
2 changes: 1 addition & 1 deletion crates/core/src/sql/compiler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ use crate::error::{DBError, PlanError};
use core::ops::Deref;
use spacetimedb_data_structures::map::IntMap;
use spacetimedb_lib::identity::AuthCtx;
use spacetimedb_lib::relation::{self, ColExpr, DbTable, FieldName, Header};
use spacetimedb_primitives::ColId;
use spacetimedb_schema::relation::{self, ColExpr, DbTable, FieldName, Header};
use spacetimedb_schema::schema::TableSchema;
use spacetimedb_vm::expr::{CrudExpr, Expr, FieldExpr, QueryExpr, SourceExpr};
use spacetimedb_vm::operator::OpCmp;
Expand Down
4 changes: 2 additions & 2 deletions crates/core/src/sql/execute.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ use anyhow::anyhow;
use spacetimedb_expr::statement::Statement;
use spacetimedb_lib::identity::AuthCtx;
use spacetimedb_lib::metrics::ExecutionMetrics;
use spacetimedb_lib::relation::FieldName;
use spacetimedb_lib::Timestamp;
use spacetimedb_lib::{AlgebraicType, ProductType, ProductValue};
use spacetimedb_query::{compile_sql_stmt, execute_dml_stmt, execute_select_stmt};
use spacetimedb_schema::relation::FieldName;
use spacetimedb_vm::eval::run_ast;
use spacetimedb_vm::expr::{CodeResult, CrudExpr, Expr};
use spacetimedb_vm::relation::MemTable;
Expand Down Expand Up @@ -320,10 +320,10 @@ pub(crate) mod tests {
use spacetimedb_lib::bsatn::ToBsatn;
use spacetimedb_lib::db::auth::{StAccess, StTableType};
use spacetimedb_lib::error::{ResultTest, TestError};
use spacetimedb_lib::relation::Header;
use spacetimedb_lib::{AlgebraicValue, Identity};
use spacetimedb_primitives::{col_list, ColId, TableId};
use spacetimedb_sats::{product, AlgebraicType, ArrayValue, ProductType};
use spacetimedb_schema::relation::Header;
use spacetimedb_vm::eval::test_helpers::create_game_data;

pub(crate) fn execute_for_testing(
Expand Down
2 changes: 1 addition & 1 deletion crates/core/src/sql/type_check.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ use crate::error::PlanError;
use crate::sql::ast::From;
use crate::sql::ast::{Selection, SqlAst};
use spacetimedb_lib::operator::OpQuery;
use spacetimedb_lib::relation::FieldName;
use spacetimedb_sats::algebraic_type::fmt::fmt_algebraic_type;
use spacetimedb_sats::{AlgebraicType, AlgebraicValue};
use spacetimedb_schema::relation::FieldName;
use spacetimedb_schema::schema::ColumnSchema;
use spacetimedb_vm::errors::ErrorType;
use spacetimedb_vm::expr::{FieldExpr, FieldOp};
Expand Down
8 changes: 4 additions & 4 deletions crates/core/src/subscription/execution_unit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ use crate::vm::{build_query, TxMode};
use spacetimedb_client_api_messages::websocket::{
Compression, QueryUpdate, RowListLen as _, SingleQueryUpdate, WebsocketFormat,
};
use spacetimedb_lib::db::error::AuthError;
use spacetimedb_lib::relation::DbTable;
use spacetimedb_lib::{Identity, ProductValue};
use spacetimedb_lib::Identity;
use spacetimedb_primitives::TableId;
use spacetimedb_sats::u256;
use spacetimedb_sats::{u256, ProductValue};
use spacetimedb_schema::def::error::AuthError;
use spacetimedb_schema::relation::DbTable;
use spacetimedb_vm::eval::IterRows;
use spacetimedb_vm::expr::{AuthAccess, NoInMemUsed, Query, QueryExpr, SourceExpr, SourceId};
use spacetimedb_vm::rel_ops::RelOps;
Expand Down
2 changes: 1 addition & 1 deletion crates/core/src/subscription/query.rs
Original file line number Diff line number Diff line change
Expand Up @@ -166,10 +166,10 @@ mod tests {
use spacetimedb_lib::error::ResultTest;
use spacetimedb_lib::identity::AuthCtx;
use spacetimedb_lib::metrics::ExecutionMetrics;
use spacetimedb_lib::relation::FieldName;
use spacetimedb_lib::Identity;
use spacetimedb_primitives::{ColId, TableId};
use spacetimedb_sats::{product, AlgebraicType, ProductType, ProductValue};
use spacetimedb_schema::relation::FieldName;
use spacetimedb_schema::schema::*;
use spacetimedb_vm::eval::run_ast;
use spacetimedb_vm::eval::test_helpers::{mem_table, mem_table_without_table_name, scalar};
Expand Down
9 changes: 5 additions & 4 deletions crates/core/src/subscription/subscription.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,12 @@ use itertools::Either;
use spacetimedb_client_api_messages::websocket::{Compression, WebsocketFormat};
use spacetimedb_data_structures::map::HashSet;
use spacetimedb_lib::db::auth::{StAccess, StTableType};
use spacetimedb_lib::db::error::AuthError;
use spacetimedb_lib::identity::AuthCtx;
use spacetimedb_lib::relation::DbTable;
use spacetimedb_lib::{Identity, ProductValue};
use spacetimedb_lib::Identity;
use spacetimedb_primitives::TableId;
use spacetimedb_sats::ProductValue;
use spacetimedb_schema::def::error::AuthError;
use spacetimedb_schema::relation::DbTable;
use spacetimedb_subscription::SubscriptionPlan;
use spacetimedb_vm::expr::{self, AuthAccess, IndexJoin, Query, QueryExpr, SourceExpr, SourceProvider, SourceSet};
use spacetimedb_vm::rel_ops::RelOps;
Expand Down Expand Up @@ -664,9 +665,9 @@ mod tests {
use super::*;
use crate::db::relational_db::tests_utils::{begin_tx, TestDB};
use crate::sql::compiler::compile_sql;
use spacetimedb_lib::relation::DbTable;
use spacetimedb_lib::{error::ResultTest, identity::AuthCtx};
use spacetimedb_sats::{product, AlgebraicType};
use spacetimedb_schema::relation::DbTable;
use spacetimedb_vm::expr::{CrudExpr, IndexJoin, Query, SourceExpr};

#[test]
Expand Down
4 changes: 2 additions & 2 deletions crates/core/src/vm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ use core::ops::{Bound, RangeBounds};
use itertools::Itertools;
use spacetimedb_data_structures::map::IntMap;
use spacetimedb_lib::identity::AuthCtx;
use spacetimedb_lib::relation::{ColExpr, DbTable};
use spacetimedb_primitives::*;
use spacetimedb_sats::{AlgebraicValue, ProductValue};
use spacetimedb_schema::relation::{ColExpr, DbTable};
use spacetimedb_table::static_assert_size;
use spacetimedb_table::table::RowRef;
use spacetimedb_vm::errors::ErrorVm;
Expand Down Expand Up @@ -652,9 +652,9 @@ pub(crate) mod tests {
use pretty_assertions::assert_eq;
use spacetimedb_lib::db::auth::{StAccess, StTableType};
use spacetimedb_lib::error::ResultTest;
use spacetimedb_lib::relation::{FieldName, Header};
use spacetimedb_sats::{product, AlgebraicType, ProductType, ProductValue};
use spacetimedb_schema::def::{BTreeAlgorithm, IndexAlgorithm};
use spacetimedb_schema::relation::{FieldName, Header};
use spacetimedb_schema::schema::{ColumnSchema, IndexSchema, TableSchema};
use spacetimedb_vm::eval::run_ast;
use spacetimedb_vm::eval::test_helpers::{mem_table, mem_table_one_u64, scalar};
Expand Down
Loading
Loading