From 27b5c1a6d9390a19c8ca1ef84f1d3ff7d9f39719 Mon Sep 17 00:00:00 2001 From: "kistz (Kilian Strunz)" Date: Sat, 10 Jan 2026 12:58:04 +0100 Subject: [PATCH 1/2] impl FilterableValue for Uuid --- crates/lib/src/filterable_value.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/crates/lib/src/filterable_value.rs b/crates/lib/src/filterable_value.rs index d0039823d09..6b23035b914 100644 --- a/crates/lib/src/filterable_value.rs +++ b/crates/lib/src/filterable_value.rs @@ -1,4 +1,4 @@ -use crate::{ConnectionId, Identity}; +use crate::{ConnectionId, Identity, Uuid}; use core::ops; use spacetimedb_sats::bsatn; use spacetimedb_sats::{hash::Hash, i256, u256, Serialize}; @@ -15,6 +15,7 @@ use spacetimedb_sats::{hash::Hash, i256, u256, Serialize}; /// - [`bool`]. /// - [`String`], which is also filterable with `&str`. /// - [`Identity`]. +/// - [`Uuid`]. /// - [`ConnectionId`]. /// - [`Hash`](struct@Hash). /// - No-payload enums annotated with `#[derive(SpacetimeType)]`. @@ -37,8 +38,8 @@ use spacetimedb_sats::{hash::Hash, i256, u256, Serialize}; // E.g. `&str: FilterableValue` is desirable. #[diagnostic::on_unimplemented( message = "`{Self}` cannot appear as an argument to an index filtering operation", - label = "should be an integer type, `bool`, `String`, `&str`, `Identity`, `ConnectionId`, `Hash` or a no-payload enum which derives `SpacetimeType`, not `{Self}`", - note = "The allowed set of types are limited to integers, bool, strings, `Identity`, `ConnectionId`, `Hash` and no-payload enums which derive `SpacetimeType`," + label = "should be an integer type, `bool`, `String`, `&str`, `Identity` , `Uuid`, `ConnectionId`, `Hash` or a no-payload enum which derives `SpacetimeType`, not `{Self}`", + note = "The allowed set of types are limited to integers, bool, strings, `Identity`, `Uuid`, `ConnectionId`, `Hash` and no-payload enums which derive `SpacetimeType`," )] pub trait FilterableValue: Serialize + Private { type Column; @@ -94,6 +95,7 @@ impl_filterable_value! { &str => String, Identity: Copy, + Uuid: Copy, ConnectionId: Copy, Hash: Copy, From 839ea3c23adbdd673a2bcab02c40051dba647cea Mon Sep 17 00:00:00 2001 From: "kistz (Kilian Strunz)" Date: Thu, 22 Jan 2026 19:49:05 +0100 Subject: [PATCH 2/2] update ui test to the new version including `Uuid` --- crates/bindings/tests/ui/tables.stderr | 4 ++-- crates/lib/src/filterable_value.rs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/crates/bindings/tests/ui/tables.stderr b/crates/bindings/tests/ui/tables.stderr index 7696526d4b0..66866879e35 100644 --- a/crates/bindings/tests/ui/tables.stderr +++ b/crates/bindings/tests/ui/tables.stderr @@ -121,10 +121,10 @@ error[E0277]: `&'a Alpha` cannot appear as an argument to an index filtering ope --> tests/ui/tables.rs:32:33 | 32 | ctx.db.delta().compound_a().find(Alpha { beta: 0 }); - | ^^^^ should be an integer type, `bool`, `String`, `&str`, `Identity`, `ConnectionId`, `Hash` or a no-payload enum which derives `SpacetimeType`, not `&'a Alpha` + | ^^^^ should be an integer type, `bool`, `String`, `&str`, `Identity`, `Uuid`, `ConnectionId`, `Hash` or a no-payload enum which derives `SpacetimeType`, not `&'a Alpha` | = help: the trait `for<'a> FilterableValue` is not implemented for `&'a Alpha` - = note: The allowed set of types are limited to integers, bool, strings, `Identity`, `ConnectionId`, `Hash` and no-payload enums which derive `SpacetimeType`, + = note: The allowed set of types are limited to integers, bool, strings, `Identity`, `Uuid`, `ConnectionId`, `Hash` and no-payload enums which derive `SpacetimeType`, = help: the following other types implement trait `FilterableValue`: &ConnectionId &Identity diff --git a/crates/lib/src/filterable_value.rs b/crates/lib/src/filterable_value.rs index 6b23035b914..74b4bef4cc0 100644 --- a/crates/lib/src/filterable_value.rs +++ b/crates/lib/src/filterable_value.rs @@ -38,7 +38,7 @@ use spacetimedb_sats::{hash::Hash, i256, u256, Serialize}; // E.g. `&str: FilterableValue` is desirable. #[diagnostic::on_unimplemented( message = "`{Self}` cannot appear as an argument to an index filtering operation", - label = "should be an integer type, `bool`, `String`, `&str`, `Identity` , `Uuid`, `ConnectionId`, `Hash` or a no-payload enum which derives `SpacetimeType`, not `{Self}`", + label = "should be an integer type, `bool`, `String`, `&str`, `Identity`, `Uuid`, `ConnectionId`, `Hash` or a no-payload enum which derives `SpacetimeType`, not `{Self}`", note = "The allowed set of types are limited to integers, bool, strings, `Identity`, `Uuid`, `ConnectionId`, `Hash` and no-payload enums which derive `SpacetimeType`," )] pub trait FilterableValue: Serialize + Private {