mirror of
https://github.com/clockworklabs/SpacetimeDB.git
synced 2026-05-06 07:26:43 -04:00
6eaf06b6b5
# Description of Changes Query builder views return a subset of rows from a physical table. If that table has a primary key, then so should the view. What this means concretely is that the view should expose the same api as the table, specifically as it relates to the primary key column. With that in mind, this patch commits the following changes: 1. Annotates `ViewDef` with a `primary_key` 2. Updates the return type of query builder views in the raw module def to a special product type 3. Adds an index for the primary key on the view's backing table 4. Updates the query planner to use this index 5. Updates rust client codegen to generate `on_update` for such views # API and ABI breaking changes None Old `impl Query` views compiled with an older version of SpacetimeDB will continue to work as they did before - without a primary key. # Expected complexity level and risk 3 # Testing - [x] New rust sdk integration suite exercising `on_update` for PK views and semijoin scenarios - [x] Smoketests for PK views and semijoin scenarios
402 lines
13 KiB
TOML
402 lines
13 KiB
TOML
[workspace]
|
|
exclude = ["crates/smoketests/modules"]
|
|
members = [
|
|
"crates/auth",
|
|
"crates/bench",
|
|
"crates/bindings-sys",
|
|
"crates/bindings",
|
|
"crates/bindings-macro",
|
|
"crates/cli",
|
|
"crates/client-api",
|
|
"crates/client-api-messages",
|
|
"crates/commitlog",
|
|
"crates/core",
|
|
"crates/data-structures",
|
|
"crates/datastore",
|
|
"crates/durability",
|
|
"crates/execution",
|
|
"crates/expr",
|
|
"crates/guard",
|
|
"crates/fs-utils",
|
|
"crates/lib",
|
|
"crates/metrics",
|
|
"crates/paths",
|
|
"crates/pg",
|
|
"crates/physical-plan",
|
|
"crates/primitives",
|
|
"crates/query",
|
|
"crates/sats",
|
|
"crates/schema",
|
|
"crates/smoketests",
|
|
"sdks/rust",
|
|
"sdks/unreal",
|
|
"crates/snapshot",
|
|
"crates/sqltest",
|
|
"crates/sql-parser",
|
|
"crates/standalone",
|
|
"crates/subscription",
|
|
"crates/table",
|
|
"crates/testing",
|
|
"crates/update",
|
|
"crates/vm",
|
|
"modules/benchmarks",
|
|
"modules/keynote-benchmarks",
|
|
"modules/perf-test",
|
|
"modules/module-test",
|
|
"templates/basic-rs/spacetimedb",
|
|
"templates/chat-console-rs/spacetimedb",
|
|
"templates/keynote-2/spacetimedb-rust-client",
|
|
"modules/sdk-test",
|
|
"modules/sdk-test-connect-disconnect",
|
|
"modules/sdk-test-procedure",
|
|
"modules/sdk-test-view",
|
|
"modules/sdk-test-view-pk",
|
|
"modules/sdk-test-event-table",
|
|
"sdks/rust/tests/test-client",
|
|
"sdks/rust/tests/test-counter",
|
|
"sdks/rust/tests/connect_disconnect_client",
|
|
"sdks/rust/tests/procedure-client",
|
|
"sdks/rust/tests/view-client",
|
|
"sdks/rust/tests/view-pk-client",
|
|
"sdks/rust/tests/event-table-client",
|
|
"tools/ci",
|
|
"tools/upgrade-version",
|
|
"tools/license-check",
|
|
"tools/replace-spacetimedb",
|
|
"tools/generate-client-api",
|
|
"tools/gen-bindings",
|
|
"tools/xtask-llm-benchmark",
|
|
"crates/bindings-typescript/test-app/server",
|
|
"crates/bindings-typescript/test-react-router-app/server",
|
|
"crates/query-builder",
|
|
]
|
|
default-members = ["crates/cli", "crates/standalone", "crates/update"]
|
|
# cargo feature graph resolver. v3 is default in edition2024 but workspace
|
|
# manifests don't have editions.
|
|
resolver = "3"
|
|
|
|
[profile.release]
|
|
opt-level = 3
|
|
debug-assertions = false
|
|
overflow-checks = false
|
|
lto = "thin"
|
|
panic = 'unwind'
|
|
incremental = false
|
|
codegen-units = 16
|
|
rpath = false
|
|
|
|
[profile.dev]
|
|
opt-level = 0
|
|
debug = true
|
|
debug-assertions = true
|
|
overflow-checks = true
|
|
lto = false
|
|
panic = 'unwind'
|
|
incremental = true
|
|
codegen-units = 256
|
|
rpath = false
|
|
|
|
[profile.bench]
|
|
debug = true
|
|
|
|
[profile.test]
|
|
opt-level = 1
|
|
debug = true
|
|
|
|
[profile.profiling]
|
|
inherits = "release"
|
|
debug = true
|
|
|
|
[workspace.package]
|
|
version = "2.0.4"
|
|
edition = "2024"
|
|
# update rust-toolchain.toml too!
|
|
rust-version = "1.93.0"
|
|
|
|
[workspace.dependencies]
|
|
spacetimedb = { path = "crates/bindings", version = "=2.0.4" }
|
|
spacetimedb-auth = { path = "crates/auth", version = "=2.0.4" }
|
|
spacetimedb-bindings-macro = { path = "crates/bindings-macro", version = "=2.0.4" }
|
|
spacetimedb-bindings-sys = { path = "crates/bindings-sys", version = "=2.0.4" }
|
|
spacetimedb-cli = { path = "crates/cli", version = "=2.0.4" }
|
|
spacetimedb-client-api = { path = "crates/client-api", version = "=2.0.4" }
|
|
spacetimedb-client-api-messages = { path = "crates/client-api-messages", version = "=2.0.4" }
|
|
spacetimedb-codegen = { path = "crates/codegen", version = "=2.0.4" }
|
|
spacetimedb-commitlog = { path = "crates/commitlog", version = "=2.0.4" }
|
|
spacetimedb-core = { path = "crates/core", version = "=2.0.4" }
|
|
spacetimedb-data-structures = { path = "crates/data-structures", version = "=2.0.4" }
|
|
spacetimedb-datastore = { path = "crates/datastore", version = "=2.0.4" }
|
|
spacetimedb-durability = { path = "crates/durability", version = "=2.0.4" }
|
|
spacetimedb-execution = { path = "crates/execution", version = "=2.0.4" }
|
|
spacetimedb-expr = { path = "crates/expr", version = "=2.0.4" }
|
|
spacetimedb-guard = { path = "crates/guard", version = "=2.0.4" }
|
|
spacetimedb-lib = { path = "crates/lib", default-features = false, version = "=2.0.4" }
|
|
spacetimedb-memory-usage = { path = "crates/memory-usage", version = "=2.0.4", default-features = false }
|
|
spacetimedb-metrics = { path = "crates/metrics", version = "=2.0.4" }
|
|
spacetimedb-paths = { path = "crates/paths", version = "=2.0.4" }
|
|
spacetimedb-pg = { path = "crates/pg", version = "=2.0.4" }
|
|
spacetimedb-physical-plan = { path = "crates/physical-plan", version = "=2.0.4" }
|
|
spacetimedb-primitives = { path = "crates/primitives", version = "=2.0.4" }
|
|
spacetimedb-query = { path = "crates/query", version = "=2.0.4" }
|
|
spacetimedb-sats = { path = "crates/sats", version = "=2.0.4" }
|
|
spacetimedb-schema = { path = "crates/schema", version = "=2.0.4" }
|
|
spacetimedb-standalone = { path = "crates/standalone", version = "=2.0.4" }
|
|
spacetimedb-sql-parser = { path = "crates/sql-parser", version = "=2.0.4" }
|
|
spacetimedb-table = { path = "crates/table", version = "=2.0.4" }
|
|
spacetimedb-vm = { path = "crates/vm", version = "=2.0.4" }
|
|
spacetimedb-fs-utils = { path = "crates/fs-utils", version = "=2.0.4" }
|
|
spacetimedb-snapshot = { path = "crates/snapshot", version = "=2.0.4" }
|
|
spacetimedb-subscription = { path = "crates/subscription", version = "=2.0.4" }
|
|
spacetimedb-query-builder = { path = "crates/query-builder", version = "=2.0.4" }
|
|
|
|
# Prevent `ahash` from pulling in `getrandom` by disabling default features.
|
|
# Modules use `getrandom02` and we need to prevent an incompatible version
|
|
# from appearing in module dependency graphs.
|
|
ahash = { version = "0.8", default-features = false, features = ["std"] }
|
|
anyhow = "1.0.68"
|
|
anymap = "0.12"
|
|
arrayvec = "0.7.2"
|
|
async-stream = "0.3.6"
|
|
async-trait = "0.1.68"
|
|
axum = { version = "0.7", features = ["tracing"] }
|
|
axum-extra = { version = "0.9", features = ["typed-header"] }
|
|
backtrace = "0.3.66"
|
|
base64 = "0.21.2"
|
|
bigdecimal = "0.4.7"
|
|
bitflags = "2.3.3"
|
|
blake3 = "1.5.1"
|
|
brotli = "3.5"
|
|
byte-unit = "4.0.18"
|
|
bytemuck = { version = "1.16.2", features = ["must_cast"] }
|
|
bytes = "1.10.1"
|
|
bytestring = { version = "1.2.0", features = ["serde"] }
|
|
cargo_metadata = "0.17.0"
|
|
chrono = { version = "0.4.24", default-features = false }
|
|
clap = { version = "4.2.4", features = ["derive", "wrap_help"] }
|
|
clap-markdown = "0.1.4"
|
|
colored = "2.0.0"
|
|
console = { version = "0.15.6" }
|
|
convert_case = "0.6.0"
|
|
crc32c = "0.6.4"
|
|
criterion = { version = "0.5.1", features = ["async", "async_tokio", "html_reports"] }
|
|
crossbeam-channel = "0.5"
|
|
crossbeam-queue = "0.3.12"
|
|
cursive = { version = "0.20", default-features = false, features = ["crossterm-backend"] }
|
|
decorum = { version = "0.3.1", default-features = false, features = ["std"] }
|
|
derive_more = "0.99"
|
|
dialoguer = { version = "0.11", default-features = false }
|
|
dirs = "5.0.1"
|
|
duct = "0.13.5"
|
|
either = "1.9"
|
|
email_address = "0.2.4"
|
|
enum-as-inner = "0.6"
|
|
enum-map = "2.6.3"
|
|
env_logger = "0.10"
|
|
ethnum = { version = "1.5.0", features = ["serde"] }
|
|
flate2 = "1.0.24"
|
|
flume = { version = "0.11", default-features = false, features = ["async"] }
|
|
foldhash = "0.2.0"
|
|
fs-err = "2.9.0"
|
|
fs_extra = "1.3.0"
|
|
fs2 = "0.4.3"
|
|
futures = "0.3"
|
|
futures-channel = "0.3"
|
|
futures-util = "0.3"
|
|
getrandom02 = { package = "getrandom", version = "0.2" }
|
|
git2 = "0.19"
|
|
glob = "0.3.1"
|
|
hashbrown = { version = "0.16.1", default-features = false, features = ["equivalent", "inline-more", "rayon", "serde"] }
|
|
headers = "0.4"
|
|
heck = "0.4"
|
|
hex = "0.4.3"
|
|
home = "0.5"
|
|
hostname = "^0.3"
|
|
http = "1.0"
|
|
http-body-util= "0.1.3"
|
|
humantime = "2.3"
|
|
hyper = "1.0"
|
|
hyper-util = { version = "0.1", features = ["tokio"] }
|
|
ignore = "0.4"
|
|
imara-diff = "0.1.3"
|
|
indexmap = "2.0.0"
|
|
indicatif = "0.17"
|
|
insta = { version = "1.21.0", features = ["toml", "filters"] }
|
|
is-terminal = "0.4"
|
|
itertools = "0.12"
|
|
itoa = "1"
|
|
json5 = "0.4"
|
|
jsonwebtoken = { package = "spacetimedb-jsonwebtoken", version = "9.3.0" }
|
|
junction = "1"
|
|
jwks = { package = "spacetimedb-jwks", version = "0.1.3" }
|
|
lazy_static = "1.4.0"
|
|
lean_string = "0.5.1"
|
|
log = "0.4.17"
|
|
memchr = "2"
|
|
mimalloc = "0.1.39"
|
|
names = "0.14"
|
|
netstat2 = "0.11"
|
|
nohash-hasher = "0.2"
|
|
notify = "7.0"
|
|
nix = "0.30"
|
|
once_cell = "1.16"
|
|
parking_lot = { version = "0.12.1", features = ["send_guard", "arc_lock"] }
|
|
parse-size = "1.1.0"
|
|
paste = "1.0"
|
|
percent-encoding = "2.3"
|
|
petgraph = { version = "0.6.5", default-features = false }
|
|
pin-project-lite = "0.2.9"
|
|
pgwire = { version = "0.34.2", default-features = false, features = ["server-api", "pg-ext-types"] }
|
|
postgres-types = "0.2.5"
|
|
pretty_assertions = { version = "1.4", features = ["unstable"] }
|
|
proc-macro2 = "1.0"
|
|
prometheus = "0.13.0"
|
|
proptest = "1.4"
|
|
proptest-derive = "0.5"
|
|
quick-junit = { version = "0.3.2" }
|
|
quick-xml = "0.31"
|
|
quote = "1.0.8"
|
|
rand08 = { package = "rand", version = "0.8" }
|
|
rand = "0.9"
|
|
rand_distr = "0.5.1"
|
|
rayon = "1.8"
|
|
rayon-core = "1.11.0"
|
|
regex = "1"
|
|
reqwest = { version = "0.12", features = ["stream", "json"] }
|
|
rolldown = { git = "https://github.com/rolldown/rolldown.git", tag = "v1.0.0-rc.3" }
|
|
rolldown_common = { git = "https://github.com/rolldown/rolldown.git", tag = "v1.0.0-rc.3" }
|
|
rolldown_error = { git = "https://github.com/rolldown/rolldown.git", tag = "v1.0.0-rc.3" }
|
|
rolldown_utils = { git = "https://github.com/rolldown/rolldown.git", tag = "v1.0.0-rc.3" }
|
|
ron = "0.8"
|
|
rusqlite = { version = "0.29.0", features = ["bundled", "column_decltype"] }
|
|
rust_decimal = { version = "1.29.1", features = ["db-tokio-postgres"] }
|
|
rustc-demangle = "0.1.21"
|
|
rustc-hash = "2"
|
|
rustyline = { version = "12.0.0", features = [] }
|
|
scoped-tls = "1.0.1"
|
|
scopeguard = "1.1.0"
|
|
second-stack = "0.3"
|
|
self-replace = "1.5"
|
|
semver = "1"
|
|
serde = { version = "1.0.136", features = ["derive"] }
|
|
serde_json = { version = "1.0.128", features = ["raw_value", "arbitrary_precision"] }
|
|
serde_path_to_error = "0.1.9"
|
|
serde_with = { version = "3.3.0", features = ["base64", "hex"] }
|
|
serial_test = "2.0.0"
|
|
sha1 = "0.10.1"
|
|
sha3 = "0.10.0"
|
|
similar = "2.3"
|
|
slab = "0.4.7"
|
|
sled = "0.34.7"
|
|
smallvec = { version = "1.11", features = ["union", "const_generics"] }
|
|
socket2 = "0.5"
|
|
sourcemap = "9.3.1"
|
|
sqllogictest = "0.17"
|
|
sqllogictest-engines = "0.17"
|
|
sqlparser = "0.38.0"
|
|
strum = { version = "0.25.0", features = ["derive"] }
|
|
syn = { version = "2", features = ["full", "extra-traits"] }
|
|
syntect = { version = "5.0.0", default-features = false, features = ["default-fancy"] }
|
|
tabled = "0.14.0"
|
|
tar = "0.4"
|
|
tempdir = "0.3.7"
|
|
tempfile = "3.20"
|
|
termcolor = "1.2.0"
|
|
termtree = "0.5.1"
|
|
thin-vec = "0.2.13"
|
|
thiserror = "1.0.37"
|
|
tokio = { version = "1.37", features = ["full"] }
|
|
tokio_metrics = { version = "0.4.0" }
|
|
tokio-postgres = { version = "0.7.8", features = ["with-chrono-0_4"] }
|
|
tokio-stream = "0.1.17"
|
|
tokio-tungstenite = { version = "0.27.0", features = ["native-tls", "url"] }
|
|
tokio-util = { version = "0.7.4", features = ["time"] }
|
|
toml = "0.8"
|
|
toml_edit = "0.22.22"
|
|
tower-http = { version = "0.5", features = ["cors"] }
|
|
tower-layer = "0.3"
|
|
tower-service = "0.3"
|
|
tracing = "0.1.37"
|
|
tracing-appender = "0.2.2"
|
|
tracing-core = "0.1.31"
|
|
tracing-flame = "0.2.0"
|
|
tracing-log = "0.1.3"
|
|
tracing-subscriber = { version = "0.3.17", features = ["env-filter"] }
|
|
trybuild = "1"
|
|
typed-arena = "2.0"
|
|
unicode-ident = "1.0.12"
|
|
unicode-normalization = "0.1.23"
|
|
url = "2.3.1"
|
|
urlencoding = "2.1.2"
|
|
uuid = { version = "1.18.1", default-features = false }
|
|
|
|
# Pinned to a specific version rather than allowing SemVer fuzzy resolution
|
|
# because our flake references the specific version of this library.
|
|
# See librusty_v8.nix for more details.
|
|
# When updating the V8 crate, either update the version and hashes in that file,
|
|
# or ping phoebe @gefjon to do so.
|
|
v8 = "=145.0.0"
|
|
# This version is kept in sync with the version of ICU required by v8.
|
|
# When that changes, the `v8::icu::set_common_data_XX()` function is renamed.
|
|
deno_core_icudata = "0.77"
|
|
|
|
walkdir = "2.2.5"
|
|
wasmbin = "0.6"
|
|
webbrowser = "1.0.2"
|
|
windows-sys = "0.59"
|
|
xdg = "2.5"
|
|
xmltree = "0.11"
|
|
tikv-jemallocator = { version = "0.6.0", features = ["profiling", "stats"] }
|
|
tikv-jemalloc-ctl = { version = "0.6.0", features = ["stats"] }
|
|
jemalloc_pprof = { version = "0.8", features = ["symbolize", "flamegraph"] }
|
|
zstd-framed = { version = "0.1.1", features = ["tokio"] }
|
|
|
|
# Vendor the openssl we rely on, rather than depend on a
|
|
# potentially very old system version.
|
|
openssl = { version = "0.10", features = ["vendored"] }
|
|
|
|
[workspace.dependencies.wasmtime]
|
|
version = "39"
|
|
default-features = false
|
|
features = [
|
|
"addr2line",
|
|
"async",
|
|
"cache",
|
|
"cranelift",
|
|
"demangle",
|
|
"parallel-compilation",
|
|
"runtime",
|
|
"std",
|
|
]
|
|
|
|
[workspace.dependencies.wasmtime-internal-fiber]
|
|
version = "39"
|
|
default-features = false
|
|
features = ["std"]
|
|
|
|
[workspace.dependencies.tracing-tracy]
|
|
version = "0.10.4"
|
|
# We use the "ondemand" feature to allow connecting after the start,
|
|
# and reconnecting, from the tracy client to the database.
|
|
# TODO(George): Need to be able to remove "broadcast" in some build configurations.
|
|
features = [
|
|
"enable",
|
|
"system-tracing",
|
|
"context-switch-tracing",
|
|
"sampling",
|
|
"code-transfer",
|
|
"broadcast",
|
|
"ondemand",
|
|
]
|
|
|
|
[workspace.lints.rust]
|
|
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(tokio_unstable)'] }
|
|
|
|
[workspace.lints.clippy]
|
|
# FIXME: we should work on this lint incrementally
|
|
result_large_err = "allow"
|
|
|
|
[workspace.metadata]
|
|
# This silences a warning in our Nix flake, which otherwise would be upset that our call to `crateNameFromCargoToml`
|
|
# is running against a file that doesn't have a name in it.
|
|
crane.name = "spacetimedb"
|