Skip to content
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
84 changes: 63 additions & 21 deletions Cargo.lock

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

6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
authors = ["Tamaro Skaljic<mail@tamaro-skaljic.de>"]
name = "spacetimedsl"
version = "0.12.0"
version = "0.13.0"
edition = "2024"
description = "Ergonomic DSL for SpacetimeDB"
documentation = "https://docs.rs/spacetimedsl"
Expand All @@ -14,10 +14,10 @@ readme = "README.md"

[dependencies]
# https://crates.io/crates/spacetimedb Easy support for interacting between SpacetimeDB and Rust.
spacetimedb = "1.6.0"
spacetimedb = "1.9.0"

# https://crates.io/crates/spacetimedsl_derive Macros to extend SpacetimeDSL
spacetimedsl_derive = { version = "0.12.0", path = "derive" }
spacetimedsl_derive = { version = "0.13.0", path = "derive" }

# https://crates.io/crates/itertools Extra iterator adaptors, iterator methods, free functions, and macros.
itertools = "^0.14"
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1779,6 +1779,7 @@ spacetimedsl = { version = "*" }
**Not Yet Considered:**

- [Using IndexScanRangeBounds / FilterableValue](https://github.com/tamaro-skaljic/SpacetimeDSL/issues/21) 🔄
- SpacetimeDSL is not available in `#[spacetimedb::view]` functions, because SpacetimeDB uses structs instead of traits for Contexts - We are not really able to generate code which use `ReducerContext`, `ViewContext` and `AnonymousViewContext` at the same time, so we would need to generate each read-only DSL method 3 times. 🔄

## ❓ FAQ

Expand Down
4 changes: 2 additions & 2 deletions derive-input/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
authors = ["Tamaro Skaljic<mail@tamaro-skaljic.de>"]
name = "spacetimedsl_derive-input"
version = "0.12.0"
version = "0.13.0"
edition = "2024"
description = "Contains structs which represent the input and output of SpacetimeDSL. Can be used by other proc-macro crates to build Macros which utilize SpacetimeDSL under the hood."
documentation = "https://docs.rs/spacetimedsl_derive-input"
Expand All @@ -28,7 +28,7 @@ quote = "1"
itertools = "0.14.0"

# https://crates.io/crates/spacetimedb Easy support for interacting between SpacetimeDB and Rust.
spacetimedb = "1.6.0"
spacetimedb = "1.9.0"

# https://crates.io/crates/spacetime-bindings-macro-input Unofficial Input Crate for the SpacetimeDB Macro Bindings.
spacetime-bindings-macro-input = "1.6.0"
Expand Down
4 changes: 2 additions & 2 deletions derive/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
authors = ["Tamaro Skaljic<mail@tamaro-skaljic.de>"]
name = "spacetimedsl_derive"
version = "0.12.0"
version = "0.13.0"
edition = "2024"
description = "Macros to extend SpacetimeDSL. You shouldn't depend on this directly and instead use the spacetimedsl crate."
documentation = "https://docs.rs/spacetimedsl_derive"
Expand Down Expand Up @@ -31,4 +31,4 @@ quote = "1"
rust-format = { version = "0.3.4", features = [ "pretty_please", "token_stream" ]}

# https://crates.io/crates/spacetimedsl_derive-input Contains structs which represent the output of SpacetimeDSL. Can be used by other proc-macro crates to build Macros which utilize SpacetimeDSL under the hood.
spacetimedsl_derive-input = { version = "0.12.0", path = "../derive-input" }
spacetimedsl_derive-input = { version = "0.13.0", path = "../derive-input" }
6 changes: 3 additions & 3 deletions examples/blackholio/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "spacetimedsl_blackholio"
version = "0.12.0"
version = "0.13.0"
edition = "2024"
publish = false

Expand All @@ -9,10 +9,10 @@ crate-type = ["cdylib"]

[dependencies]
# https://crates.io/crates/spacetimedb Easy support for interacting between SpacetimeDB and Rust.
spacetimedb = "1.6.0"
spacetimedb = "1.9.0"

# https://crates.io/crates/spacetimedsl Ergonomic DSL for SpacetimeDB
spacetimedsl = { version = "0.12.0", path = "../.." }
spacetimedsl = { version = "0.13.0", path = "../.." }

# https://crates.io/crates/log A lightweight logging facade for Rust
log = "0.4"
6 changes: 3 additions & 3 deletions examples/test/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "spacetimedsl_test"
version = "0.12.0"
version = "0.13.0"
edition = "2024"
publish = false

Expand All @@ -12,7 +12,7 @@ crate-type = ["cdylib"]
proc-macro2 = { version = "1", features = ["span-locations"] }

# https://crates.io/crates/spacetimedb Easy support for interacting between SpacetimeDB and Rust.
spacetimedb = "1.6.0"
spacetimedb = "1.9.0"

# https://crates.io/crates/syn Parser for Rust source code
syn = { default-features = false, features = [
Expand All @@ -22,7 +22,7 @@ syn = { default-features = false, features = [
], version = "2" }

# https://crates.io/crates/spacetimedsl Ergonomic DSL for SpacetimeDB
spacetimedsl = { version = "0.12.0", path = "../.." }
spacetimedsl = { version = "0.13.0", path = "../.." }

# https://crates.io/crates/log A lightweight logging facade for Rust
log = "0.4"
13 changes: 12 additions & 1 deletion examples/test/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
pub mod entity {
use spacetimedb::Timestamp;
use spacetimedb::{AnonymousViewContext, Timestamp, ViewContext, view};

/// A Entity is a unique machine-readable identifier - it contains no data other than that and has no behavior.
#[spacetimedsl::dsl(
Expand Down Expand Up @@ -31,6 +31,17 @@ pub mod entity {
modified_at: Option<Timestamp>,
}

#[view(name = my_view, public)]
pub fn my_view(ctx: &ViewContext) -> Option<Entity> {
ctx.db.entity().obj_id().find(0)
}

#[view(name = my_anonymous_view, public)]
pub fn my_anonymous_view(ctx: &AnonymousViewContext) -> Vec<Entity> {
ctx.db.entity().obj_id().find(0);
vec![]
}

#[spacetimedsl::dsl(
plural_name = tables,
method(update = true),
Expand Down
Loading