diff --git a/crates/bindings-csharp/Codegen.Tests/fixtures/diag/snapshots/Module#FFI.verified.cs b/crates/bindings-csharp/Codegen.Tests/fixtures/diag/snapshots/Module#FFI.verified.cs index 9064e3f7b3c..af8b40f3f07 100644 --- a/crates/bindings-csharp/Codegen.Tests/fixtures/diag/snapshots/Module#FFI.verified.cs +++ b/crates/bindings-csharp/Codegen.Tests/fixtures/diag/snapshots/Module#FFI.verified.cs @@ -1,4 +1,4 @@ -//HintName: FFI.cs +//HintName: FFI.cs // #nullable enable // The runtime already defines SpacetimeDB.Internal.LocalReadOnly in Runtime\Internal\Module.cs as an empty partial type. @@ -17,7 +17,6 @@ namespace SpacetimeDB { public sealed record ReducerContext : DbContext, Internal.IReducerContext { - public readonly Identity Sender; public readonly ConnectionId? ConnectionId; public readonly Random Rng; public readonly Timestamp Timestamp; @@ -29,6 +28,8 @@ public sealed record ReducerContext : DbContext, Internal.IReducerContext // We need this property to be non-static for parity with client SDK. public Identity Identity => Internal.IReducerContext.GetIdentity(); + private readonly Identity _sender; + internal ReducerContext( Identity identity, ConnectionId? connectionId, @@ -37,7 +38,7 @@ internal ReducerContext( AuthCtx? senderAuth = null ) { - Sender = identity; + _sender = identity; ConnectionId = connectionId; Rng = random; Timestamp = time; @@ -45,6 +46,11 @@ internal ReducerContext( CounterUuid = 0; } + /// + /// The identity of the client that invoked the reducer. + /// + public Identity Sender() => _sender; + /// /// Create a new random `v4` using the built-in RNG. /// @@ -209,13 +215,18 @@ public sealed class Local : global::SpacetimeDB.LocalBase public sealed record ViewContext : DbContext, Internal.IViewContext { - public Identity Sender { get; } + private readonly Identity _sender; internal ViewContext(Identity sender, Internal.LocalReadOnly db) : base(db) { - Sender = sender; + _sender = sender; } + + /// + /// The identity of the client that invoked the view. + /// + public Identity Sender() => _sender; } public sealed record AnonymousViewContext diff --git a/crates/bindings-csharp/Codegen.Tests/fixtures/server/snapshots/Module#FFI.verified.cs b/crates/bindings-csharp/Codegen.Tests/fixtures/server/snapshots/Module#FFI.verified.cs index 11c5b86ea18..24b27497250 100644 --- a/crates/bindings-csharp/Codegen.Tests/fixtures/server/snapshots/Module#FFI.verified.cs +++ b/crates/bindings-csharp/Codegen.Tests/fixtures/server/snapshots/Module#FFI.verified.cs @@ -1,4 +1,4 @@ -//HintName: FFI.cs +//HintName: FFI.cs // #nullable enable // The runtime already defines SpacetimeDB.Internal.LocalReadOnly in Runtime\Internal\Module.cs as an empty partial type. @@ -17,7 +17,6 @@ namespace SpacetimeDB { public sealed record ReducerContext : DbContext, Internal.IReducerContext { - public readonly Identity Sender; public readonly ConnectionId? ConnectionId; public readonly Random Rng; public readonly Timestamp Timestamp; @@ -29,6 +28,8 @@ public sealed record ReducerContext : DbContext, Internal.IReducerContext // We need this property to be non-static for parity with client SDK. public Identity Identity => Internal.IReducerContext.GetIdentity(); + private readonly Identity _sender; + internal ReducerContext( Identity identity, ConnectionId? connectionId, @@ -37,7 +38,7 @@ internal ReducerContext( AuthCtx? senderAuth = null ) { - Sender = identity; + _sender = identity; ConnectionId = connectionId; Rng = random; Timestamp = time; @@ -45,6 +46,11 @@ internal ReducerContext( CounterUuid = 0; } + /// + /// The identity of the client that invoked the reducer. + /// + public Identity Sender() => _sender; + /// /// Create a new random `v4` using the built-in RNG. /// @@ -199,13 +205,18 @@ public sealed class Local : global::SpacetimeDB.LocalBase public sealed record ViewContext : DbContext, Internal.IViewContext { - public Identity Sender { get; } + private readonly Identity _sender; internal ViewContext(Identity sender, Internal.LocalReadOnly db) : base(db) { - Sender = sender; + _sender = sender; } + + /// + /// The identity of the client that invoked the view. + /// + public Identity Sender() => _sender; } public sealed record AnonymousViewContext diff --git a/crates/bindings-csharp/Codegen/Module.cs b/crates/bindings-csharp/Codegen/Module.cs index 93c44cf0c26..d38f6e31bc5 100644 --- a/crates/bindings-csharp/Codegen/Module.cs +++ b/crates/bindings-csharp/Codegen/Module.cs @@ -1743,7 +1743,6 @@ public void Initialize(IncrementalGeneratorInitializationContext context) namespace SpacetimeDB { public sealed record ReducerContext : DbContext, Internal.IReducerContext { - public readonly Identity Sender; public readonly ConnectionId? ConnectionId; public readonly Random Rng; public readonly Timestamp Timestamp; @@ -1753,16 +1752,24 @@ public sealed record ReducerContext : DbContext, Internal.IReducerContext // We need this property to be non-static for parity with client SDK. public Identity Identity => Internal.IReducerContext.GetIdentity(); + private readonly Identity _sender; + internal ReducerContext(Identity identity, ConnectionId? connectionId, Random random, Timestamp time, AuthCtx? senderAuth = null) { - Sender = identity; + _sender = identity; ConnectionId = connectionId; Rng = random; Timestamp = time; SenderAuth = senderAuth ?? AuthCtx.BuildFromSystemTables(connectionId, identity); CounterUuid = 0; } + + /// + /// The identity of the client that invoked the reducer. + /// + public Identity Sender() => _sender; + /// /// Create a new random `v4` using the built-in RNG. /// @@ -1897,13 +1904,18 @@ public sealed class Local : global::SpacetimeDB.LocalBase { public sealed record ViewContext : DbContext, Internal.IViewContext { - public Identity Sender { get; } + private readonly Identity _sender; internal ViewContext(Identity sender, Internal.LocalReadOnly db) : base(db) { - Sender = sender; + _sender = sender; } + + /// + /// The identity of the client that invoked the view. + /// + public Identity Sender() => _sender; } public sealed record AnonymousViewContext : DbContext, Internal.IAnonymousViewContext diff --git a/crates/bindings-csharp/Runtime/Internal/TxContext.cs b/crates/bindings-csharp/Runtime/Internal/TxContext.cs index d5bea2febd9..f8465e78d56 100644 --- a/crates/bindings-csharp/Runtime/Internal/TxContext.cs +++ b/crates/bindings-csharp/Runtime/Internal/TxContext.cs @@ -9,13 +9,16 @@ public sealed class TxContext( Random rng ) { + private readonly Identity _sender = sender; + public Local Db { get; } = db; - public Identity Sender { get; } = sender; public ConnectionId? ConnectionId { get; } = connectionId; public Timestamp Timestamp { get; } = timestamp; public AuthCtx SenderAuth { get; } = senderAuth; public Random Rng { get; } = rng; + public Identity Sender() => _sender; + public TxContext WithTimestamp(Timestamp ts) => - new(Db, Sender, ConnectionId, ts, SenderAuth, Rng); + new(Db, _sender, ConnectionId, ts, SenderAuth, Rng); } diff --git a/crates/bindings-csharp/Runtime/ProcedureContext.cs b/crates/bindings-csharp/Runtime/ProcedureContext.cs index 4eb8583b7d5..1b878b8e549 100644 --- a/crates/bindings-csharp/Runtime/ProcedureContext.cs +++ b/crates/bindings-csharp/Runtime/ProcedureContext.cs @@ -10,8 +10,11 @@ public abstract class ProcedureContextBase( Timestamp time ) : Internal.IInternalProcedureContext { + private readonly Identity _sender = sender; + + public Identity Sender() => _sender; + public static Identity Identity => Internal.IProcedureContext.GetIdentity(); - public Identity Sender { get; } = sender; public ConnectionId? ConnectionId { get; } = connectionId; public Random Rng { get; } = random; public Timestamp Timestamp { get; private set; } = time; @@ -47,7 +50,7 @@ public Internal.TxContext EnterTxContext(long timestampMicros) txContext?.WithTimestamp(timestamp) ?? new Internal.TxContext( CreateLocal(), - Sender, + _sender, ConnectionId, timestamp, SenderAuth, @@ -229,8 +232,9 @@ public abstract class ProcedureTxContextBase(Internal.TxContext inner) internal void Refresh(Internal.TxContext inner) => Inner = inner; + public Identity Sender() => Inner.Sender(); + public LocalBase Db => (LocalBase)Inner.Db; - public Identity Sender => Inner.Sender; public ConnectionId? ConnectionId => Inner.ConnectionId; public Timestamp Timestamp => Inner.Timestamp; public AuthCtx SenderAuth => Inner.SenderAuth; diff --git a/crates/cli/src/subcommands/generate.rs b/crates/cli/src/subcommands/generate.rs index 4e6fb5ec124..2cd26885dc0 100644 --- a/crates/cli/src/subcommands/generate.rs +++ b/crates/cli/src/subcommands/generate.rs @@ -5,7 +5,9 @@ use clap::parser::ValueSource; use clap::Arg; use clap::ArgAction::Set; use fs_err as fs; -use spacetimedb_codegen::{generate, Csharp, Lang, OutputFile, Rust, TypeScript, UnrealCpp, AUTO_GENERATED_PREFIX}; +use spacetimedb_codegen::{ + generate, private_table_names, Csharp, Lang, OutputFile, Rust, TypeScript, UnrealCpp, AUTO_GENERATED_PREFIX, +}; use spacetimedb_lib::de::serde::DeserializeWrapper; use spacetimedb_lib::{sats, RawModuleDef}; use spacetimedb_schema; @@ -171,6 +173,12 @@ pub async fn exec_ex( extract_descriptions(&path).context("could not extract schema")? }; + // TODO: Update this to work with --include-private once that flag exists. + let private_tables = private_table_names(&module); + if !private_tables.is_empty() { + println!("Skipping private tables during codegen: {}.", private_tables.join(", ")); + } + fs::create_dir_all(out_dir)?; let mut paths = BTreeSet::new(); diff --git a/crates/codegen/src/csharp.rs b/crates/codegen/src/csharp.rs index f004d8e8a3d..0be88f55ba3 100644 --- a/crates/codegen/src/csharp.rs +++ b/crates/codegen/src/csharp.rs @@ -9,7 +9,7 @@ use super::code_indenter::CodeIndenter; use super::Lang; use crate::util::{ collect_case, is_reducer_invokable, iter_indexes, iter_reducers, iter_table_names_and_types, - print_auto_generated_file_comment, print_auto_generated_version_comment, type_ref_name, + print_auto_generated_file_comment, print_auto_generated_version_comment, type_ref_name, CodegenVisibility, }; use crate::{indent_scope, OutputFile}; use convert_case::{Case, Casing}; @@ -1048,7 +1048,7 @@ impl Lang for Csharp<'_> { indented_block(&mut output, |output| { writeln!(output, "public RemoteTables(DbConnection conn)"); indented_block(output, |output| { - for (table_name, _) in iter_table_names_and_types(module) { + for (table_name, _) in iter_table_names_and_types(module, CodegenVisibility::OnlyPublic) { writeln!( output, "AddTable({} = new(conn));", @@ -1071,7 +1071,7 @@ impl Lang for Csharp<'_> { writeln!(output, "public sealed class From"); indented_block(&mut output, |output| { - for (table_name, product_type_ref) in iter_table_names_and_types(module) { + for (table_name, product_type_ref) in iter_table_names_and_types(module, CodegenVisibility::OnlyPublic) { let method_name = table_name.deref().to_case(Case::Pascal); let row_type = type_ref_name(module, product_type_ref); let table_name_lit = format!("{:?}", table_name.deref()); diff --git a/crates/codegen/src/lib.rs b/crates/codegen/src/lib.rs index 461c2cfc1d4..60bb6b0408c 100644 --- a/crates/codegen/src/lib.rs +++ b/crates/codegen/src/lib.rs @@ -12,11 +12,12 @@ pub use self::csharp::Csharp; pub use self::rust::Rust; pub use self::typescript::TypeScript; pub use self::unrealcpp::UnrealCpp; +pub use util::private_table_names; pub use util::AUTO_GENERATED_PREFIX; pub fn generate(module: &ModuleDef, lang: &dyn Lang) -> Vec { itertools::chain!( - module.tables().map(|tbl| lang.generate_table_file(module, tbl)), + util::iter_tables(module, util::CodegenVisibility::OnlyPublic).map(|tbl| lang.generate_table_file(module, tbl)), module.views().map(|view| lang.generate_view_file(module, view)), module.types().flat_map(|typ| lang.generate_type_files(module, typ)), util::iter_reducers(module).map(|reducer| lang.generate_reducer_file(module, reducer)), diff --git a/crates/codegen/src/rust.rs b/crates/codegen/src/rust.rs index 47c8097aa37..a831cd0d7dd 100644 --- a/crates/codegen/src/rust.rs +++ b/crates/codegen/src/rust.rs @@ -3,7 +3,7 @@ use super::util::{collect_case, iter_reducers, print_lines, type_ref_name}; use super::Lang; use crate::util::{ iter_indexes, iter_procedures, iter_table_names_and_types, iter_tables, iter_types, iter_unique_cols, iter_views, - print_auto_generated_file_comment, print_auto_generated_version_comment, + print_auto_generated_file_comment, print_auto_generated_version_comment, CodegenVisibility, }; use crate::OutputFile; use convert_case::{Case, Casing}; @@ -1131,7 +1131,7 @@ fn iter_module_names(module: &ModuleDef) -> impl Iterator + '_ { itertools::chain!( iter_types(module).map(|ty| type_module_name(&ty.name)), iter_reducers(module).map(|r| reducer_module_name(&r.name)), - iter_tables(module).map(|tbl| table_module_name(&tbl.name)), + iter_tables(module, CodegenVisibility::OnlyPublic).map(|tbl| table_module_name(&tbl.name)), iter_views(module).map(|view| table_module_name(&view.name)), iter_procedures(module).map(|proc| procedure_module_name(&proc.name)), ) @@ -1151,7 +1151,7 @@ fn print_module_reexports(module: &ModuleDef, out: &mut Indenter) { let type_name = collect_case(Case::Pascal, ty.name.name_segments()); writeln!(out, "pub use {mod_name}::{type_name};") } - for (table_name, _) in iter_table_names_and_types(module) { + for (table_name, _) in iter_table_names_and_types(module, CodegenVisibility::OnlyPublic) { let mod_name = table_module_name(table_name); // TODO: More precise reexport: we want: // - The trait name. @@ -1310,7 +1310,7 @@ fn print_db_update_defn(module: &ModuleDef, out: &mut Indenter) { out.delimited_block( "pub struct DbUpdate {", |out| { - for (table_name, product_type_ref) in iter_table_names_and_types(module) { + for (table_name, product_type_ref) in iter_table_names_and_types(module, CodegenVisibility::OnlyPublic) { writeln!( out, "{}: __sdk::TableUpdate<{}>,", @@ -1334,7 +1334,7 @@ impl TryFrom<__ws::DatabaseUpdate<__ws::BsatnFormat>> for DbUpdate { match &table_update.table_name[..] { ", |out| { - for (table_name, _) in iter_table_names_and_types(module) { + for (table_name, _) in iter_table_names_and_types(module, CodegenVisibility::OnlyPublic) { writeln!( out, "{:?} => db_update.{}.append({}::parse_table_update(table_update)?),", @@ -1378,7 +1378,7 @@ impl __sdk::InModule for DbUpdate {{ let mut diff = AppliedDiff::default(); ", |out| { - for table in iter_tables(module) { + for table in iter_tables(module, CodegenVisibility::OnlyPublic) { let with_updates = table .primary_key .map(|col| { @@ -1421,7 +1421,7 @@ fn print_applied_diff_defn(module: &ModuleDef, out: &mut Indenter) { out.delimited_block( "pub struct AppliedDiff<'r> {", |out| { - for (table_name, product_type_ref) in iter_table_names_and_types(module) { + for (table_name, product_type_ref) in iter_table_names_and_types(module, CodegenVisibility::OnlyPublic) { writeln!( out, "{}: __sdk::TableAppliedDiff<'r, {}>,", @@ -1454,7 +1454,7 @@ impl __sdk::InModule for AppliedDiff<'_> {{ out.delimited_block( "fn invoke_row_callbacks(&self, event: &EventContext, callbacks: &mut __sdk::DbCallbacks) {", |out| { - for (table_name, product_type_ref) in iter_table_names_and_types(module) { + for (table_name, product_type_ref) in iter_table_names_and_types(module, CodegenVisibility::OnlyPublic) { writeln!( out, "callbacks.invoke_table_row_callbacks::<{}>({:?}, &self.{}, event);", @@ -1497,7 +1497,7 @@ type QueryBuilder = __sdk::QueryBuilder; out.delimited_block( "fn register_tables(client_cache: &mut __sdk::ClientCache) {", |out| { - for (table_name, _) in iter_table_names_and_types(module) { + for (table_name, _) in iter_table_names_and_types(module, CodegenVisibility::OnlyPublic) { writeln!(out, "{}::register_table(client_cache);", table_module_name(table_name)); } }, diff --git a/crates/codegen/src/typescript.rs b/crates/codegen/src/typescript.rs index e153d756996..1fe1900c3a3 100644 --- a/crates/codegen/src/typescript.rs +++ b/crates/codegen/src/typescript.rs @@ -1,6 +1,6 @@ use crate::util::{ is_reducer_invokable, iter_constraints, iter_indexes, iter_procedures, iter_reducers, iter_table_names_and_types, - iter_tables, iter_types, iter_views, print_auto_generated_version_comment, + iter_tables, iter_types, iter_views, print_auto_generated_version_comment, CodegenVisibility, }; use crate::OutputFile; @@ -231,7 +231,7 @@ impl Lang for TypeScript { writeln!(out); writeln!(out, "// Import and reexport all table handle types"); - for (table_name, _) in iter_table_names_and_types(module) { + for (table_name, _) in iter_table_names_and_types(module, CodegenVisibility::OnlyPublic) { let table_module_name = table_module_name(table_name); let table_name_pascalcase = table_name.deref().to_case(Case::Pascal); // TODO: This really shouldn't be necessary. We could also have `table()` accept @@ -253,7 +253,7 @@ impl Lang for TypeScript { writeln!(out, "/** The schema information for all tables in this module. This is defined the same was as the tables would have been defined in the server. */"); writeln!(out, "const tablesSchema = __schema("); out.indent(1); - for table in iter_tables(module) { + for table in iter_tables(module, CodegenVisibility::OnlyPublic) { let type_ref = table.product_type_ref; let table_name_pascalcase = table.name.deref().to_case(Case::Pascal); writeln!(out, "__table({{"); diff --git a/crates/codegen/src/unrealcpp.rs b/crates/codegen/src/unrealcpp.rs index 0baa6adbc81..22187ecc26a 100644 --- a/crates/codegen/src/unrealcpp.rs +++ b/crates/codegen/src/unrealcpp.rs @@ -1,8 +1,8 @@ //! Autogenerated Unreal‑C++ code‑gen backend for SpacetimeDB CLI use crate::code_indenter::CodeIndenter; use crate::util::{ - collect_case, fmt_fn, iter_table_names_and_types, print_auto_generated_file_comment, - print_auto_generated_version_comment, + collect_case, fmt_fn, iter_table_names_and_types, iter_tables, print_auto_generated_file_comment, + print_auto_generated_version_comment, CodegenVisibility, }; use crate::util::{iter_indexes, iter_procedures, iter_reducers}; use crate::Lang; @@ -865,7 +865,7 @@ impl Lang for UnrealCpp<'_> { writeln!(client_h); writeln!(client_h, "/** Forward declaration for tables */"); - for (table_name, _) in iter_table_names_and_types(module) { + for (table_name, _) in iter_table_names_and_types(module, CodegenVisibility::OnlyPublic) { writeln!(client_h, "class U{}Table;", table_name.deref().to_case(Case::Pascal)); } writeln!(client_h, "/***/"); @@ -958,7 +958,7 @@ impl Lang for UnrealCpp<'_> { }); // Build table includes - let table_includes: Vec = iter_table_names_and_types(module) + let table_includes: Vec = iter_table_names_and_types(module, CodegenVisibility::OnlyPublic) .map(|(table_name, _)| { format!( "ModuleBindings/Tables/{}Table.g.h", @@ -987,7 +987,7 @@ impl Lang for UnrealCpp<'_> { }); // Generate .cpp implementation files for each table - for table in module.tables() { + for table in iter_tables(module, CodegenVisibility::OnlyPublic) { let schema = TableSchema::from_module_def(module, table, (), 0.into()) .validated() .expect("table schema should validate"); @@ -2349,7 +2349,7 @@ fn generate_remote_tables_class(output: &mut UnrealCppAutogen, module: &ModuleDe writeln!(output); // Generate table handle properties - for (table_name, _) in iter_table_names_and_types(module) { + for (table_name, _) in iter_table_names_and_types(module, CodegenVisibility::OnlyPublic) { writeln!(output, " UPROPERTY(BlueprintReadOnly, Category=\"SpacetimeDB\")"); writeln!( output, @@ -3023,7 +3023,7 @@ fn generate_client_implementation(output: &mut UnrealCppAutogen, module: &Module writeln!(output, "\tProcedures->Conn = this;"); writeln!(output); - for (table_name, product_type_ref) in iter_table_names_and_types(module) { + for (table_name, product_type_ref) in iter_table_names_and_types(module, CodegenVisibility::OnlyPublic) { let struct_name = type_ref_name(module, product_type_ref); let table_name = table_name.deref(); writeln!( @@ -3079,7 +3079,7 @@ fn generate_client_implementation(output: &mut UnrealCppAutogen, module: &Module writeln!(output, "{{"); writeln!(output); writeln!(output, "\t/** Creating tables */"); - for (table_name, _) in iter_table_names_and_types(module) { + for (table_name, _) in iter_table_names_and_types(module, CodegenVisibility::OnlyPublic) { writeln!( output, "\t{} = NewObject(this);", @@ -3090,7 +3090,7 @@ fn generate_client_implementation(output: &mut UnrealCppAutogen, module: &Module writeln!(output, "\t/**/"); writeln!(output); writeln!(output, "\t/** Initialization */"); - for (table_name, _) in iter_table_names_and_types(module) { + for (table_name, _) in iter_table_names_and_types(module, CodegenVisibility::OnlyPublic) { writeln!( output, "\t{}->PostInitialize();", @@ -3980,7 +3980,7 @@ fn collect_wrapper_types(module: &ModuleDef) -> (HashSet, HashSet<(Strin } // Collect from all tables - for (_, product_type_ref) in iter_table_names_and_types(module) { + for (_, product_type_ref) in iter_table_names_and_types(module, CodegenVisibility::OnlyPublic) { let product_type = module.typespace_for_generate()[product_type_ref].as_product().unwrap(); for (_, field_ty) in &product_type.elements { collect_from_type(module, field_ty, &mut optional_types, &mut result_types); diff --git a/crates/codegen/src/util.rs b/crates/codegen/src/util.rs index bc98458ea01..76fd995925f 100644 --- a/crates/codegen/src/util.rs +++ b/crates/codegen/src/util.rs @@ -8,6 +8,7 @@ use std::{ use super::code_indenter::Indenter; use convert_case::{Case, Casing}; use itertools::Itertools; +use spacetimedb_lib::db::raw_def::v9::TableAccess; use spacetimedb_lib::sats::layout::PrimitiveType; use spacetimedb_lib::version; use spacetimedb_lib::{db::raw_def::v9::Lifecycle, sats::AlgebraicTypeRef}; @@ -27,6 +28,13 @@ use spacetimedb_schema::{ type_for_generate::AlgebraicTypeUse, }; +#[derive(Clone, Copy, Debug, Eq, PartialEq)] +pub(super) enum CodegenVisibility { + #[allow(unused)] // reserved for upcoming change for --include-private option + IncludePrivate, + OnlyPublic, +} + /// Turns a closure `f: Fn(&mut Formatter) -> Result` into `fmt::Display`. pub(super) fn fmt_fn(f: impl Fn(&mut Formatter) -> Result) -> impl Display { struct FDisplay(F); @@ -123,8 +131,24 @@ pub(super) fn iter_procedures(module: &ModuleDef) -> impl Iterator impl Iterator { - module.tables().sorted_by_key(|table| &table.name) +pub(super) fn iter_tables(module: &ModuleDef, visibility: CodegenVisibility) -> impl Iterator { + module + .tables() + .filter(move |table| match visibility { + CodegenVisibility::IncludePrivate => true, + CodegenVisibility::OnlyPublic => table.table_access == TableAccess::Public, + }) + .sorted_by_key(|table| &table.name) +} + +/// Return the names of all private tables, in alphabetical order. +pub fn private_table_names(module: &ModuleDef) -> Vec { + module + .tables() + .filter(|table| table.table_access == TableAccess::Private) + .sorted_by_key(|table| &table.name) + .map(|table| table.name.to_string()) + .collect() } /// Iterate over all the [`ViewDef`]s defined by the module, in alphabetical order by name. @@ -137,9 +161,16 @@ pub(super) fn iter_views(module: &ModuleDef) -> impl Iterator { /// Iterate over the names of all the tables and views defined by the module, in alphabetical order. /// /// Sorting is necessary to have deterministic reproducible codegen. -pub(super) fn iter_table_names_and_types(module: &ModuleDef) -> impl Iterator { +pub(super) fn iter_table_names_and_types( + module: &ModuleDef, + visibility: CodegenVisibility, +) -> impl Iterator { module .tables() + .filter(move |table| match visibility { + CodegenVisibility::IncludePrivate => true, + CodegenVisibility::OnlyPublic => table.table_access == TableAccess::Public, + }) .map(|def| (&def.name, def.product_type_ref)) .chain(module.views().map(|def| (&def.name, def.product_type_ref))) .sorted_by_key(|(name, _)| *name) diff --git a/crates/codegen/tests/snapshots/codegen__codegen_csharp.snap b/crates/codegen/tests/snapshots/codegen__codegen_csharp.snap index 626a43853f6..13bc20e37e1 100644 --- a/crates/codegen/tests/snapshots/codegen__codegen_csharp.snap +++ b/crates/codegen/tests/snapshots/codegen__codegen_csharp.snap @@ -1161,19 +1161,11 @@ namespace SpacetimeDB { public RemoteTables(DbConnection conn) { - AddTable(HasSpecialStuff = new(conn)); AddTable(LoggedOutPlayer = new(conn)); AddTable(MyPlayer = new(conn)); AddTable(Person = new(conn)); - AddTable(PkMultiIdentity = new(conn)); AddTable(Player = new(conn)); - AddTable(Points = new(conn)); - AddTable(PrivateTable = new(conn)); - AddTable(RepeatingTestArg = new(conn)); - AddTable(TableToRemove = new(conn)); - AddTable(TestA = new(conn)); AddTable(TestD = new(conn)); - AddTable(TestE = new(conn)); AddTable(TestF = new(conn)); } } @@ -1713,19 +1705,11 @@ namespace SpacetimeDB public sealed class From { - public global::SpacetimeDB.Table HasSpecialStuff() => new("has_special_stuff", new HasSpecialStuffCols("has_special_stuff"), new HasSpecialStuffIxCols("has_special_stuff")); public global::SpacetimeDB.Table LoggedOutPlayer() => new("logged_out_player", new LoggedOutPlayerCols("logged_out_player"), new LoggedOutPlayerIxCols("logged_out_player")); public global::SpacetimeDB.Table MyPlayer() => new("my_player", new MyPlayerCols("my_player"), new MyPlayerIxCols("my_player")); public global::SpacetimeDB.Table Person() => new("person", new PersonCols("person"), new PersonIxCols("person")); - public global::SpacetimeDB.Table PkMultiIdentity() => new("pk_multi_identity", new PkMultiIdentityCols("pk_multi_identity"), new PkMultiIdentityIxCols("pk_multi_identity")); public global::SpacetimeDB.Table Player() => new("player", new PlayerCols("player"), new PlayerIxCols("player")); - public global::SpacetimeDB.Table Points() => new("points", new PointsCols("points"), new PointsIxCols("points")); - public global::SpacetimeDB.Table PrivateTable() => new("private_table", new PrivateTableCols("private_table"), new PrivateTableIxCols("private_table")); - public global::SpacetimeDB.Table RepeatingTestArg() => new("repeating_test_arg", new RepeatingTestArgCols("repeating_test_arg"), new RepeatingTestArgIxCols("repeating_test_arg")); - public global::SpacetimeDB.Table TableToRemove() => new("table_to_remove", new TableToRemoveCols("table_to_remove"), new TableToRemoveIxCols("table_to_remove")); - public global::SpacetimeDB.Table TestA() => new("test_a", new TestACols("test_a"), new TestAIxCols("test_a")); public global::SpacetimeDB.Table TestD() => new("test_d", new TestDCols("test_d"), new TestDIxCols("test_d")); - public global::SpacetimeDB.Table TestE() => new("test_e", new TestECols("test_e"), new TestEIxCols("test_e")); public global::SpacetimeDB.Table TestF() => new("test_f", new TestFCols("test_f"), new TestFIxCols("test_f")); } @@ -1854,55 +1838,6 @@ namespace SpacetimeDB } } ''' -"Tables/HasSpecialStuff.g.cs" = ''' -// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE -// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. - -#nullable enable - -using System; -using SpacetimeDB.BSATN; -using SpacetimeDB.ClientApi; -using System.Collections.Generic; -using System.Runtime.Serialization; - -namespace SpacetimeDB -{ - public sealed partial class RemoteTables - { - public sealed class HasSpecialStuffHandle : RemoteTableHandle - { - protected override string RemoteTableName => "has_special_stuff"; - - internal HasSpecialStuffHandle(DbConnection conn) : base(conn) - { - } - } - - public readonly HasSpecialStuffHandle HasSpecialStuff; - } - - public sealed class HasSpecialStuffCols - { - public global::SpacetimeDB.Col Identity { get; } - public global::SpacetimeDB.Col ConnectionId { get; } - - public HasSpecialStuffCols(string tableName) - { - Identity = new global::SpacetimeDB.Col(tableName, "identity"); - ConnectionId = new global::SpacetimeDB.Col(tableName, "connection_id"); - } - } - - public sealed class HasSpecialStuffIxCols - { - - public HasSpecialStuffIxCols(string tableName) - { - } - } -} -''' "Tables/LoggedOutPlayer.g.cs" = ''' // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. @@ -2120,81 +2055,6 @@ namespace SpacetimeDB } } ''' -"Tables/PkMultiIdentity.g.cs" = ''' -// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE -// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. - -#nullable enable - -using System; -using SpacetimeDB.BSATN; -using SpacetimeDB.ClientApi; -using System.Collections.Generic; -using System.Runtime.Serialization; - -namespace SpacetimeDB -{ - public sealed partial class RemoteTables - { - public sealed class PkMultiIdentityHandle : RemoteTableHandle - { - protected override string RemoteTableName => "pk_multi_identity"; - - public sealed class IdUniqueIndex : UniqueIndexBase - { - protected override uint GetKey(PkMultiIdentity row) => row.Id; - - public IdUniqueIndex(PkMultiIdentityHandle table) : base(table) { } - } - - public readonly IdUniqueIndex Id; - - public sealed class OtherUniqueIndex : UniqueIndexBase - { - protected override uint GetKey(PkMultiIdentity row) => row.Other; - - public OtherUniqueIndex(PkMultiIdentityHandle table) : base(table) { } - } - - public readonly OtherUniqueIndex Other; - - internal PkMultiIdentityHandle(DbConnection conn) : base(conn) - { - Id = new(this); - Other = new(this); - } - - protected override object GetPrimaryKey(PkMultiIdentity row) => row.Id; - } - - public readonly PkMultiIdentityHandle PkMultiIdentity; - } - - public sealed class PkMultiIdentityCols - { - public global::SpacetimeDB.Col Id { get; } - public global::SpacetimeDB.Col Other { get; } - - public PkMultiIdentityCols(string tableName) - { - Id = new global::SpacetimeDB.Col(tableName, "id"); - Other = new global::SpacetimeDB.Col(tableName, "other"); - } - } - - public sealed class PkMultiIdentityIxCols - { - public global::SpacetimeDB.IxCol Id { get; } - public global::SpacetimeDB.IxCol Other { get; } - - public PkMultiIdentityIxCols(string tableName) - { - Id = new global::SpacetimeDB.IxCol(tableName, "id"); - Other = new global::SpacetimeDB.IxCol(tableName, "other"); - } - } -} -''' "Tables/Player.g.cs" = ''' // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. @@ -2284,291 +2144,6 @@ namespace SpacetimeDB } } ''' -"Tables/Points.g.cs" = ''' -// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE -// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. - -#nullable enable - -using System; -using SpacetimeDB.BSATN; -using SpacetimeDB.ClientApi; -using System.Collections.Generic; -using System.Runtime.Serialization; - -namespace SpacetimeDB -{ - public sealed partial class RemoteTables - { - public sealed class PointsHandle : RemoteTableHandle - { - protected override string RemoteTableName => "points"; - - public sealed class MultiColumnIndexIndex : BTreeIndexBase<(long X, long Y)> - { - protected override (long X, long Y) GetKey(Point row) => (row.X, row.Y); - - public MultiColumnIndexIndex(PointsHandle table) : base(table) { } - } - - public readonly MultiColumnIndexIndex MultiColumnIndex; - - internal PointsHandle(DbConnection conn) : base(conn) - { - MultiColumnIndex = new(this); - } - } - - public readonly PointsHandle Points; - } - - public sealed class PointsCols - { - public global::SpacetimeDB.Col X { get; } - public global::SpacetimeDB.Col Y { get; } - - public PointsCols(string tableName) - { - X = new global::SpacetimeDB.Col(tableName, "x"); - Y = new global::SpacetimeDB.Col(tableName, "y"); - } - } - - public sealed class PointsIxCols - { - public global::SpacetimeDB.IxCol X { get; } - public global::SpacetimeDB.IxCol Y { get; } - - public PointsIxCols(string tableName) - { - X = new global::SpacetimeDB.IxCol(tableName, "x"); - Y = new global::SpacetimeDB.IxCol(tableName, "y"); - } - } -} -''' -"Tables/PrivateTable.g.cs" = ''' -// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE -// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. - -#nullable enable - -using System; -using SpacetimeDB.BSATN; -using SpacetimeDB.ClientApi; -using System.Collections.Generic; -using System.Runtime.Serialization; - -namespace SpacetimeDB -{ - public sealed partial class RemoteTables - { - public sealed class PrivateTableHandle : RemoteTableHandle - { - protected override string RemoteTableName => "private_table"; - - internal PrivateTableHandle(DbConnection conn) : base(conn) - { - } - } - - public readonly PrivateTableHandle PrivateTable; - } - - public sealed class PrivateTableCols - { - public global::SpacetimeDB.Col Name { get; } - - public PrivateTableCols(string tableName) - { - Name = new global::SpacetimeDB.Col(tableName, "name"); - } - } - - public sealed class PrivateTableIxCols - { - - public PrivateTableIxCols(string tableName) - { - } - } -} -''' -"Tables/RepeatingTestArg.g.cs" = ''' -// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE -// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. - -#nullable enable - -using System; -using SpacetimeDB.BSATN; -using SpacetimeDB.ClientApi; -using System.Collections.Generic; -using System.Runtime.Serialization; - -namespace SpacetimeDB -{ - public sealed partial class RemoteTables - { - public sealed class RepeatingTestArgHandle : RemoteTableHandle - { - protected override string RemoteTableName => "repeating_test_arg"; - - public sealed class ScheduledIdUniqueIndex : UniqueIndexBase - { - protected override ulong GetKey(RepeatingTestArg row) => row.ScheduledId; - - public ScheduledIdUniqueIndex(RepeatingTestArgHandle table) : base(table) { } - } - - public readonly ScheduledIdUniqueIndex ScheduledId; - - internal RepeatingTestArgHandle(DbConnection conn) : base(conn) - { - ScheduledId = new(this); - } - - protected override object GetPrimaryKey(RepeatingTestArg row) => row.ScheduledId; - } - - public readonly RepeatingTestArgHandle RepeatingTestArg; - } - - public sealed class RepeatingTestArgCols - { - public global::SpacetimeDB.Col ScheduledId { get; } - public global::SpacetimeDB.Col ScheduledAt { get; } - public global::SpacetimeDB.Col PrevTime { get; } - - public RepeatingTestArgCols(string tableName) - { - ScheduledId = new global::SpacetimeDB.Col(tableName, "scheduled_id"); - ScheduledAt = new global::SpacetimeDB.Col(tableName, "scheduled_at"); - PrevTime = new global::SpacetimeDB.Col(tableName, "prev_time"); - } - } - - public sealed class RepeatingTestArgIxCols - { - public global::SpacetimeDB.IxCol ScheduledId { get; } - - public RepeatingTestArgIxCols(string tableName) - { - ScheduledId = new global::SpacetimeDB.IxCol(tableName, "scheduled_id"); - } - } -} -''' -"Tables/TableToRemove.g.cs" = ''' -// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE -// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. - -#nullable enable - -using System; -using SpacetimeDB.BSATN; -using SpacetimeDB.ClientApi; -using System.Collections.Generic; -using System.Runtime.Serialization; - -namespace SpacetimeDB -{ - public sealed partial class RemoteTables - { - public sealed class TableToRemoveHandle : RemoteTableHandle - { - protected override string RemoteTableName => "table_to_remove"; - - internal TableToRemoveHandle(DbConnection conn) : base(conn) - { - } - } - - public readonly TableToRemoveHandle TableToRemove; - } - - public sealed class TableToRemoveCols - { - public global::SpacetimeDB.Col Id { get; } - - public TableToRemoveCols(string tableName) - { - Id = new global::SpacetimeDB.Col(tableName, "id"); - } - } - - public sealed class TableToRemoveIxCols - { - - public TableToRemoveIxCols(string tableName) - { - } - } -} -''' -"Tables/TestA.g.cs" = ''' -// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE -// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. - -#nullable enable - -using System; -using SpacetimeDB.BSATN; -using SpacetimeDB.ClientApi; -using System.Collections.Generic; -using System.Runtime.Serialization; - -namespace SpacetimeDB -{ - public sealed partial class RemoteTables - { - public sealed class TestAHandle : RemoteTableHandle - { - protected override string RemoteTableName => "test_a"; - - public sealed class FooIndex : BTreeIndexBase - { - protected override uint GetKey(TestA row) => row.X; - - public FooIndex(TestAHandle table) : base(table) { } - } - - public readonly FooIndex Foo; - - internal TestAHandle(DbConnection conn) : base(conn) - { - Foo = new(this); - } - } - - public readonly TestAHandle TestA; - } - - public sealed class TestACols - { - public global::SpacetimeDB.Col X { get; } - public global::SpacetimeDB.Col Y { get; } - public global::SpacetimeDB.Col Z { get; } - - public TestACols(string tableName) - { - X = new global::SpacetimeDB.Col(tableName, "x"); - Y = new global::SpacetimeDB.Col(tableName, "y"); - Z = new global::SpacetimeDB.Col(tableName, "z"); - } - } - - public sealed class TestAIxCols - { - public global::SpacetimeDB.IxCol X { get; } - - public TestAIxCols(string tableName) - { - X = new global::SpacetimeDB.IxCol(tableName, "x"); - } - } -} -''' "Tables/TestD.g.cs" = ''' // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. @@ -2616,81 +2191,6 @@ namespace SpacetimeDB } } ''' -"Tables/TestE.g.cs" = ''' -// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE -// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. - -#nullable enable - -using System; -using SpacetimeDB.BSATN; -using SpacetimeDB.ClientApi; -using System.Collections.Generic; -using System.Runtime.Serialization; - -namespace SpacetimeDB -{ - public sealed partial class RemoteTables - { - public sealed class TestEHandle : RemoteTableHandle - { - protected override string RemoteTableName => "test_e"; - - public sealed class IdUniqueIndex : UniqueIndexBase - { - protected override ulong GetKey(TestE row) => row.Id; - - public IdUniqueIndex(TestEHandle table) : base(table) { } - } - - public readonly IdUniqueIndex Id; - - public sealed class NameIndex : BTreeIndexBase - { - protected override string GetKey(TestE row) => row.Name; - - public NameIndex(TestEHandle table) : base(table) { } - } - - public readonly NameIndex Name; - - internal TestEHandle(DbConnection conn) : base(conn) - { - Id = new(this); - Name = new(this); - } - - protected override object GetPrimaryKey(TestE row) => row.Id; - } - - public readonly TestEHandle TestE; - } - - public sealed class TestECols - { - public global::SpacetimeDB.Col Id { get; } - public global::SpacetimeDB.Col Name { get; } - - public TestECols(string tableName) - { - Id = new global::SpacetimeDB.Col(tableName, "id"); - Name = new global::SpacetimeDB.Col(tableName, "name"); - } - } - - public sealed class TestEIxCols - { - public global::SpacetimeDB.IxCol Id { get; } - public global::SpacetimeDB.IxCol Name { get; } - - public TestEIxCols(string tableName) - { - Id = new global::SpacetimeDB.IxCol(tableName, "id"); - Name = new global::SpacetimeDB.IxCol(tableName, "name"); - } - } -} -''' "Tables/TestF.g.cs" = ''' // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. diff --git a/crates/codegen/tests/snapshots/codegen__codegen_rust.snap b/crates/codegen/tests/snapshots/codegen__codegen_rust.snap index 58508d40a4a..f6d09982fa3 100644 --- a/crates/codegen/tests/snapshots/codegen__codegen_rust.snap +++ b/crates/codegen/tests/snapshots/codegen__codegen_rust.snap @@ -771,123 +771,6 @@ impl get_my_schema_via_http for super::RemoteProcedures { } } -''' -"has_special_stuff_table.rs" = ''' -// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE -// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. - -#![allow(unused, clippy::all)] -use spacetimedb_sdk::__codegen::{ - self as __sdk, - __lib, - __sats, - __ws, -}; -use super::has_special_stuff_type::HasSpecialStuff; - -/// Table handle for the table `has_special_stuff`. -/// -/// Obtain a handle from the [`HasSpecialStuffTableAccess::has_special_stuff`] method on [`super::RemoteTables`], -/// like `ctx.db.has_special_stuff()`. -/// -/// Users are encouraged not to explicitly reference this type, -/// but to directly chain method calls, -/// like `ctx.db.has_special_stuff().on_insert(...)`. -pub struct HasSpecialStuffTableHandle<'ctx> { - imp: __sdk::TableHandle, - ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, -} - -#[allow(non_camel_case_types)] -/// Extension trait for access to the table `has_special_stuff`. -/// -/// Implemented for [`super::RemoteTables`]. -pub trait HasSpecialStuffTableAccess { - #[allow(non_snake_case)] - /// Obtain a [`HasSpecialStuffTableHandle`], which mediates access to the table `has_special_stuff`. - fn has_special_stuff(&self) -> HasSpecialStuffTableHandle<'_>; -} - -impl HasSpecialStuffTableAccess for super::RemoteTables { - fn has_special_stuff(&self) -> HasSpecialStuffTableHandle<'_> { - HasSpecialStuffTableHandle { - imp: self.imp.get_table::("has_special_stuff"), - ctx: std::marker::PhantomData, - } - } -} - -pub struct HasSpecialStuffInsertCallbackId(__sdk::CallbackId); -pub struct HasSpecialStuffDeleteCallbackId(__sdk::CallbackId); - -impl<'ctx> __sdk::Table for HasSpecialStuffTableHandle<'ctx> { - type Row = HasSpecialStuff; - type EventContext = super::EventContext; - - fn count(&self) -> u64 { self.imp.count() } - fn iter(&self) -> impl Iterator + '_ { self.imp.iter() } - - type InsertCallbackId = HasSpecialStuffInsertCallbackId; - - fn on_insert( - &self, - callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, - ) -> HasSpecialStuffInsertCallbackId { - HasSpecialStuffInsertCallbackId(self.imp.on_insert(Box::new(callback))) - } - - fn remove_on_insert(&self, callback: HasSpecialStuffInsertCallbackId) { - self.imp.remove_on_insert(callback.0) - } - - type DeleteCallbackId = HasSpecialStuffDeleteCallbackId; - - fn on_delete( - &self, - callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, - ) -> HasSpecialStuffDeleteCallbackId { - HasSpecialStuffDeleteCallbackId(self.imp.on_delete(Box::new(callback))) - } - - fn remove_on_delete(&self, callback: HasSpecialStuffDeleteCallbackId) { - self.imp.remove_on_delete(callback.0) - } -} - -#[doc(hidden)] -pub(super) fn register_table(client_cache: &mut __sdk::ClientCache) { - - let _table = client_cache.get_or_make_table::("has_special_stuff"); -} - -#[doc(hidden)] -pub(super) fn parse_table_update( - raw_updates: __ws::TableUpdate<__ws::BsatnFormat>, -) -> __sdk::Result<__sdk::TableUpdate> { - __sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| { - __sdk::InternalError::failed_parse( - "TableUpdate", - "TableUpdate", - ).with_cause(e).into() - }) -} - - #[allow(non_camel_case_types)] - /// Extension trait for query builder access to the table `HasSpecialStuff`. - /// - /// Implemented for [`__sdk::QueryTableAccessor`]. - pub trait has_special_stuffQueryTableAccess { - #[allow(non_snake_case)] - /// Get a query builder for the table `HasSpecialStuff`. - fn has_special_stuff(&self) -> __sdk::__query_builder::Table; - } - - impl has_special_stuffQueryTableAccess for __sdk::QueryTableAccessor { - fn has_special_stuff(&self) -> __sdk::__query_builder::Table { - __sdk::__query_builder::Table::new("has_special_stuff") - } - } - ''' "has_special_stuff_type.rs" = ''' // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE @@ -1435,18 +1318,10 @@ pub mod query_private_reducer; pub mod say_hello_reducer; pub mod test_reducer; pub mod test_btree_index_args_reducer; -pub mod has_special_stuff_table; pub mod logged_out_player_table; pub mod person_table; -pub mod pk_multi_identity_table; pub mod player_table; -pub mod points_table; -pub mod private_table_table; -pub mod repeating_test_arg_table; -pub mod table_to_remove_table; -pub mod test_a_table; pub mod test_d_table; -pub mod test_e_table; pub mod test_f_table; pub mod my_player_table; pub mod get_my_schema_via_http_procedure; @@ -1471,19 +1346,11 @@ pub use test_e_type::TestE; pub use test_foobar_type::TestFoobar; pub use namespace_test_c_type::NamespaceTestC; pub use namespace_test_f_type::NamespaceTestF; -pub use has_special_stuff_table::*; pub use logged_out_player_table::*; pub use my_player_table::*; pub use person_table::*; -pub use pk_multi_identity_table::*; pub use player_table::*; -pub use points_table::*; -pub use private_table_table::*; -pub use repeating_test_arg_table::*; -pub use table_to_remove_table::*; -pub use test_a_table::*; pub use test_d_table::*; -pub use test_e_table::*; pub use test_f_table::*; pub use add_reducer::{add, set_flags_for_add, AddCallbackId}; pub use add_player_reducer::{add_player, set_flags_for_add_player, AddPlayerCallbackId}; @@ -1591,19 +1458,11 @@ fn try_from(value: __ws::ReducerCallInfo<__ws::BsatnFormat>) -> __sdk::Result, - logged_out_player: __sdk::TableUpdate, + logged_out_player: __sdk::TableUpdate, my_player: __sdk::TableUpdate, person: __sdk::TableUpdate, - pk_multi_identity: __sdk::TableUpdate, player: __sdk::TableUpdate, - points: __sdk::TableUpdate, - private_table: __sdk::TableUpdate, - repeating_test_arg: __sdk::TableUpdate, - table_to_remove: __sdk::TableUpdate, - test_a: __sdk::TableUpdate, test_d: __sdk::TableUpdate, - test_e: __sdk::TableUpdate, test_f: __sdk::TableUpdate, } @@ -1615,19 +1474,11 @@ impl TryFrom<__ws::DatabaseUpdate<__ws::BsatnFormat>> for DbUpdate { for table_update in raw.tables { match &table_update.table_name[..] { - "has_special_stuff" => db_update.has_special_stuff.append(has_special_stuff_table::parse_table_update(table_update)?), - "logged_out_player" => db_update.logged_out_player.append(logged_out_player_table::parse_table_update(table_update)?), + "logged_out_player" => db_update.logged_out_player.append(logged_out_player_table::parse_table_update(table_update)?), "my_player" => db_update.my_player.append(my_player_table::parse_table_update(table_update)?), "person" => db_update.person.append(person_table::parse_table_update(table_update)?), - "pk_multi_identity" => db_update.pk_multi_identity.append(pk_multi_identity_table::parse_table_update(table_update)?), "player" => db_update.player.append(player_table::parse_table_update(table_update)?), - "points" => db_update.points.append(points_table::parse_table_update(table_update)?), - "private_table" => db_update.private_table.append(private_table_table::parse_table_update(table_update)?), - "repeating_test_arg" => db_update.repeating_test_arg.append(repeating_test_arg_table::parse_table_update(table_update)?), - "table_to_remove" => db_update.table_to_remove.append(table_to_remove_table::parse_table_update(table_update)?), - "test_a" => db_update.test_a.append(test_a_table::parse_table_update(table_update)?), "test_d" => db_update.test_d.append(test_d_table::parse_table_update(table_update)?), - "test_e" => db_update.test_e.append(test_e_table::parse_table_update(table_update)?), "test_f" => db_update.test_f.append(test_f_table::parse_table_update(table_update)?), unknown => { @@ -1651,18 +1502,10 @@ impl __sdk::DbUpdate for DbUpdate { fn apply_to_client_cache(&self, cache: &mut __sdk::ClientCache) -> AppliedDiff<'_> { let mut diff = AppliedDiff::default(); - diff.has_special_stuff = cache.apply_diff_to_table::("has_special_stuff", &self.has_special_stuff); - diff.logged_out_player = cache.apply_diff_to_table::("logged_out_player", &self.logged_out_player).with_updates_by_pk(|row| &row.identity); + diff.logged_out_player = cache.apply_diff_to_table::("logged_out_player", &self.logged_out_player).with_updates_by_pk(|row| &row.identity); diff.person = cache.apply_diff_to_table::("person", &self.person).with_updates_by_pk(|row| &row.id); - diff.pk_multi_identity = cache.apply_diff_to_table::("pk_multi_identity", &self.pk_multi_identity).with_updates_by_pk(|row| &row.id); diff.player = cache.apply_diff_to_table::("player", &self.player).with_updates_by_pk(|row| &row.identity); - diff.points = cache.apply_diff_to_table::("points", &self.points); - diff.private_table = cache.apply_diff_to_table::("private_table", &self.private_table); - diff.repeating_test_arg = cache.apply_diff_to_table::("repeating_test_arg", &self.repeating_test_arg).with_updates_by_pk(|row| &row.scheduled_id); - diff.table_to_remove = cache.apply_diff_to_table::("table_to_remove", &self.table_to_remove); - diff.test_a = cache.apply_diff_to_table::("test_a", &self.test_a); diff.test_d = cache.apply_diff_to_table::("test_d", &self.test_d); - diff.test_e = cache.apply_diff_to_table::("test_e", &self.test_e).with_updates_by_pk(|row| &row.id); diff.test_f = cache.apply_diff_to_table::("test_f", &self.test_f); diff.my_player = cache.apply_diff_to_table::("my_player", &self.my_player); @@ -1674,19 +1517,11 @@ impl __sdk::DbUpdate for DbUpdate { #[allow(non_snake_case)] #[doc(hidden)] pub struct AppliedDiff<'r> { - has_special_stuff: __sdk::TableAppliedDiff<'r, HasSpecialStuff>, - logged_out_player: __sdk::TableAppliedDiff<'r, Player>, + logged_out_player: __sdk::TableAppliedDiff<'r, Player>, my_player: __sdk::TableAppliedDiff<'r, Player>, person: __sdk::TableAppliedDiff<'r, Person>, - pk_multi_identity: __sdk::TableAppliedDiff<'r, PkMultiIdentity>, player: __sdk::TableAppliedDiff<'r, Player>, - points: __sdk::TableAppliedDiff<'r, Point>, - private_table: __sdk::TableAppliedDiff<'r, PrivateTable>, - repeating_test_arg: __sdk::TableAppliedDiff<'r, RepeatingTestArg>, - table_to_remove: __sdk::TableAppliedDiff<'r, RemoveTable>, - test_a: __sdk::TableAppliedDiff<'r, TestA>, test_d: __sdk::TableAppliedDiff<'r, TestD>, - test_e: __sdk::TableAppliedDiff<'r, TestE>, test_f: __sdk::TableAppliedDiff<'r, TestFoobar>, __unused: std::marker::PhantomData<&'r ()>, } @@ -1698,19 +1533,11 @@ impl __sdk::InModule for AppliedDiff<'_> { impl<'r> __sdk::AppliedDiff<'r> for AppliedDiff<'r> { fn invoke_row_callbacks(&self, event: &EventContext, callbacks: &mut __sdk::DbCallbacks) { - callbacks.invoke_table_row_callbacks::("has_special_stuff", &self.has_special_stuff, event); - callbacks.invoke_table_row_callbacks::("logged_out_player", &self.logged_out_player, event); + callbacks.invoke_table_row_callbacks::("logged_out_player", &self.logged_out_player, event); callbacks.invoke_table_row_callbacks::("my_player", &self.my_player, event); callbacks.invoke_table_row_callbacks::("person", &self.person, event); - callbacks.invoke_table_row_callbacks::("pk_multi_identity", &self.pk_multi_identity, event); callbacks.invoke_table_row_callbacks::("player", &self.player, event); - callbacks.invoke_table_row_callbacks::("points", &self.points, event); - callbacks.invoke_table_row_callbacks::("private_table", &self.private_table, event); - callbacks.invoke_table_row_callbacks::("repeating_test_arg", &self.repeating_test_arg, event); - callbacks.invoke_table_row_callbacks::("table_to_remove", &self.table_to_remove, event); - callbacks.invoke_table_row_callbacks::("test_a", &self.test_a, event); callbacks.invoke_table_row_callbacks::("test_d", &self.test_d, event); - callbacks.invoke_table_row_callbacks::("test_e", &self.test_e, event); callbacks.invoke_table_row_callbacks::("test_f", &self.test_f, event); } } @@ -2429,19 +2256,11 @@ impl __sdk::SpacetimeModule for RemoteModule { type QueryBuilder = __sdk::QueryBuilder; fn register_tables(client_cache: &mut __sdk::ClientCache) { - has_special_stuff_table::register_table(client_cache); - logged_out_player_table::register_table(client_cache); + logged_out_player_table::register_table(client_cache); my_player_table::register_table(client_cache); person_table::register_table(client_cache); - pk_multi_identity_table::register_table(client_cache); player_table::register_table(client_cache); - points_table::register_table(client_cache); - private_table_table::register_table(client_cache); - repeating_test_arg_table::register_table(client_cache); - table_to_remove_table::register_table(client_cache); - test_a_table::register_table(client_cache); test_d_table::register_table(client_cache); - test_e_table::register_table(client_cache); test_f_table::register_table(client_cache); } } @@ -2855,202 +2674,6 @@ impl __sdk::__query_builder::HasIxCols for Person { } } -''' -"pk_multi_identity_table.rs" = ''' -// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE -// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. - -#![allow(unused, clippy::all)] -use spacetimedb_sdk::__codegen::{ - self as __sdk, - __lib, - __sats, - __ws, -}; -use super::pk_multi_identity_type::PkMultiIdentity; - -/// Table handle for the table `pk_multi_identity`. -/// -/// Obtain a handle from the [`PkMultiIdentityTableAccess::pk_multi_identity`] method on [`super::RemoteTables`], -/// like `ctx.db.pk_multi_identity()`. -/// -/// Users are encouraged not to explicitly reference this type, -/// but to directly chain method calls, -/// like `ctx.db.pk_multi_identity().on_insert(...)`. -pub struct PkMultiIdentityTableHandle<'ctx> { - imp: __sdk::TableHandle, - ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, -} - -#[allow(non_camel_case_types)] -/// Extension trait for access to the table `pk_multi_identity`. -/// -/// Implemented for [`super::RemoteTables`]. -pub trait PkMultiIdentityTableAccess { - #[allow(non_snake_case)] - /// Obtain a [`PkMultiIdentityTableHandle`], which mediates access to the table `pk_multi_identity`. - fn pk_multi_identity(&self) -> PkMultiIdentityTableHandle<'_>; -} - -impl PkMultiIdentityTableAccess for super::RemoteTables { - fn pk_multi_identity(&self) -> PkMultiIdentityTableHandle<'_> { - PkMultiIdentityTableHandle { - imp: self.imp.get_table::("pk_multi_identity"), - ctx: std::marker::PhantomData, - } - } -} - -pub struct PkMultiIdentityInsertCallbackId(__sdk::CallbackId); -pub struct PkMultiIdentityDeleteCallbackId(__sdk::CallbackId); - -impl<'ctx> __sdk::Table for PkMultiIdentityTableHandle<'ctx> { - type Row = PkMultiIdentity; - type EventContext = super::EventContext; - - fn count(&self) -> u64 { self.imp.count() } - fn iter(&self) -> impl Iterator + '_ { self.imp.iter() } - - type InsertCallbackId = PkMultiIdentityInsertCallbackId; - - fn on_insert( - &self, - callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, - ) -> PkMultiIdentityInsertCallbackId { - PkMultiIdentityInsertCallbackId(self.imp.on_insert(Box::new(callback))) - } - - fn remove_on_insert(&self, callback: PkMultiIdentityInsertCallbackId) { - self.imp.remove_on_insert(callback.0) - } - - type DeleteCallbackId = PkMultiIdentityDeleteCallbackId; - - fn on_delete( - &self, - callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, - ) -> PkMultiIdentityDeleteCallbackId { - PkMultiIdentityDeleteCallbackId(self.imp.on_delete(Box::new(callback))) - } - - fn remove_on_delete(&self, callback: PkMultiIdentityDeleteCallbackId) { - self.imp.remove_on_delete(callback.0) - } -} - -#[doc(hidden)] -pub(super) fn register_table(client_cache: &mut __sdk::ClientCache) { - - let _table = client_cache.get_or_make_table::("pk_multi_identity"); - _table.add_unique_constraint::("id", |row| &row.id); - _table.add_unique_constraint::("other", |row| &row.other); -} -pub struct PkMultiIdentityUpdateCallbackId(__sdk::CallbackId); - -impl<'ctx> __sdk::TableWithPrimaryKey for PkMultiIdentityTableHandle<'ctx> { - type UpdateCallbackId = PkMultiIdentityUpdateCallbackId; - - fn on_update( - &self, - callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static, - ) -> PkMultiIdentityUpdateCallbackId { - PkMultiIdentityUpdateCallbackId(self.imp.on_update(Box::new(callback))) - } - - fn remove_on_update(&self, callback: PkMultiIdentityUpdateCallbackId) { - self.imp.remove_on_update(callback.0) - } -} - - -#[doc(hidden)] -pub(super) fn parse_table_update( - raw_updates: __ws::TableUpdate<__ws::BsatnFormat>, -) -> __sdk::Result<__sdk::TableUpdate> { - __sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| { - __sdk::InternalError::failed_parse( - "TableUpdate", - "TableUpdate", - ).with_cause(e).into() - }) -} - - /// Access to the `id` unique index on the table `pk_multi_identity`, - /// which allows point queries on the field of the same name - /// via the [`PkMultiIdentityIdUnique::find`] method. - /// - /// Users are encouraged not to explicitly reference this type, - /// but to directly chain method calls, - /// like `ctx.db.pk_multi_identity().id().find(...)`. - pub struct PkMultiIdentityIdUnique<'ctx> { - imp: __sdk::UniqueConstraintHandle, - phantom: std::marker::PhantomData<&'ctx super::RemoteTables>, - } - - impl<'ctx> PkMultiIdentityTableHandle<'ctx> { - /// Get a handle on the `id` unique index on the table `pk_multi_identity`. - pub fn id(&self) -> PkMultiIdentityIdUnique<'ctx> { - PkMultiIdentityIdUnique { - imp: self.imp.get_unique_constraint::("id"), - phantom: std::marker::PhantomData, - } - } - } - - impl<'ctx> PkMultiIdentityIdUnique<'ctx> { - /// Find the subscribed row whose `id` column value is equal to `col_val`, - /// if such a row is present in the client cache. - pub fn find(&self, col_val: &u32) -> Option { - self.imp.find(col_val) - } - } - - /// Access to the `other` unique index on the table `pk_multi_identity`, - /// which allows point queries on the field of the same name - /// via the [`PkMultiIdentityOtherUnique::find`] method. - /// - /// Users are encouraged not to explicitly reference this type, - /// but to directly chain method calls, - /// like `ctx.db.pk_multi_identity().other().find(...)`. - pub struct PkMultiIdentityOtherUnique<'ctx> { - imp: __sdk::UniqueConstraintHandle, - phantom: std::marker::PhantomData<&'ctx super::RemoteTables>, - } - - impl<'ctx> PkMultiIdentityTableHandle<'ctx> { - /// Get a handle on the `other` unique index on the table `pk_multi_identity`. - pub fn other(&self) -> PkMultiIdentityOtherUnique<'ctx> { - PkMultiIdentityOtherUnique { - imp: self.imp.get_unique_constraint::("other"), - phantom: std::marker::PhantomData, - } - } - } - - impl<'ctx> PkMultiIdentityOtherUnique<'ctx> { - /// Find the subscribed row whose `other` column value is equal to `col_val`, - /// if such a row is present in the client cache. - pub fn find(&self, col_val: &u32) -> Option { - self.imp.find(col_val) - } - } - - #[allow(non_camel_case_types)] - /// Extension trait for query builder access to the table `PkMultiIdentity`. - /// - /// Implemented for [`__sdk::QueryTableAccessor`]. - pub trait pk_multi_identityQueryTableAccess { - #[allow(non_snake_case)] - /// Get a query builder for the table `PkMultiIdentity`. - fn pk_multi_identity(&self) -> __sdk::__query_builder::Table; - } - - impl pk_multi_identityQueryTableAccess for __sdk::QueryTableAccessor { - fn pk_multi_identity(&self) -> __sdk::__query_builder::Table { - __sdk::__query_builder::Table::new("pk_multi_identity") - } - } - ''' "pk_multi_identity_type.rs" = ''' // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE @@ -3475,7 +3098,7 @@ impl __sdk::__query_builder::HasIxCols for Point { } ''' -"points_table.rs" = ''' +"private_table_type.rs" = ''' // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. @@ -3486,285 +3109,51 @@ use spacetimedb_sdk::__codegen::{ __sats, __ws, }; -use super::point_type::Point; -/// Table handle for the table `points`. -/// -/// Obtain a handle from the [`PointsTableAccess::points`] method on [`super::RemoteTables`], -/// like `ctx.db.points()`. -/// -/// Users are encouraged not to explicitly reference this type, -/// but to directly chain method calls, -/// like `ctx.db.points().on_insert(...)`. -pub struct PointsTableHandle<'ctx> { - imp: __sdk::TableHandle, - ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, + +#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)] +#[sats(crate = __lib)] +pub struct PrivateTable { + pub name: String, } -#[allow(non_camel_case_types)] -/// Extension trait for access to the table `points`. + +impl __sdk::InModule for PrivateTable { + type Module = super::RemoteModule; +} + + +/// Column accessor struct for the table `PrivateTable`. /// -/// Implemented for [`super::RemoteTables`]. -pub trait PointsTableAccess { - #[allow(non_snake_case)] - /// Obtain a [`PointsTableHandle`], which mediates access to the table `points`. - fn points(&self) -> PointsTableHandle<'_>; +/// Provides typed access to columns for query building. +pub struct PrivateTableCols { + pub name: __sdk::__query_builder::Col, } -impl PointsTableAccess for super::RemoteTables { - fn points(&self) -> PointsTableHandle<'_> { - PointsTableHandle { - imp: self.imp.get_table::("points"), - ctx: std::marker::PhantomData, +impl __sdk::__query_builder::HasCols for PrivateTable { + type Cols = PrivateTableCols; + fn cols(table_name: &'static str) -> Self::Cols { + PrivateTableCols { + name: __sdk::__query_builder::Col::new(table_name, "name"), + } } } -pub struct PointsInsertCallbackId(__sdk::CallbackId); -pub struct PointsDeleteCallbackId(__sdk::CallbackId); - -impl<'ctx> __sdk::Table for PointsTableHandle<'ctx> { - type Row = Point; - type EventContext = super::EventContext; - - fn count(&self) -> u64 { self.imp.count() } - fn iter(&self) -> impl Iterator + '_ { self.imp.iter() } - - type InsertCallbackId = PointsInsertCallbackId; +/// Indexed column accessor struct for the table `PrivateTable`. +/// +/// Provides typed access to indexed columns for query building. +pub struct PrivateTableIxCols { +} - fn on_insert( - &self, - callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, - ) -> PointsInsertCallbackId { - PointsInsertCallbackId(self.imp.on_insert(Box::new(callback))) - } +impl __sdk::__query_builder::HasIxCols for PrivateTable { + type IxCols = PrivateTableIxCols; + fn ix_cols(table_name: &'static str) -> Self::IxCols { + PrivateTableIxCols { - fn remove_on_insert(&self, callback: PointsInsertCallbackId) { - self.imp.remove_on_insert(callback.0) + } } - - type DeleteCallbackId = PointsDeleteCallbackId; - - fn on_delete( - &self, - callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, - ) -> PointsDeleteCallbackId { - PointsDeleteCallbackId(self.imp.on_delete(Box::new(callback))) - } - - fn remove_on_delete(&self, callback: PointsDeleteCallbackId) { - self.imp.remove_on_delete(callback.0) - } -} - -#[doc(hidden)] -pub(super) fn register_table(client_cache: &mut __sdk::ClientCache) { - - let _table = client_cache.get_or_make_table::("points"); -} - -#[doc(hidden)] -pub(super) fn parse_table_update( - raw_updates: __ws::TableUpdate<__ws::BsatnFormat>, -) -> __sdk::Result<__sdk::TableUpdate> { - __sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| { - __sdk::InternalError::failed_parse( - "TableUpdate", - "TableUpdate", - ).with_cause(e).into() - }) -} - - #[allow(non_camel_case_types)] - /// Extension trait for query builder access to the table `Point`. - /// - /// Implemented for [`__sdk::QueryTableAccessor`]. - pub trait pointsQueryTableAccess { - #[allow(non_snake_case)] - /// Get a query builder for the table `Point`. - fn points(&self) -> __sdk::__query_builder::Table; - } - - impl pointsQueryTableAccess for __sdk::QueryTableAccessor { - fn points(&self) -> __sdk::__query_builder::Table { - __sdk::__query_builder::Table::new("points") - } - } - -''' -"private_table_table.rs" = ''' -// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE -// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. - -#![allow(unused, clippy::all)] -use spacetimedb_sdk::__codegen::{ - self as __sdk, - __lib, - __sats, - __ws, -}; -use super::private_table_type::PrivateTable; - -/// Table handle for the table `private_table`. -/// -/// Obtain a handle from the [`PrivateTableTableAccess::private_table`] method on [`super::RemoteTables`], -/// like `ctx.db.private_table()`. -/// -/// Users are encouraged not to explicitly reference this type, -/// but to directly chain method calls, -/// like `ctx.db.private_table().on_insert(...)`. -pub struct PrivateTableTableHandle<'ctx> { - imp: __sdk::TableHandle, - ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, -} - -#[allow(non_camel_case_types)] -/// Extension trait for access to the table `private_table`. -/// -/// Implemented for [`super::RemoteTables`]. -pub trait PrivateTableTableAccess { - #[allow(non_snake_case)] - /// Obtain a [`PrivateTableTableHandle`], which mediates access to the table `private_table`. - fn private_table(&self) -> PrivateTableTableHandle<'_>; -} - -impl PrivateTableTableAccess for super::RemoteTables { - fn private_table(&self) -> PrivateTableTableHandle<'_> { - PrivateTableTableHandle { - imp: self.imp.get_table::("private_table"), - ctx: std::marker::PhantomData, - } - } -} - -pub struct PrivateTableInsertCallbackId(__sdk::CallbackId); -pub struct PrivateTableDeleteCallbackId(__sdk::CallbackId); - -impl<'ctx> __sdk::Table for PrivateTableTableHandle<'ctx> { - type Row = PrivateTable; - type EventContext = super::EventContext; - - fn count(&self) -> u64 { self.imp.count() } - fn iter(&self) -> impl Iterator + '_ { self.imp.iter() } - - type InsertCallbackId = PrivateTableInsertCallbackId; - - fn on_insert( - &self, - callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, - ) -> PrivateTableInsertCallbackId { - PrivateTableInsertCallbackId(self.imp.on_insert(Box::new(callback))) - } - - fn remove_on_insert(&self, callback: PrivateTableInsertCallbackId) { - self.imp.remove_on_insert(callback.0) - } - - type DeleteCallbackId = PrivateTableDeleteCallbackId; - - fn on_delete( - &self, - callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, - ) -> PrivateTableDeleteCallbackId { - PrivateTableDeleteCallbackId(self.imp.on_delete(Box::new(callback))) - } - - fn remove_on_delete(&self, callback: PrivateTableDeleteCallbackId) { - self.imp.remove_on_delete(callback.0) - } -} - -#[doc(hidden)] -pub(super) fn register_table(client_cache: &mut __sdk::ClientCache) { - - let _table = client_cache.get_or_make_table::("private_table"); -} - -#[doc(hidden)] -pub(super) fn parse_table_update( - raw_updates: __ws::TableUpdate<__ws::BsatnFormat>, -) -> __sdk::Result<__sdk::TableUpdate> { - __sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| { - __sdk::InternalError::failed_parse( - "TableUpdate", - "TableUpdate", - ).with_cause(e).into() - }) -} - - #[allow(non_camel_case_types)] - /// Extension trait for query builder access to the table `PrivateTable`. - /// - /// Implemented for [`__sdk::QueryTableAccessor`]. - pub trait private_tableQueryTableAccess { - #[allow(non_snake_case)] - /// Get a query builder for the table `PrivateTable`. - fn private_table(&self) -> __sdk::__query_builder::Table; - } - - impl private_tableQueryTableAccess for __sdk::QueryTableAccessor { - fn private_table(&self) -> __sdk::__query_builder::Table { - __sdk::__query_builder::Table::new("private_table") - } - } - -''' -"private_table_type.rs" = ''' -// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE -// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. - -#![allow(unused, clippy::all)] -use spacetimedb_sdk::__codegen::{ - self as __sdk, - __lib, - __sats, - __ws, -}; - - -#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)] -#[sats(crate = __lib)] -pub struct PrivateTable { - pub name: String, -} - - -impl __sdk::InModule for PrivateTable { - type Module = super::RemoteModule; -} - - -/// Column accessor struct for the table `PrivateTable`. -/// -/// Provides typed access to columns for query building. -pub struct PrivateTableCols { - pub name: __sdk::__query_builder::Col, -} - -impl __sdk::__query_builder::HasCols for PrivateTable { - type Cols = PrivateTableCols; - fn cols(table_name: &'static str) -> Self::Cols { - PrivateTableCols { - name: __sdk::__query_builder::Col::new(table_name, "name"), - - } - } -} - -/// Indexed column accessor struct for the table `PrivateTable`. -/// -/// Provides typed access to indexed columns for query building. -pub struct PrivateTableIxCols { -} - -impl __sdk::__query_builder::HasIxCols for PrivateTable { - type IxCols = PrivateTableIxCols; - fn ix_cols(table_name: &'static str) -> Self::IxCols { - PrivateTableIxCols { - - } - } -} +} ''' "query_private_reducer.rs" = ''' @@ -3929,171 +3318,6 @@ impl __sdk::__query_builder::HasIxCols for RemoveTable { } } -''' -"repeating_test_arg_table.rs" = ''' -// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE -// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. - -#![allow(unused, clippy::all)] -use spacetimedb_sdk::__codegen::{ - self as __sdk, - __lib, - __sats, - __ws, -}; -use super::repeating_test_arg_type::RepeatingTestArg; - -/// Table handle for the table `repeating_test_arg`. -/// -/// Obtain a handle from the [`RepeatingTestArgTableAccess::repeating_test_arg`] method on [`super::RemoteTables`], -/// like `ctx.db.repeating_test_arg()`. -/// -/// Users are encouraged not to explicitly reference this type, -/// but to directly chain method calls, -/// like `ctx.db.repeating_test_arg().on_insert(...)`. -pub struct RepeatingTestArgTableHandle<'ctx> { - imp: __sdk::TableHandle, - ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, -} - -#[allow(non_camel_case_types)] -/// Extension trait for access to the table `repeating_test_arg`. -/// -/// Implemented for [`super::RemoteTables`]. -pub trait RepeatingTestArgTableAccess { - #[allow(non_snake_case)] - /// Obtain a [`RepeatingTestArgTableHandle`], which mediates access to the table `repeating_test_arg`. - fn repeating_test_arg(&self) -> RepeatingTestArgTableHandle<'_>; -} - -impl RepeatingTestArgTableAccess for super::RemoteTables { - fn repeating_test_arg(&self) -> RepeatingTestArgTableHandle<'_> { - RepeatingTestArgTableHandle { - imp: self.imp.get_table::("repeating_test_arg"), - ctx: std::marker::PhantomData, - } - } -} - -pub struct RepeatingTestArgInsertCallbackId(__sdk::CallbackId); -pub struct RepeatingTestArgDeleteCallbackId(__sdk::CallbackId); - -impl<'ctx> __sdk::Table for RepeatingTestArgTableHandle<'ctx> { - type Row = RepeatingTestArg; - type EventContext = super::EventContext; - - fn count(&self) -> u64 { self.imp.count() } - fn iter(&self) -> impl Iterator + '_ { self.imp.iter() } - - type InsertCallbackId = RepeatingTestArgInsertCallbackId; - - fn on_insert( - &self, - callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, - ) -> RepeatingTestArgInsertCallbackId { - RepeatingTestArgInsertCallbackId(self.imp.on_insert(Box::new(callback))) - } - - fn remove_on_insert(&self, callback: RepeatingTestArgInsertCallbackId) { - self.imp.remove_on_insert(callback.0) - } - - type DeleteCallbackId = RepeatingTestArgDeleteCallbackId; - - fn on_delete( - &self, - callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, - ) -> RepeatingTestArgDeleteCallbackId { - RepeatingTestArgDeleteCallbackId(self.imp.on_delete(Box::new(callback))) - } - - fn remove_on_delete(&self, callback: RepeatingTestArgDeleteCallbackId) { - self.imp.remove_on_delete(callback.0) - } -} - -#[doc(hidden)] -pub(super) fn register_table(client_cache: &mut __sdk::ClientCache) { - - let _table = client_cache.get_or_make_table::("repeating_test_arg"); - _table.add_unique_constraint::("scheduled_id", |row| &row.scheduled_id); -} -pub struct RepeatingTestArgUpdateCallbackId(__sdk::CallbackId); - -impl<'ctx> __sdk::TableWithPrimaryKey for RepeatingTestArgTableHandle<'ctx> { - type UpdateCallbackId = RepeatingTestArgUpdateCallbackId; - - fn on_update( - &self, - callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static, - ) -> RepeatingTestArgUpdateCallbackId { - RepeatingTestArgUpdateCallbackId(self.imp.on_update(Box::new(callback))) - } - - fn remove_on_update(&self, callback: RepeatingTestArgUpdateCallbackId) { - self.imp.remove_on_update(callback.0) - } -} - - -#[doc(hidden)] -pub(super) fn parse_table_update( - raw_updates: __ws::TableUpdate<__ws::BsatnFormat>, -) -> __sdk::Result<__sdk::TableUpdate> { - __sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| { - __sdk::InternalError::failed_parse( - "TableUpdate", - "TableUpdate", - ).with_cause(e).into() - }) -} - - /// Access to the `scheduled_id` unique index on the table `repeating_test_arg`, - /// which allows point queries on the field of the same name - /// via the [`RepeatingTestArgScheduledIdUnique::find`] method. - /// - /// Users are encouraged not to explicitly reference this type, - /// but to directly chain method calls, - /// like `ctx.db.repeating_test_arg().scheduled_id().find(...)`. - pub struct RepeatingTestArgScheduledIdUnique<'ctx> { - imp: __sdk::UniqueConstraintHandle, - phantom: std::marker::PhantomData<&'ctx super::RemoteTables>, - } - - impl<'ctx> RepeatingTestArgTableHandle<'ctx> { - /// Get a handle on the `scheduled_id` unique index on the table `repeating_test_arg`. - pub fn scheduled_id(&self) -> RepeatingTestArgScheduledIdUnique<'ctx> { - RepeatingTestArgScheduledIdUnique { - imp: self.imp.get_unique_constraint::("scheduled_id"), - phantom: std::marker::PhantomData, - } - } - } - - impl<'ctx> RepeatingTestArgScheduledIdUnique<'ctx> { - /// Find the subscribed row whose `scheduled_id` column value is equal to `col_val`, - /// if such a row is present in the client cache. - pub fn find(&self, col_val: &u64) -> Option { - self.imp.find(col_val) - } - } - - #[allow(non_camel_case_types)] - /// Extension trait for query builder access to the table `RepeatingTestArg`. - /// - /// Implemented for [`__sdk::QueryTableAccessor`]. - pub trait repeating_test_argQueryTableAccess { - #[allow(non_snake_case)] - /// Get a query builder for the table `RepeatingTestArg`. - fn repeating_test_arg(&self) -> __sdk::__query_builder::Table; - } - - impl repeating_test_argQueryTableAccess for __sdk::QueryTableAccessor { - fn repeating_test_arg(&self) -> __sdk::__query_builder::Table { - __sdk::__query_builder::Table::new("repeating_test_arg") - } - } - ''' "repeating_test_arg_type.rs" = ''' // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE @@ -4272,231 +3496,60 @@ pub trait say_hello { /// Cancel a callback previously registered by [`Self::on_say_hello`], /// causing it not to run in the future. fn remove_on_say_hello(&self, callback: SayHelloCallbackId); -} - -impl say_hello for super::RemoteReducers { - fn say_hello(&self, ) -> __sdk::Result<()> { - self.imp.call_reducer("say_hello", SayHelloArgs { }) - } - fn on_say_hello( - &self, - mut callback: impl FnMut(&super::ReducerEventContext, ) + Send + 'static, - ) -> SayHelloCallbackId { - SayHelloCallbackId(self.imp.on_reducer( - "say_hello", - Box::new(move |ctx: &super::ReducerEventContext| { - #[allow(irrefutable_let_patterns)] - let super::ReducerEventContext { - event: __sdk::ReducerEvent { - reducer: super::Reducer::SayHello { - - }, - .. - }, - .. - } = ctx else { unreachable!() }; - callback(ctx, ) - }), - )) - } - fn remove_on_say_hello(&self, callback: SayHelloCallbackId) { - self.imp.remove_on_reducer("say_hello", callback.0) - } -} - -#[allow(non_camel_case_types)] -#[doc(hidden)] -/// Extension trait for setting the call-flags for the reducer `say_hello`. -/// -/// Implemented for [`super::SetReducerFlags`]. -/// -/// This type is currently unstable and may be removed without a major version bump. -pub trait set_flags_for_say_hello { - /// Set the call-reducer flags for the reducer `say_hello` to `flags`. - /// - /// This type is currently unstable and may be removed without a major version bump. - fn say_hello(&self, flags: __ws::CallReducerFlags); -} - -impl set_flags_for_say_hello for super::SetReducerFlags { - fn say_hello(&self, flags: __ws::CallReducerFlags) { - self.imp.set_call_reducer_flags("say_hello", flags); - } -} - -''' -"sleep_one_second_procedure.rs" = ''' -// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE -// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. - -#![allow(unused, clippy::all)] -use spacetimedb_sdk::__codegen::{ - self as __sdk, - __lib, - __sats, - __ws, -}; - - -#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)] -#[sats(crate = __lib)] - struct SleepOneSecondArgs { - } - - -impl __sdk::InModule for SleepOneSecondArgs { - type Module = super::RemoteModule; -} - -#[allow(non_camel_case_types)] -/// Extension trait for access to the procedure `sleep_one_second`. -/// -/// Implemented for [`super::RemoteProcedures`]. -pub trait sleep_one_second { - fn sleep_one_second(&self, ) { - self.sleep_one_second_then( |_, _| {}); - } - - fn sleep_one_second_then( - &self, - - __callback: impl FnOnce(&super::ProcedureEventContext, Result<(), __sdk::InternalError>) + Send + 'static, - ); -} - -impl sleep_one_second for super::RemoteProcedures { - fn sleep_one_second_then( - &self, - - __callback: impl FnOnce(&super::ProcedureEventContext, Result<(), __sdk::InternalError>) + Send + 'static, - ) { - self.imp.invoke_procedure_with_callback::<_, ()>( - "sleep_one_second", - SleepOneSecondArgs { }, - __callback, - ); - } -} - -''' -"table_to_remove_table.rs" = ''' -// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE -// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. - -#![allow(unused, clippy::all)] -use spacetimedb_sdk::__codegen::{ - self as __sdk, - __lib, - __sats, - __ws, -}; -use super::remove_table_type::RemoveTable; - -/// Table handle for the table `table_to_remove`. -/// -/// Obtain a handle from the [`TableToRemoveTableAccess::table_to_remove`] method on [`super::RemoteTables`], -/// like `ctx.db.table_to_remove()`. -/// -/// Users are encouraged not to explicitly reference this type, -/// but to directly chain method calls, -/// like `ctx.db.table_to_remove().on_insert(...)`. -pub struct TableToRemoveTableHandle<'ctx> { - imp: __sdk::TableHandle, - ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, -} - -#[allow(non_camel_case_types)] -/// Extension trait for access to the table `table_to_remove`. -/// -/// Implemented for [`super::RemoteTables`]. -pub trait TableToRemoveTableAccess { - #[allow(non_snake_case)] - /// Obtain a [`TableToRemoveTableHandle`], which mediates access to the table `table_to_remove`. - fn table_to_remove(&self) -> TableToRemoveTableHandle<'_>; -} - -impl TableToRemoveTableAccess for super::RemoteTables { - fn table_to_remove(&self) -> TableToRemoveTableHandle<'_> { - TableToRemoveTableHandle { - imp: self.imp.get_table::("table_to_remove"), - ctx: std::marker::PhantomData, - } - } -} - -pub struct TableToRemoveInsertCallbackId(__sdk::CallbackId); -pub struct TableToRemoveDeleteCallbackId(__sdk::CallbackId); - -impl<'ctx> __sdk::Table for TableToRemoveTableHandle<'ctx> { - type Row = RemoveTable; - type EventContext = super::EventContext; - - fn count(&self) -> u64 { self.imp.count() } - fn iter(&self) -> impl Iterator + '_ { self.imp.iter() } - - type InsertCallbackId = TableToRemoveInsertCallbackId; - - fn on_insert( - &self, - callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, - ) -> TableToRemoveInsertCallbackId { - TableToRemoveInsertCallbackId(self.imp.on_insert(Box::new(callback))) - } - - fn remove_on_insert(&self, callback: TableToRemoveInsertCallbackId) { - self.imp.remove_on_insert(callback.0) - } - - type DeleteCallbackId = TableToRemoveDeleteCallbackId; +} - fn on_delete( +impl say_hello for super::RemoteReducers { + fn say_hello(&self, ) -> __sdk::Result<()> { + self.imp.call_reducer("say_hello", SayHelloArgs { }) + } + fn on_say_hello( &self, - callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, - ) -> TableToRemoveDeleteCallbackId { - TableToRemoveDeleteCallbackId(self.imp.on_delete(Box::new(callback))) + mut callback: impl FnMut(&super::ReducerEventContext, ) + Send + 'static, + ) -> SayHelloCallbackId { + SayHelloCallbackId(self.imp.on_reducer( + "say_hello", + Box::new(move |ctx: &super::ReducerEventContext| { + #[allow(irrefutable_let_patterns)] + let super::ReducerEventContext { + event: __sdk::ReducerEvent { + reducer: super::Reducer::SayHello { + + }, + .. + }, + .. + } = ctx else { unreachable!() }; + callback(ctx, ) + }), + )) } - - fn remove_on_delete(&self, callback: TableToRemoveDeleteCallbackId) { - self.imp.remove_on_delete(callback.0) + fn remove_on_say_hello(&self, callback: SayHelloCallbackId) { + self.imp.remove_on_reducer("say_hello", callback.0) } } +#[allow(non_camel_case_types)] #[doc(hidden)] -pub(super) fn register_table(client_cache: &mut __sdk::ClientCache) { - - let _table = client_cache.get_or_make_table::("table_to_remove"); +/// Extension trait for setting the call-flags for the reducer `say_hello`. +/// +/// Implemented for [`super::SetReducerFlags`]. +/// +/// This type is currently unstable and may be removed without a major version bump. +pub trait set_flags_for_say_hello { + /// Set the call-reducer flags for the reducer `say_hello` to `flags`. + /// + /// This type is currently unstable and may be removed without a major version bump. + fn say_hello(&self, flags: __ws::CallReducerFlags); } -#[doc(hidden)] -pub(super) fn parse_table_update( - raw_updates: __ws::TableUpdate<__ws::BsatnFormat>, -) -> __sdk::Result<__sdk::TableUpdate> { - __sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| { - __sdk::InternalError::failed_parse( - "TableUpdate", - "TableUpdate", - ).with_cause(e).into() - }) +impl set_flags_for_say_hello for super::SetReducerFlags { + fn say_hello(&self, flags: __ws::CallReducerFlags) { + self.imp.set_call_reducer_flags("say_hello", flags); + } } - #[allow(non_camel_case_types)] - /// Extension trait for query builder access to the table `RemoveTable`. - /// - /// Implemented for [`__sdk::QueryTableAccessor`]. - pub trait table_to_removeQueryTableAccess { - #[allow(non_snake_case)] - /// Get a query builder for the table `RemoveTable`. - fn table_to_remove(&self) -> __sdk::__query_builder::Table; - } - - impl table_to_removeQueryTableAccess for __sdk::QueryTableAccessor { - fn table_to_remove(&self) -> __sdk::__query_builder::Table { - __sdk::__query_builder::Table::new("table_to_remove") - } - } - ''' -"test_a_table.rs" = ''' +"sleep_one_second_procedure.rs" = ''' // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. @@ -4507,111 +3560,48 @@ use spacetimedb_sdk::__codegen::{ __sats, __ws, }; -use super::test_a_type::TestA; - -/// Table handle for the table `test_a`. -/// -/// Obtain a handle from the [`TestATableAccess::test_a`] method on [`super::RemoteTables`], -/// like `ctx.db.test_a()`. -/// -/// Users are encouraged not to explicitly reference this type, -/// but to directly chain method calls, -/// like `ctx.db.test_a().on_insert(...)`. -pub struct TestATableHandle<'ctx> { - imp: __sdk::TableHandle, - ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, -} -#[allow(non_camel_case_types)] -/// Extension trait for access to the table `test_a`. -/// -/// Implemented for [`super::RemoteTables`]. -pub trait TestATableAccess { - #[allow(non_snake_case)] - /// Obtain a [`TestATableHandle`], which mediates access to the table `test_a`. - fn test_a(&self) -> TestATableHandle<'_>; -} -impl TestATableAccess for super::RemoteTables { - fn test_a(&self) -> TestATableHandle<'_> { - TestATableHandle { - imp: self.imp.get_table::("test_a"), - ctx: std::marker::PhantomData, - } +#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)] +#[sats(crate = __lib)] + struct SleepOneSecondArgs { } -} - -pub struct TestAInsertCallbackId(__sdk::CallbackId); -pub struct TestADeleteCallbackId(__sdk::CallbackId); - -impl<'ctx> __sdk::Table for TestATableHandle<'ctx> { - type Row = TestA; - type EventContext = super::EventContext; - - fn count(&self) -> u64 { self.imp.count() } - fn iter(&self) -> impl Iterator + '_ { self.imp.iter() } - type InsertCallbackId = TestAInsertCallbackId; - fn on_insert( - &self, - callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, - ) -> TestAInsertCallbackId { - TestAInsertCallbackId(self.imp.on_insert(Box::new(callback))) - } +impl __sdk::InModule for SleepOneSecondArgs { + type Module = super::RemoteModule; +} - fn remove_on_insert(&self, callback: TestAInsertCallbackId) { - self.imp.remove_on_insert(callback.0) +#[allow(non_camel_case_types)] +/// Extension trait for access to the procedure `sleep_one_second`. +/// +/// Implemented for [`super::RemoteProcedures`]. +pub trait sleep_one_second { + fn sleep_one_second(&self, ) { + self.sleep_one_second_then( |_, _| {}); } - type DeleteCallbackId = TestADeleteCallbackId; - - fn on_delete( + fn sleep_one_second_then( &self, - callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, - ) -> TestADeleteCallbackId { - TestADeleteCallbackId(self.imp.on_delete(Box::new(callback))) - } - - fn remove_on_delete(&self, callback: TestADeleteCallbackId) { - self.imp.remove_on_delete(callback.0) - } -} - -#[doc(hidden)] -pub(super) fn register_table(client_cache: &mut __sdk::ClientCache) { - - let _table = client_cache.get_or_make_table::("test_a"); + + __callback: impl FnOnce(&super::ProcedureEventContext, Result<(), __sdk::InternalError>) + Send + 'static, + ); } -#[doc(hidden)] -pub(super) fn parse_table_update( - raw_updates: __ws::TableUpdate<__ws::BsatnFormat>, -) -> __sdk::Result<__sdk::TableUpdate> { - __sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| { - __sdk::InternalError::failed_parse( - "TableUpdate", - "TableUpdate", - ).with_cause(e).into() - }) +impl sleep_one_second for super::RemoteProcedures { + fn sleep_one_second_then( + &self, + + __callback: impl FnOnce(&super::ProcedureEventContext, Result<(), __sdk::InternalError>) + Send + 'static, + ) { + self.imp.invoke_procedure_with_callback::<_, ()>( + "sleep_one_second", + SleepOneSecondArgs { }, + __callback, + ); + } } - #[allow(non_camel_case_types)] - /// Extension trait for query builder access to the table `TestA`. - /// - /// Implemented for [`__sdk::QueryTableAccessor`]. - pub trait test_aQueryTableAccess { - #[allow(non_snake_case)] - /// Get a query builder for the table `TestA`. - fn test_a(&self) -> __sdk::__query_builder::Table; - } - - impl test_aQueryTableAccess for __sdk::QueryTableAccessor { - fn test_a(&self) -> __sdk::__query_builder::Table { - __sdk::__query_builder::Table::new("test_a") - } - } - ''' "test_a_type.rs" = ''' // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE @@ -4985,171 +3975,6 @@ impl __sdk::__query_builder::HasIxCols for TestD { } } -''' -"test_e_table.rs" = ''' -// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE -// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. - -#![allow(unused, clippy::all)] -use spacetimedb_sdk::__codegen::{ - self as __sdk, - __lib, - __sats, - __ws, -}; -use super::test_e_type::TestE; - -/// Table handle for the table `test_e`. -/// -/// Obtain a handle from the [`TestETableAccess::test_e`] method on [`super::RemoteTables`], -/// like `ctx.db.test_e()`. -/// -/// Users are encouraged not to explicitly reference this type, -/// but to directly chain method calls, -/// like `ctx.db.test_e().on_insert(...)`. -pub struct TestETableHandle<'ctx> { - imp: __sdk::TableHandle, - ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, -} - -#[allow(non_camel_case_types)] -/// Extension trait for access to the table `test_e`. -/// -/// Implemented for [`super::RemoteTables`]. -pub trait TestETableAccess { - #[allow(non_snake_case)] - /// Obtain a [`TestETableHandle`], which mediates access to the table `test_e`. - fn test_e(&self) -> TestETableHandle<'_>; -} - -impl TestETableAccess for super::RemoteTables { - fn test_e(&self) -> TestETableHandle<'_> { - TestETableHandle { - imp: self.imp.get_table::("test_e"), - ctx: std::marker::PhantomData, - } - } -} - -pub struct TestEInsertCallbackId(__sdk::CallbackId); -pub struct TestEDeleteCallbackId(__sdk::CallbackId); - -impl<'ctx> __sdk::Table for TestETableHandle<'ctx> { - type Row = TestE; - type EventContext = super::EventContext; - - fn count(&self) -> u64 { self.imp.count() } - fn iter(&self) -> impl Iterator + '_ { self.imp.iter() } - - type InsertCallbackId = TestEInsertCallbackId; - - fn on_insert( - &self, - callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, - ) -> TestEInsertCallbackId { - TestEInsertCallbackId(self.imp.on_insert(Box::new(callback))) - } - - fn remove_on_insert(&self, callback: TestEInsertCallbackId) { - self.imp.remove_on_insert(callback.0) - } - - type DeleteCallbackId = TestEDeleteCallbackId; - - fn on_delete( - &self, - callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, - ) -> TestEDeleteCallbackId { - TestEDeleteCallbackId(self.imp.on_delete(Box::new(callback))) - } - - fn remove_on_delete(&self, callback: TestEDeleteCallbackId) { - self.imp.remove_on_delete(callback.0) - } -} - -#[doc(hidden)] -pub(super) fn register_table(client_cache: &mut __sdk::ClientCache) { - - let _table = client_cache.get_or_make_table::("test_e"); - _table.add_unique_constraint::("id", |row| &row.id); -} -pub struct TestEUpdateCallbackId(__sdk::CallbackId); - -impl<'ctx> __sdk::TableWithPrimaryKey for TestETableHandle<'ctx> { - type UpdateCallbackId = TestEUpdateCallbackId; - - fn on_update( - &self, - callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static, - ) -> TestEUpdateCallbackId { - TestEUpdateCallbackId(self.imp.on_update(Box::new(callback))) - } - - fn remove_on_update(&self, callback: TestEUpdateCallbackId) { - self.imp.remove_on_update(callback.0) - } -} - - -#[doc(hidden)] -pub(super) fn parse_table_update( - raw_updates: __ws::TableUpdate<__ws::BsatnFormat>, -) -> __sdk::Result<__sdk::TableUpdate> { - __sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| { - __sdk::InternalError::failed_parse( - "TableUpdate", - "TableUpdate", - ).with_cause(e).into() - }) -} - - /// Access to the `id` unique index on the table `test_e`, - /// which allows point queries on the field of the same name - /// via the [`TestEIdUnique::find`] method. - /// - /// Users are encouraged not to explicitly reference this type, - /// but to directly chain method calls, - /// like `ctx.db.test_e().id().find(...)`. - pub struct TestEIdUnique<'ctx> { - imp: __sdk::UniqueConstraintHandle, - phantom: std::marker::PhantomData<&'ctx super::RemoteTables>, - } - - impl<'ctx> TestETableHandle<'ctx> { - /// Get a handle on the `id` unique index on the table `test_e`. - pub fn id(&self) -> TestEIdUnique<'ctx> { - TestEIdUnique { - imp: self.imp.get_unique_constraint::("id"), - phantom: std::marker::PhantomData, - } - } - } - - impl<'ctx> TestEIdUnique<'ctx> { - /// Find the subscribed row whose `id` column value is equal to `col_val`, - /// if such a row is present in the client cache. - pub fn find(&self, col_val: &u64) -> Option { - self.imp.find(col_val) - } - } - - #[allow(non_camel_case_types)] - /// Extension trait for query builder access to the table `TestE`. - /// - /// Implemented for [`__sdk::QueryTableAccessor`]. - pub trait test_eQueryTableAccess { - #[allow(non_snake_case)] - /// Get a query builder for the table `TestE`. - fn test_e(&self) -> __sdk::__query_builder::Table; - } - - impl test_eQueryTableAccess for __sdk::QueryTableAccessor { - fn test_e(&self) -> __sdk::__query_builder::Table { - __sdk::__query_builder::Table::new("test_e") - } - } - ''' "test_e_type.rs" = ''' // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE diff --git a/crates/codegen/tests/snapshots/codegen__codegen_typescript.snap b/crates/codegen/tests/snapshots/codegen__codegen_typescript.snap index d3df905c700..f5ae325d55c 100644 --- a/crates/codegen/tests/snapshots/codegen__codegen_typescript.snap +++ b/crates/codegen/tests/snapshots/codegen__codegen_typescript.snap @@ -1,5 +1,6 @@ --- source: crates/codegen/tests/codegen.rs +assertion_line: 37 expression: outfiles --- "add_player_reducer.ts" = ''' @@ -165,24 +166,6 @@ import { export const params = { }; export const returnType = __t.string()''' -"has_special_stuff_table.ts" = ''' -// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE -// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. - -/* eslint-disable */ -/* tslint:disable */ -import { - TypeBuilder as __TypeBuilder, - t as __t, - type AlgebraicTypeType as __AlgebraicTypeType, - type Infer as __Infer, -} from "spacetimedb"; - -export default __t.row({ - identity: __t.identity(), - connectionId: __t.connectionId().name("connection_id"), -}); -''' "has_special_stuff_type.ts" = ''' // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. @@ -276,32 +259,16 @@ import * as WithTxProcedure from "./with_tx_procedure"; export { WithTxProcedure }; // Import and reexport all table handle types -import HasSpecialStuffRow from "./has_special_stuff_table"; -export { HasSpecialStuffRow }; import LoggedOutPlayerRow from "./logged_out_player_table"; export { LoggedOutPlayerRow }; import MyPlayerRow from "./my_player_table"; export { MyPlayerRow }; import PersonRow from "./person_table"; export { PersonRow }; -import PkMultiIdentityRow from "./pk_multi_identity_table"; -export { PkMultiIdentityRow }; import PlayerRow from "./player_table"; export { PlayerRow }; -import PointsRow from "./points_table"; -export { PointsRow }; -import PrivateTableRow from "./private_table_table"; -export { PrivateTableRow }; -import RepeatingTestArgRow from "./repeating_test_arg_table"; -export { RepeatingTestArgRow }; -import TableToRemoveRow from "./table_to_remove_table"; -export { TableToRemoveRow }; -import TestARow from "./test_a_table"; -export { TestARow }; import TestDRow from "./test_d_table"; export { TestDRow }; -import TestERow from "./test_e_table"; -export { TestERow }; import TestFRow from "./test_f_table"; export { TestFRow }; @@ -343,13 +310,6 @@ export { NamespaceTestF }; /** The schema information for all tables in this module. This is defined the same was as the tables would have been defined in the server. */ const tablesSchema = __schema( - __table({ - name: 'has_special_stuff', - indexes: [ - ], - constraints: [ - ], - }, HasSpecialStuffRow), __table({ name: 'logged_out_player', indexes: [ @@ -383,21 +343,6 @@ const tablesSchema = __schema( { name: 'person_id_key', constraint: 'unique', columns: ['id'] }, ], }, PersonRow), - __table({ - name: 'pk_multi_identity', - indexes: [ - { name: 'id', algorithm: 'btree', columns: [ - 'id', - ] }, - { name: 'other', algorithm: 'btree', columns: [ - 'other', - ] }, - ], - constraints: [ - { name: 'pk_multi_identity_id_key', constraint: 'unique', columns: ['id'] }, - { name: 'pk_multi_identity_other_key', constraint: 'unique', columns: ['other'] }, - ], - }, PkMultiIdentityRow), __table({ name: 'player', indexes: [ @@ -417,52 +362,6 @@ const tablesSchema = __schema( { name: 'player_player_id_key', constraint: 'unique', columns: ['playerId'] }, ], }, PlayerRow), - __table({ - name: 'points', - indexes: [ - { name: 'multi_column_index', algorithm: 'btree', columns: [ - 'x', - 'y', - ] }, - ], - constraints: [ - ], - }, PointsRow), - __table({ - name: 'private_table', - indexes: [ - ], - constraints: [ - ], - }, PrivateTableRow), - __table({ - name: 'repeating_test_arg', - indexes: [ - { name: 'scheduled_id', algorithm: 'btree', columns: [ - 'scheduledId', - ] }, - ], - constraints: [ - { name: 'repeating_test_arg_scheduled_id_key', constraint: 'unique', columns: ['scheduledId'] }, - ], - }, RepeatingTestArgRow), - __table({ - name: 'table_to_remove', - indexes: [ - ], - constraints: [ - ], - }, TableToRemoveRow), - __table({ - name: 'test_a', - indexes: [ - { name: 'foo', algorithm: 'btree', columns: [ - 'x', - ] }, - ], - constraints: [ - ], - }, TestARow), __table({ name: 'test_d', indexes: [ @@ -470,20 +369,6 @@ const tablesSchema = __schema( constraints: [ ], }, TestDRow), - __table({ - name: 'test_e', - indexes: [ - { name: 'id', algorithm: 'btree', columns: [ - 'id', - ] }, - { name: 'name', algorithm: 'btree', columns: [ - 'name', - ] }, - ], - constraints: [ - { name: 'test_e_id_key', constraint: 'unique', columns: ['id'] }, - ], - }, TestERow), __table({ name: 'test_f', indexes: [ @@ -732,24 +617,6 @@ export default __t.object("Person", { }); -''' -"pk_multi_identity_table.ts" = ''' -// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE -// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. - -/* eslint-disable */ -/* tslint:disable */ -import { - TypeBuilder as __TypeBuilder, - t as __t, - type AlgebraicTypeType as __AlgebraicTypeType, - type Infer as __Infer, -} from "spacetimedb"; - -export default __t.row({ - id: __t.u32().primaryKey(), - other: __t.u32(), -}); ''' "pk_multi_identity_type.ts" = ''' // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE @@ -830,41 +697,6 @@ export default __t.object("Point", { }); -''' -"points_table.ts" = ''' -// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE -// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. - -/* eslint-disable */ -/* tslint:disable */ -import { - TypeBuilder as __TypeBuilder, - t as __t, - type AlgebraicTypeType as __AlgebraicTypeType, - type Infer as __Infer, -} from "spacetimedb"; - -export default __t.row({ - x: __t.i64(), - y: __t.i64(), -}); -''' -"private_table_table.ts" = ''' -// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE -// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. - -/* eslint-disable */ -/* tslint:disable */ -import { - TypeBuilder as __TypeBuilder, - t as __t, - type AlgebraicTypeType as __AlgebraicTypeType, - type Infer as __Infer, -} from "spacetimedb"; - -export default __t.row({ - name: __t.string(), -}); ''' "private_table_type.ts" = ''' // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE @@ -918,25 +750,6 @@ export default __t.object("RemoveTable", { }); -''' -"repeating_test_arg_table.ts" = ''' -// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE -// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. - -/* eslint-disable */ -/* tslint:disable */ -import { - TypeBuilder as __TypeBuilder, - t as __t, - type AlgebraicTypeType as __AlgebraicTypeType, - type Infer as __Infer, -} from "spacetimedb"; - -export default __t.row({ - scheduledId: __t.u64().primaryKey().name("scheduled_id"), - scheduledAt: __t.scheduleAt().name("scheduled_at"), - prevTime: __t.timestamp().name("prev_time"), -}); ''' "repeating_test_arg_type.ts" = ''' // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE @@ -1009,42 +822,6 @@ import { export const params = { }; export const returnType = __t.unit()''' -"table_to_remove_table.ts" = ''' -// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE -// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. - -/* eslint-disable */ -/* tslint:disable */ -import { - TypeBuilder as __TypeBuilder, - t as __t, - type AlgebraicTypeType as __AlgebraicTypeType, - type Infer as __Infer, -} from "spacetimedb"; - -export default __t.row({ - id: __t.u32(), -}); -''' -"test_a_table.ts" = ''' -// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE -// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. - -/* eslint-disable */ -/* tslint:disable */ -import { - TypeBuilder as __TypeBuilder, - t as __t, - type AlgebraicTypeType as __AlgebraicTypeType, - type Infer as __Infer, -} from "spacetimedb"; - -export default __t.row({ - x: __t.u32(), - y: __t.u32(), - z: __t.string(), -}); -''' "test_a_type.ts" = ''' // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. @@ -1143,24 +920,6 @@ export default __t.object("TestD", { }); -''' -"test_e_table.ts" = ''' -// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE -// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. - -/* eslint-disable */ -/* tslint:disable */ -import { - TypeBuilder as __TypeBuilder, - t as __t, - type AlgebraicTypeType as __AlgebraicTypeType, - type Infer as __Infer, -} from "spacetimedb"; - -export default __t.row({ - id: __t.u64().primaryKey(), - name: __t.string(), -}); ''' "test_e_type.ts" = ''' // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE diff --git a/demo/Blackholio/client-unity/Assets/Scripts/autogen/SpacetimeDBClient.g.cs b/demo/Blackholio/client-unity/Assets/Scripts/autogen/SpacetimeDBClient.g.cs index 1e684b35787..287eb2f65d2 100644 --- a/demo/Blackholio/client-unity/Assets/Scripts/autogen/SpacetimeDBClient.g.cs +++ b/demo/Blackholio/client-unity/Assets/Scripts/autogen/SpacetimeDBClient.g.cs @@ -1,7 +1,7 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.11.2 (commit 97aa69de8942102a6ea0b50dfadea3cd15e44f50). +// This was generated using spacetimedb cli version 1.12.0 (commit 819069447d9034135872ce2bdc28722c4e5e46b6). #nullable enable @@ -29,18 +29,10 @@ public sealed partial class RemoteTables : RemoteTablesBase public RemoteTables(DbConnection conn) { AddTable(Circle = new(conn)); - AddTable(CircleDecayTimer = new(conn)); - AddTable(CircleRecombineTimer = new(conn)); AddTable(Config = new(conn)); - AddTable(ConsumeEntityTimer = new(conn)); AddTable(Entity = new(conn)); AddTable(Food = new(conn)); - AddTable(LoggedOutCircle = new(conn)); - AddTable(LoggedOutEntity = new(conn)); - AddTable(LoggedOutPlayer = new(conn)); - AddTable(MoveAllPlayersTimer = new(conn)); AddTable(Player = new(conn)); - AddTable(SpawnFoodTimer = new(conn)); } } @@ -594,18 +586,10 @@ public sealed class QueryBuilder public sealed class From { public global::SpacetimeDB.Table Circle() => new("circle", new CircleCols("circle"), new CircleIxCols("circle")); - public global::SpacetimeDB.Table CircleDecayTimer() => new("circle_decay_timer", new CircleDecayTimerCols("circle_decay_timer"), new CircleDecayTimerIxCols("circle_decay_timer")); - public global::SpacetimeDB.Table CircleRecombineTimer() => new("circle_recombine_timer", new CircleRecombineTimerCols("circle_recombine_timer"), new CircleRecombineTimerIxCols("circle_recombine_timer")); public global::SpacetimeDB.Table Config() => new("config", new ConfigCols("config"), new ConfigIxCols("config")); - public global::SpacetimeDB.Table ConsumeEntityTimer() => new("consume_entity_timer", new ConsumeEntityTimerCols("consume_entity_timer"), new ConsumeEntityTimerIxCols("consume_entity_timer")); public global::SpacetimeDB.Table Entity() => new("entity", new EntityCols("entity"), new EntityIxCols("entity")); public global::SpacetimeDB.Table Food() => new("food", new FoodCols("food"), new FoodIxCols("food")); - public global::SpacetimeDB.Table LoggedOutCircle() => new("logged_out_circle", new LoggedOutCircleCols("logged_out_circle"), new LoggedOutCircleIxCols("logged_out_circle")); - public global::SpacetimeDB.Table LoggedOutEntity() => new("logged_out_entity", new LoggedOutEntityCols("logged_out_entity"), new LoggedOutEntityIxCols("logged_out_entity")); - public global::SpacetimeDB.Table LoggedOutPlayer() => new("logged_out_player", new LoggedOutPlayerCols("logged_out_player"), new LoggedOutPlayerIxCols("logged_out_player")); - public global::SpacetimeDB.Table MoveAllPlayersTimer() => new("move_all_players_timer", new MoveAllPlayersTimerCols("move_all_players_timer"), new MoveAllPlayersTimerIxCols("move_all_players_timer")); public global::SpacetimeDB.Table Player() => new("player", new PlayerCols("player"), new PlayerIxCols("player")); - public global::SpacetimeDB.Table SpawnFoodTimer() => new("spawn_food_timer", new SpawnFoodTimerCols("spawn_food_timer"), new SpawnFoodTimerIxCols("spawn_food_timer")); } public sealed class TypedSubscriptionBuilder diff --git a/demo/Blackholio/client-unity/Assets/Scripts/autogen/Tables/CircleDecayTimer.g.cs b/demo/Blackholio/client-unity/Assets/Scripts/autogen/Tables/CircleDecayTimer.g.cs deleted file mode 100644 index 09cd0b1053b..00000000000 --- a/demo/Blackholio/client-unity/Assets/Scripts/autogen/Tables/CircleDecayTimer.g.cs +++ /dev/null @@ -1,61 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE -// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. - -#nullable enable - -using System; -using SpacetimeDB.BSATN; -using SpacetimeDB.ClientApi; -using System.Collections.Generic; -using System.Runtime.Serialization; - -namespace SpacetimeDB.Types -{ - public sealed partial class RemoteTables - { - public sealed class CircleDecayTimerHandle : RemoteTableHandle - { - protected override string RemoteTableName => "circle_decay_timer"; - - public sealed class ScheduledIdUniqueIndex : UniqueIndexBase - { - protected override ulong GetKey(CircleDecayTimer row) => row.ScheduledId; - - public ScheduledIdUniqueIndex(CircleDecayTimerHandle table) : base(table) { } - } - - public readonly ScheduledIdUniqueIndex ScheduledId; - - internal CircleDecayTimerHandle(DbConnection conn) : base(conn) - { - ScheduledId = new(this); - } - - protected override object GetPrimaryKey(CircleDecayTimer row) => row.ScheduledId; - } - - public readonly CircleDecayTimerHandle CircleDecayTimer; - } - - public sealed class CircleDecayTimerCols - { - public global::SpacetimeDB.Col ScheduledId { get; } - public global::SpacetimeDB.Col ScheduledAt { get; } - - public CircleDecayTimerCols(string tableName) - { - ScheduledId = new global::SpacetimeDB.Col(tableName, "scheduled_id"); - ScheduledAt = new global::SpacetimeDB.Col(tableName, "scheduled_at"); - } - } - - public sealed class CircleDecayTimerIxCols - { - public global::SpacetimeDB.IxCol ScheduledId { get; } - - public CircleDecayTimerIxCols(string tableName) - { - ScheduledId = new global::SpacetimeDB.IxCol(tableName, "scheduled_id"); - } - } -} diff --git a/demo/Blackholio/client-unity/Assets/Scripts/autogen/Tables/CircleDecayTimer.g.cs.meta b/demo/Blackholio/client-unity/Assets/Scripts/autogen/Tables/CircleDecayTimer.g.cs.meta deleted file mode 100644 index 883147192bc..00000000000 --- a/demo/Blackholio/client-unity/Assets/Scripts/autogen/Tables/CircleDecayTimer.g.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 57d3843cee8f7d94b9d02c442f4aaf0e -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/demo/Blackholio/client-unity/Assets/Scripts/autogen/Tables/CircleRecombineTimer.g.cs b/demo/Blackholio/client-unity/Assets/Scripts/autogen/Tables/CircleRecombineTimer.g.cs deleted file mode 100644 index 5bb48e1918b..00000000000 --- a/demo/Blackholio/client-unity/Assets/Scripts/autogen/Tables/CircleRecombineTimer.g.cs +++ /dev/null @@ -1,63 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE -// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. - -#nullable enable - -using System; -using SpacetimeDB.BSATN; -using SpacetimeDB.ClientApi; -using System.Collections.Generic; -using System.Runtime.Serialization; - -namespace SpacetimeDB.Types -{ - public sealed partial class RemoteTables - { - public sealed class CircleRecombineTimerHandle : RemoteTableHandle - { - protected override string RemoteTableName => "circle_recombine_timer"; - - public sealed class ScheduledIdUniqueIndex : UniqueIndexBase - { - protected override ulong GetKey(CircleRecombineTimer row) => row.ScheduledId; - - public ScheduledIdUniqueIndex(CircleRecombineTimerHandle table) : base(table) { } - } - - public readonly ScheduledIdUniqueIndex ScheduledId; - - internal CircleRecombineTimerHandle(DbConnection conn) : base(conn) - { - ScheduledId = new(this); - } - - protected override object GetPrimaryKey(CircleRecombineTimer row) => row.ScheduledId; - } - - public readonly CircleRecombineTimerHandle CircleRecombineTimer; - } - - public sealed class CircleRecombineTimerCols - { - public global::SpacetimeDB.Col ScheduledId { get; } - public global::SpacetimeDB.Col ScheduledAt { get; } - public global::SpacetimeDB.Col PlayerId { get; } - - public CircleRecombineTimerCols(string tableName) - { - ScheduledId = new global::SpacetimeDB.Col(tableName, "scheduled_id"); - ScheduledAt = new global::SpacetimeDB.Col(tableName, "scheduled_at"); - PlayerId = new global::SpacetimeDB.Col(tableName, "player_id"); - } - } - - public sealed class CircleRecombineTimerIxCols - { - public global::SpacetimeDB.IxCol ScheduledId { get; } - - public CircleRecombineTimerIxCols(string tableName) - { - ScheduledId = new global::SpacetimeDB.IxCol(tableName, "scheduled_id"); - } - } -} diff --git a/demo/Blackholio/client-unity/Assets/Scripts/autogen/Tables/CircleRecombineTimer.g.cs.meta b/demo/Blackholio/client-unity/Assets/Scripts/autogen/Tables/CircleRecombineTimer.g.cs.meta deleted file mode 100644 index 937e29e9fa3..00000000000 --- a/demo/Blackholio/client-unity/Assets/Scripts/autogen/Tables/CircleRecombineTimer.g.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 90a420ed2322bf140be4f3111ab47ea7 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/demo/Blackholio/client-unity/Assets/Scripts/autogen/Tables/ConsumeEntityTimer.g.cs b/demo/Blackholio/client-unity/Assets/Scripts/autogen/Tables/ConsumeEntityTimer.g.cs deleted file mode 100644 index 991112b45b6..00000000000 --- a/demo/Blackholio/client-unity/Assets/Scripts/autogen/Tables/ConsumeEntityTimer.g.cs +++ /dev/null @@ -1,65 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE -// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. - -#nullable enable - -using System; -using SpacetimeDB.BSATN; -using SpacetimeDB.ClientApi; -using System.Collections.Generic; -using System.Runtime.Serialization; - -namespace SpacetimeDB.Types -{ - public sealed partial class RemoteTables - { - public sealed class ConsumeEntityTimerHandle : RemoteTableHandle - { - protected override string RemoteTableName => "consume_entity_timer"; - - public sealed class ScheduledIdUniqueIndex : UniqueIndexBase - { - protected override ulong GetKey(ConsumeEntityTimer row) => row.ScheduledId; - - public ScheduledIdUniqueIndex(ConsumeEntityTimerHandle table) : base(table) { } - } - - public readonly ScheduledIdUniqueIndex ScheduledId; - - internal ConsumeEntityTimerHandle(DbConnection conn) : base(conn) - { - ScheduledId = new(this); - } - - protected override object GetPrimaryKey(ConsumeEntityTimer row) => row.ScheduledId; - } - - public readonly ConsumeEntityTimerHandle ConsumeEntityTimer; - } - - public sealed class ConsumeEntityTimerCols - { - public global::SpacetimeDB.Col ScheduledId { get; } - public global::SpacetimeDB.Col ScheduledAt { get; } - public global::SpacetimeDB.Col ConsumedEntityId { get; } - public global::SpacetimeDB.Col ConsumerEntityId { get; } - - public ConsumeEntityTimerCols(string tableName) - { - ScheduledId = new global::SpacetimeDB.Col(tableName, "scheduled_id"); - ScheduledAt = new global::SpacetimeDB.Col(tableName, "scheduled_at"); - ConsumedEntityId = new global::SpacetimeDB.Col(tableName, "consumed_entity_id"); - ConsumerEntityId = new global::SpacetimeDB.Col(tableName, "consumer_entity_id"); - } - } - - public sealed class ConsumeEntityTimerIxCols - { - public global::SpacetimeDB.IxCol ScheduledId { get; } - - public ConsumeEntityTimerIxCols(string tableName) - { - ScheduledId = new global::SpacetimeDB.IxCol(tableName, "scheduled_id"); - } - } -} diff --git a/demo/Blackholio/client-unity/Assets/Scripts/autogen/Tables/ConsumeEntityTimer.g.cs.meta b/demo/Blackholio/client-unity/Assets/Scripts/autogen/Tables/ConsumeEntityTimer.g.cs.meta deleted file mode 100644 index def7a8b8eb1..00000000000 --- a/demo/Blackholio/client-unity/Assets/Scripts/autogen/Tables/ConsumeEntityTimer.g.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 78647a76650941c468cc02c4fda86386 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/demo/Blackholio/client-unity/Assets/Scripts/autogen/Tables/LoggedOutCircle.g.cs b/demo/Blackholio/client-unity/Assets/Scripts/autogen/Tables/LoggedOutCircle.g.cs deleted file mode 100644 index 4c56218c271..00000000000 --- a/demo/Blackholio/client-unity/Assets/Scripts/autogen/Tables/LoggedOutCircle.g.cs +++ /dev/null @@ -1,79 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE -// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. - -#nullable enable - -using System; -using SpacetimeDB.BSATN; -using SpacetimeDB.ClientApi; -using System.Collections.Generic; -using System.Runtime.Serialization; - -namespace SpacetimeDB.Types -{ - public sealed partial class RemoteTables - { - public sealed class LoggedOutCircleHandle : RemoteTableHandle - { - protected override string RemoteTableName => "logged_out_circle"; - - public sealed class EntityIdUniqueIndex : UniqueIndexBase - { - protected override int GetKey(Circle row) => row.EntityId; - - public EntityIdUniqueIndex(LoggedOutCircleHandle table) : base(table) { } - } - - public readonly EntityIdUniqueIndex EntityId; - - public sealed class PlayerIdIndex : BTreeIndexBase - { - protected override int GetKey(Circle row) => row.PlayerId; - - public PlayerIdIndex(LoggedOutCircleHandle table) : base(table) { } - } - - public readonly PlayerIdIndex PlayerId; - - internal LoggedOutCircleHandle(DbConnection conn) : base(conn) - { - EntityId = new(this); - PlayerId = new(this); - } - - protected override object GetPrimaryKey(Circle row) => row.EntityId; - } - - public readonly LoggedOutCircleHandle LoggedOutCircle; - } - - public sealed class LoggedOutCircleCols - { - public global::SpacetimeDB.Col EntityId { get; } - public global::SpacetimeDB.Col PlayerId { get; } - public global::SpacetimeDB.Col Direction { get; } - public global::SpacetimeDB.Col Speed { get; } - public global::SpacetimeDB.Col LastSplitTime { get; } - - public LoggedOutCircleCols(string tableName) - { - EntityId = new global::SpacetimeDB.Col(tableName, "entity_id"); - PlayerId = new global::SpacetimeDB.Col(tableName, "player_id"); - Direction = new global::SpacetimeDB.Col(tableName, "direction"); - Speed = new global::SpacetimeDB.Col(tableName, "speed"); - LastSplitTime = new global::SpacetimeDB.Col(tableName, "last_split_time"); - } - } - - public sealed class LoggedOutCircleIxCols - { - public global::SpacetimeDB.IxCol EntityId { get; } - public global::SpacetimeDB.IxCol PlayerId { get; } - - public LoggedOutCircleIxCols(string tableName) - { - EntityId = new global::SpacetimeDB.IxCol(tableName, "entity_id"); - PlayerId = new global::SpacetimeDB.IxCol(tableName, "player_id"); - } - } -} diff --git a/demo/Blackholio/client-unity/Assets/Scripts/autogen/Tables/LoggedOutCircle.g.cs.meta b/demo/Blackholio/client-unity/Assets/Scripts/autogen/Tables/LoggedOutCircle.g.cs.meta deleted file mode 100644 index dd99a0a9956..00000000000 --- a/demo/Blackholio/client-unity/Assets/Scripts/autogen/Tables/LoggedOutCircle.g.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 4c19f6af775194970b23ef28055872de -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/demo/Blackholio/client-unity/Assets/Scripts/autogen/Tables/LoggedOutEntity.g.cs b/demo/Blackholio/client-unity/Assets/Scripts/autogen/Tables/LoggedOutEntity.g.cs deleted file mode 100644 index 00eec8e2b12..00000000000 --- a/demo/Blackholio/client-unity/Assets/Scripts/autogen/Tables/LoggedOutEntity.g.cs +++ /dev/null @@ -1,63 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE -// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. - -#nullable enable - -using System; -using SpacetimeDB.BSATN; -using SpacetimeDB.ClientApi; -using System.Collections.Generic; -using System.Runtime.Serialization; - -namespace SpacetimeDB.Types -{ - public sealed partial class RemoteTables - { - public sealed class LoggedOutEntityHandle : RemoteTableHandle - { - protected override string RemoteTableName => "logged_out_entity"; - - public sealed class EntityIdUniqueIndex : UniqueIndexBase - { - protected override int GetKey(Entity row) => row.EntityId; - - public EntityIdUniqueIndex(LoggedOutEntityHandle table) : base(table) { } - } - - public readonly EntityIdUniqueIndex EntityId; - - internal LoggedOutEntityHandle(DbConnection conn) : base(conn) - { - EntityId = new(this); - } - - protected override object GetPrimaryKey(Entity row) => row.EntityId; - } - - public readonly LoggedOutEntityHandle LoggedOutEntity; - } - - public sealed class LoggedOutEntityCols - { - public global::SpacetimeDB.Col EntityId { get; } - public global::SpacetimeDB.Col Position { get; } - public global::SpacetimeDB.Col Mass { get; } - - public LoggedOutEntityCols(string tableName) - { - EntityId = new global::SpacetimeDB.Col(tableName, "entity_id"); - Position = new global::SpacetimeDB.Col(tableName, "position"); - Mass = new global::SpacetimeDB.Col(tableName, "mass"); - } - } - - public sealed class LoggedOutEntityIxCols - { - public global::SpacetimeDB.IxCol EntityId { get; } - - public LoggedOutEntityIxCols(string tableName) - { - EntityId = new global::SpacetimeDB.IxCol(tableName, "entity_id"); - } - } -} diff --git a/demo/Blackholio/client-unity/Assets/Scripts/autogen/Tables/LoggedOutEntity.g.cs.meta b/demo/Blackholio/client-unity/Assets/Scripts/autogen/Tables/LoggedOutEntity.g.cs.meta deleted file mode 100644 index 29ed5cea05c..00000000000 --- a/demo/Blackholio/client-unity/Assets/Scripts/autogen/Tables/LoggedOutEntity.g.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 5571e411f0f7244f09db138c87ad7fa6 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/demo/Blackholio/client-unity/Assets/Scripts/autogen/Tables/LoggedOutPlayer.g.cs b/demo/Blackholio/client-unity/Assets/Scripts/autogen/Tables/LoggedOutPlayer.g.cs deleted file mode 100644 index 035f671053e..00000000000 --- a/demo/Blackholio/client-unity/Assets/Scripts/autogen/Tables/LoggedOutPlayer.g.cs +++ /dev/null @@ -1,75 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE -// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. - -#nullable enable - -using System; -using SpacetimeDB.BSATN; -using SpacetimeDB.ClientApi; -using System.Collections.Generic; -using System.Runtime.Serialization; - -namespace SpacetimeDB.Types -{ - public sealed partial class RemoteTables - { - public sealed class LoggedOutPlayerHandle : RemoteTableHandle - { - protected override string RemoteTableName => "logged_out_player"; - - public sealed class IdentityUniqueIndex : UniqueIndexBase - { - protected override SpacetimeDB.Identity GetKey(Player row) => row.Identity; - - public IdentityUniqueIndex(LoggedOutPlayerHandle table) : base(table) { } - } - - public readonly IdentityUniqueIndex Identity; - - public sealed class PlayerIdUniqueIndex : UniqueIndexBase - { - protected override int GetKey(Player row) => row.PlayerId; - - public PlayerIdUniqueIndex(LoggedOutPlayerHandle table) : base(table) { } - } - - public readonly PlayerIdUniqueIndex PlayerId; - - internal LoggedOutPlayerHandle(DbConnection conn) : base(conn) - { - Identity = new(this); - PlayerId = new(this); - } - - protected override object GetPrimaryKey(Player row) => row.Identity; - } - - public readonly LoggedOutPlayerHandle LoggedOutPlayer; - } - - public sealed class LoggedOutPlayerCols - { - public global::SpacetimeDB.Col Identity { get; } - public global::SpacetimeDB.Col PlayerId { get; } - public global::SpacetimeDB.Col Name { get; } - - public LoggedOutPlayerCols(string tableName) - { - Identity = new global::SpacetimeDB.Col(tableName, "identity"); - PlayerId = new global::SpacetimeDB.Col(tableName, "player_id"); - Name = new global::SpacetimeDB.Col(tableName, "name"); - } - } - - public sealed class LoggedOutPlayerIxCols - { - public global::SpacetimeDB.IxCol Identity { get; } - public global::SpacetimeDB.IxCol PlayerId { get; } - - public LoggedOutPlayerIxCols(string tableName) - { - Identity = new global::SpacetimeDB.IxCol(tableName, "identity"); - PlayerId = new global::SpacetimeDB.IxCol(tableName, "player_id"); - } - } -} diff --git a/demo/Blackholio/client-unity/Assets/Scripts/autogen/Tables/LoggedOutPlayer.g.cs.meta b/demo/Blackholio/client-unity/Assets/Scripts/autogen/Tables/LoggedOutPlayer.g.cs.meta deleted file mode 100644 index 076508dbb7e..00000000000 --- a/demo/Blackholio/client-unity/Assets/Scripts/autogen/Tables/LoggedOutPlayer.g.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: fec3f4e4213dc304dadb74b8fee558da -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/demo/Blackholio/client-unity/Assets/Scripts/autogen/Tables/MoveAllPlayersTimer.g.cs b/demo/Blackholio/client-unity/Assets/Scripts/autogen/Tables/MoveAllPlayersTimer.g.cs deleted file mode 100644 index b84ba4c72ef..00000000000 --- a/demo/Blackholio/client-unity/Assets/Scripts/autogen/Tables/MoveAllPlayersTimer.g.cs +++ /dev/null @@ -1,61 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE -// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. - -#nullable enable - -using System; -using SpacetimeDB.BSATN; -using SpacetimeDB.ClientApi; -using System.Collections.Generic; -using System.Runtime.Serialization; - -namespace SpacetimeDB.Types -{ - public sealed partial class RemoteTables - { - public sealed class MoveAllPlayersTimerHandle : RemoteTableHandle - { - protected override string RemoteTableName => "move_all_players_timer"; - - public sealed class ScheduledIdUniqueIndex : UniqueIndexBase - { - protected override ulong GetKey(MoveAllPlayersTimer row) => row.ScheduledId; - - public ScheduledIdUniqueIndex(MoveAllPlayersTimerHandle table) : base(table) { } - } - - public readonly ScheduledIdUniqueIndex ScheduledId; - - internal MoveAllPlayersTimerHandle(DbConnection conn) : base(conn) - { - ScheduledId = new(this); - } - - protected override object GetPrimaryKey(MoveAllPlayersTimer row) => row.ScheduledId; - } - - public readonly MoveAllPlayersTimerHandle MoveAllPlayersTimer; - } - - public sealed class MoveAllPlayersTimerCols - { - public global::SpacetimeDB.Col ScheduledId { get; } - public global::SpacetimeDB.Col ScheduledAt { get; } - - public MoveAllPlayersTimerCols(string tableName) - { - ScheduledId = new global::SpacetimeDB.Col(tableName, "scheduled_id"); - ScheduledAt = new global::SpacetimeDB.Col(tableName, "scheduled_at"); - } - } - - public sealed class MoveAllPlayersTimerIxCols - { - public global::SpacetimeDB.IxCol ScheduledId { get; } - - public MoveAllPlayersTimerIxCols(string tableName) - { - ScheduledId = new global::SpacetimeDB.IxCol(tableName, "scheduled_id"); - } - } -} diff --git a/demo/Blackholio/client-unity/Assets/Scripts/autogen/Tables/MoveAllPlayersTimer.g.cs.meta b/demo/Blackholio/client-unity/Assets/Scripts/autogen/Tables/MoveAllPlayersTimer.g.cs.meta deleted file mode 100644 index b88d73cef22..00000000000 --- a/demo/Blackholio/client-unity/Assets/Scripts/autogen/Tables/MoveAllPlayersTimer.g.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 037804098ca85634abc83a5cfe85292d -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/demo/Blackholio/client-unity/Assets/Scripts/autogen/Tables/SpawnFoodTimer.g.cs b/demo/Blackholio/client-unity/Assets/Scripts/autogen/Tables/SpawnFoodTimer.g.cs deleted file mode 100644 index 5a8c134a48b..00000000000 --- a/demo/Blackholio/client-unity/Assets/Scripts/autogen/Tables/SpawnFoodTimer.g.cs +++ /dev/null @@ -1,61 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE -// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. - -#nullable enable - -using System; -using SpacetimeDB.BSATN; -using SpacetimeDB.ClientApi; -using System.Collections.Generic; -using System.Runtime.Serialization; - -namespace SpacetimeDB.Types -{ - public sealed partial class RemoteTables - { - public sealed class SpawnFoodTimerHandle : RemoteTableHandle - { - protected override string RemoteTableName => "spawn_food_timer"; - - public sealed class ScheduledIdUniqueIndex : UniqueIndexBase - { - protected override ulong GetKey(SpawnFoodTimer row) => row.ScheduledId; - - public ScheduledIdUniqueIndex(SpawnFoodTimerHandle table) : base(table) { } - } - - public readonly ScheduledIdUniqueIndex ScheduledId; - - internal SpawnFoodTimerHandle(DbConnection conn) : base(conn) - { - ScheduledId = new(this); - } - - protected override object GetPrimaryKey(SpawnFoodTimer row) => row.ScheduledId; - } - - public readonly SpawnFoodTimerHandle SpawnFoodTimer; - } - - public sealed class SpawnFoodTimerCols - { - public global::SpacetimeDB.Col ScheduledId { get; } - public global::SpacetimeDB.Col ScheduledAt { get; } - - public SpawnFoodTimerCols(string tableName) - { - ScheduledId = new global::SpacetimeDB.Col(tableName, "scheduled_id"); - ScheduledAt = new global::SpacetimeDB.Col(tableName, "scheduled_at"); - } - } - - public sealed class SpawnFoodTimerIxCols - { - public global::SpacetimeDB.IxCol ScheduledId { get; } - - public SpawnFoodTimerIxCols(string tableName) - { - ScheduledId = new global::SpacetimeDB.IxCol(tableName, "scheduled_id"); - } - } -} diff --git a/demo/Blackholio/client-unity/Assets/Scripts/autogen/Tables/SpawnFoodTimer.g.cs.meta b/demo/Blackholio/client-unity/Assets/Scripts/autogen/Tables/SpawnFoodTimer.g.cs.meta deleted file mode 100644 index 478b3ff8e68..00000000000 --- a/demo/Blackholio/client-unity/Assets/Scripts/autogen/Tables/SpawnFoodTimer.g.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 954d9d0ae83400248b5aec8d7b407bbc -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/demo/Blackholio/client-unreal/Source/client_unreal/Private/ModuleBindings/SpacetimeDBClient.g.cpp b/demo/Blackholio/client-unreal/Source/client_unreal/Private/ModuleBindings/SpacetimeDBClient.g.cpp index 33552184eed..c3f5355ed41 100644 --- a/demo/Blackholio/client-unreal/Source/client_unreal/Private/ModuleBindings/SpacetimeDBClient.g.cpp +++ b/demo/Blackholio/client-unreal/Source/client_unreal/Private/ModuleBindings/SpacetimeDBClient.g.cpp @@ -4,19 +4,11 @@ #include "ModuleBindings/SpacetimeDBClient.g.h" #include "DBCache/WithBsatn.h" #include "BSATN/UEBSATNHelpers.h" -#include "ModuleBindings/Tables/ConsumeEntityTimerTable.g.h" #include "ModuleBindings/Tables/CircleTable.g.h" -#include "ModuleBindings/Tables/FoodTable.g.h" -#include "ModuleBindings/Tables/CircleTable.g.h" -#include "ModuleBindings/Tables/SpawnFoodTimerTable.g.h" #include "ModuleBindings/Tables/ConfigTable.g.h" -#include "ModuleBindings/Tables/PlayerTable.g.h" #include "ModuleBindings/Tables/EntityTable.g.h" +#include "ModuleBindings/Tables/FoodTable.g.h" #include "ModuleBindings/Tables/PlayerTable.g.h" -#include "ModuleBindings/Tables/CircleDecayTimerTable.g.h" -#include "ModuleBindings/Tables/CircleRecombineTimerTable.g.h" -#include "ModuleBindings/Tables/EntityTable.g.h" -#include "ModuleBindings/Tables/MoveAllPlayersTimerTable.g.h" static FReducer DecodeReducer(const FReducerEvent& Event) { @@ -108,19 +100,14 @@ UDbConnection::UDbConnection(const FObjectInitializer& ObjectInitializer) : Supe Reducers->SetCallReducerFlags = SetReducerFlags; Reducers->Conn = this; - RegisterTable(TEXT("consume_entity_timer"), Db->ConsumeEntityTimer); + Procedures = ObjectInitializer.CreateDefaultSubobject(this, TEXT("RemoteProcedures")); + Procedures->Conn = this; + RegisterTable(TEXT("circle"), Db->Circle); - RegisterTable(TEXT("food"), Db->Food); - RegisterTable(TEXT("logged_out_circle"), Db->LoggedOutCircle); - RegisterTable(TEXT("spawn_food_timer"), Db->SpawnFoodTimer); RegisterTable(TEXT("config"), Db->Config); - RegisterTable(TEXT("player"), Db->Player); - RegisterTable(TEXT("logged_out_entity"), Db->LoggedOutEntity); - RegisterTable(TEXT("logged_out_player"), Db->LoggedOutPlayer); - RegisterTable(TEXT("circle_decay_timer"), Db->CircleDecayTimer); - RegisterTable(TEXT("circle_recombine_timer"), Db->CircleRecombineTimer); RegisterTable(TEXT("entity"), Db->Entity); - RegisterTable(TEXT("move_all_players_timer"), Db->MoveAllPlayersTimer); + RegisterTable(TEXT("food"), Db->Food); + RegisterTable(TEXT("player"), Db->Player); } FContextBase::FContextBase(UDbConnection* InConn) @@ -128,6 +115,7 @@ FContextBase::FContextBase(UDbConnection* InConn) Db = InConn->Db; Reducers = InConn->Reducers; SetReducerFlags = InConn->SetReducerFlags; + Procedures = InConn->Procedures; Conn = InConn; } bool FContextBase::IsActive() const @@ -155,35 +143,19 @@ void URemoteTables::Initialize() { /** Creating tables */ - ConsumeEntityTimer = NewObject(this); Circle = NewObject(this); - Food = NewObject(this); - LoggedOutCircle = NewObject(this); - SpawnFoodTimer = NewObject(this); Config = NewObject(this); - Player = NewObject(this); - LoggedOutEntity = NewObject(this); - LoggedOutPlayer = NewObject(this); - CircleDecayTimer = NewObject(this); - CircleRecombineTimer = NewObject(this); Entity = NewObject(this); - MoveAllPlayersTimer = NewObject(this); + Food = NewObject(this); + Player = NewObject(this); /**/ /** Initialization */ - ConsumeEntityTimer->PostInitialize(); Circle->PostInitialize(); - Food->PostInitialize(); - LoggedOutCircle->PostInitialize(); - SpawnFoodTimer->PostInitialize(); Config->PostInitialize(); - Player->PostInitialize(); - LoggedOutEntity->PostInitialize(); - LoggedOutPlayer->PostInitialize(); - CircleDecayTimer->PostInitialize(); - CircleRecombineTimer->PostInitialize(); Entity->PostInitialize(); - MoveAllPlayersTimer->PostInitialize(); + Food->PostInitialize(); + Player->PostInitialize(); /**/ } @@ -265,6 +237,21 @@ bool URemoteReducers::InvokeCircleDecay(const FReducerEventContext& Context, con return true; } +bool URemoteReducers::InvokeCircleDecayWithArgs(const FReducerEventContext& Context, const FCircleDecayArgs& Args) +{ + if (!OnCircleDecay.IsBound()) + { + if (InternalOnUnhandledReducerError.IsBound()) + { + InternalOnUnhandledReducerError.Broadcast(Context, TEXT("No handler registered for CircleDecay")); + } + return false; + } + + OnCircleDecay.Broadcast(Context, Args.Timer); + return true; +} + void URemoteReducers::CircleRecombine(const FCircleRecombineTimerType& Timer) { if (!Conn) @@ -294,6 +281,21 @@ bool URemoteReducers::InvokeCircleRecombine(const FReducerEventContext& Context, return true; } +bool URemoteReducers::InvokeCircleRecombineWithArgs(const FReducerEventContext& Context, const FCircleRecombineArgs& Args) +{ + if (!OnCircleRecombine.IsBound()) + { + if (InternalOnUnhandledReducerError.IsBound()) + { + InternalOnUnhandledReducerError.Broadcast(Context, TEXT("No handler registered for CircleRecombine")); + } + return false; + } + + OnCircleRecombine.Broadcast(Context, Args.Timer); + return true; +} + void URemoteReducers::Connect() { if (!Conn) @@ -323,6 +325,21 @@ bool URemoteReducers::InvokeConnect(const FReducerEventContext& Context, const U return true; } +bool URemoteReducers::InvokeConnectWithArgs(const FReducerEventContext& Context, const FConnectArgs& Args) +{ + if (!OnConnect.IsBound()) + { + if (InternalOnUnhandledReducerError.IsBound()) + { + InternalOnUnhandledReducerError.Broadcast(Context, TEXT("No handler registered for Connect")); + } + return false; + } + + OnConnect.Broadcast(Context); + return true; +} + void URemoteReducers::ConsumeEntity(const FConsumeEntityTimerType& Request) { if (!Conn) @@ -352,6 +369,21 @@ bool URemoteReducers::InvokeConsumeEntity(const FReducerEventContext& Context, c return true; } +bool URemoteReducers::InvokeConsumeEntityWithArgs(const FReducerEventContext& Context, const FConsumeEntityArgs& Args) +{ + if (!OnConsumeEntity.IsBound()) + { + if (InternalOnUnhandledReducerError.IsBound()) + { + InternalOnUnhandledReducerError.Broadcast(Context, TEXT("No handler registered for ConsumeEntity")); + } + return false; + } + + OnConsumeEntity.Broadcast(Context, Args.Request); + return true; +} + void URemoteReducers::Disconnect() { if (!Conn) @@ -381,6 +413,21 @@ bool URemoteReducers::InvokeDisconnect(const FReducerEventContext& Context, cons return true; } +bool URemoteReducers::InvokeDisconnectWithArgs(const FReducerEventContext& Context, const FDisconnectArgs& Args) +{ + if (!OnDisconnect.IsBound()) + { + if (InternalOnUnhandledReducerError.IsBound()) + { + InternalOnUnhandledReducerError.Broadcast(Context, TEXT("No handler registered for Disconnect")); + } + return false; + } + + OnDisconnect.Broadcast(Context); + return true; +} + void URemoteReducers::EnterGame(const FString& Name) { if (!Conn) @@ -410,6 +457,21 @@ bool URemoteReducers::InvokeEnterGame(const FReducerEventContext& Context, const return true; } +bool URemoteReducers::InvokeEnterGameWithArgs(const FReducerEventContext& Context, const FEnterGameArgs& Args) +{ + if (!OnEnterGame.IsBound()) + { + if (InternalOnUnhandledReducerError.IsBound()) + { + InternalOnUnhandledReducerError.Broadcast(Context, TEXT("No handler registered for EnterGame")); + } + return false; + } + + OnEnterGame.Broadcast(Context, Args.Name); + return true; +} + void URemoteReducers::MoveAllPlayers(const FMoveAllPlayersTimerType& Timer) { if (!Conn) @@ -439,6 +501,21 @@ bool URemoteReducers::InvokeMoveAllPlayers(const FReducerEventContext& Context, return true; } +bool URemoteReducers::InvokeMoveAllPlayersWithArgs(const FReducerEventContext& Context, const FMoveAllPlayersArgs& Args) +{ + if (!OnMoveAllPlayers.IsBound()) + { + if (InternalOnUnhandledReducerError.IsBound()) + { + InternalOnUnhandledReducerError.Broadcast(Context, TEXT("No handler registered for MoveAllPlayers")); + } + return false; + } + + OnMoveAllPlayers.Broadcast(Context, Args.Timer); + return true; +} + void URemoteReducers::PlayerSplit() { if (!Conn) @@ -468,6 +545,21 @@ bool URemoteReducers::InvokePlayerSplit(const FReducerEventContext& Context, con return true; } +bool URemoteReducers::InvokePlayerSplitWithArgs(const FReducerEventContext& Context, const FPlayerSplitArgs& Args) +{ + if (!OnPlayerSplit.IsBound()) + { + if (InternalOnUnhandledReducerError.IsBound()) + { + InternalOnUnhandledReducerError.Broadcast(Context, TEXT("No handler registered for PlayerSplit")); + } + return false; + } + + OnPlayerSplit.Broadcast(Context); + return true; +} + void URemoteReducers::Respawn() { if (!Conn) @@ -497,6 +589,21 @@ bool URemoteReducers::InvokeRespawn(const FReducerEventContext& Context, const U return true; } +bool URemoteReducers::InvokeRespawnWithArgs(const FReducerEventContext& Context, const FRespawnArgs& Args) +{ + if (!OnRespawn.IsBound()) + { + if (InternalOnUnhandledReducerError.IsBound()) + { + InternalOnUnhandledReducerError.Broadcast(Context, TEXT("No handler registered for Respawn")); + } + return false; + } + + OnRespawn.Broadcast(Context); + return true; +} + void URemoteReducers::SpawnFood(const FSpawnFoodTimerType& Timer) { if (!Conn) @@ -526,6 +633,21 @@ bool URemoteReducers::InvokeSpawnFood(const FReducerEventContext& Context, const return true; } +bool URemoteReducers::InvokeSpawnFoodWithArgs(const FReducerEventContext& Context, const FSpawnFoodArgs& Args) +{ + if (!OnSpawnFood.IsBound()) + { + if (InternalOnUnhandledReducerError.IsBound()) + { + InternalOnUnhandledReducerError.Broadcast(Context, TEXT("No handler registered for SpawnFood")); + } + return false; + } + + OnSpawnFood.Broadcast(Context, Args.Timer); + return true; +} + void URemoteReducers::Suicide() { if (!Conn) @@ -555,6 +677,21 @@ bool URemoteReducers::InvokeSuicide(const FReducerEventContext& Context, const U return true; } +bool URemoteReducers::InvokeSuicideWithArgs(const FReducerEventContext& Context, const FSuicideArgs& Args) +{ + if (!OnSuicide.IsBound()) + { + if (InternalOnUnhandledReducerError.IsBound()) + { + InternalOnUnhandledReducerError.Broadcast(Context, TEXT("No handler registered for Suicide")); + } + return false; + } + + OnSuicide.Broadcast(Context); + return true; +} + void URemoteReducers::UpdatePlayerInput(const FDbVector2Type& Direction) { if (!Conn) @@ -584,6 +721,21 @@ bool URemoteReducers::InvokeUpdatePlayerInput(const FReducerEventContext& Contex return true; } +bool URemoteReducers::InvokeUpdatePlayerInputWithArgs(const FReducerEventContext& Context, const FUpdatePlayerInputArgs& Args) +{ + if (!OnUpdatePlayerInput.IsBound()) + { + if (InternalOnUnhandledReducerError.IsBound()) + { + InternalOnUnhandledReducerError.Broadcast(Context, TEXT("No handler registered for UpdatePlayerInput")); + } + return false; + } + + OnUpdatePlayerInput.Broadcast(Context, Args.Direction); + return true; +} + void UDbConnection::PostInitProperties() { Super::PostInitProperties(); @@ -593,6 +745,12 @@ void UDbConnection::PostInitProperties() { Reducers->InternalOnUnhandledReducerError.AddDynamic(this, &UDbConnection::OnUnhandledReducerErrorHandler); } + + // Connect OnUnhandledProcedureError to Procedures.InternalOnUnhandledProcedureError + if (Procedures) + { + Procedures->InternalOnUnhandledProcedureError.AddDynamic(this, &UDbConnection::OnUnhandledProcedureErrorHandler); + } } UFUNCTION() @@ -604,6 +762,15 @@ void UDbConnection::OnUnhandledReducerErrorHandler(const FReducerEventContext& C } } +UFUNCTION() +void UDbConnection::OnUnhandledProcedureErrorHandler(const FProcedureEventContext& Context, const FString& Error) +{ + if (OnUnhandledProcedureError.IsBound()) + { + OnUnhandledProcedureError.Broadcast(Context, Error); + } +} + void UDbConnection::ReducerEvent(const FReducerEvent& Event) { if (!Reducers) { return; } @@ -626,92 +793,73 @@ void UDbConnection::ReducerEvent(const FReducerEvent& Event) if (ReducerName == TEXT("circle_decay")) { FCircleDecayArgs Args = ReducerEvent.Reducer.GetAsCircleDecay(); - UCircleDecayReducer* Reducer = NewObject(); - Reducer->Timer = Args.Timer; - Reducers->InvokeCircleDecay(Context, Reducer); + Reducers->InvokeCircleDecayWithArgs(Context, Args); return; } if (ReducerName == TEXT("circle_recombine")) { FCircleRecombineArgs Args = ReducerEvent.Reducer.GetAsCircleRecombine(); - UCircleRecombineReducer* Reducer = NewObject(); - Reducer->Timer = Args.Timer; - Reducers->InvokeCircleRecombine(Context, Reducer); + Reducers->InvokeCircleRecombineWithArgs(Context, Args); return; } if (ReducerName == TEXT("connect")) { FConnectArgs Args = ReducerEvent.Reducer.GetAsConnect(); - UConnectReducer* Reducer = NewObject(); - Reducers->InvokeConnect(Context, Reducer); + Reducers->InvokeConnectWithArgs(Context, Args); return; } if (ReducerName == TEXT("consume_entity")) { FConsumeEntityArgs Args = ReducerEvent.Reducer.GetAsConsumeEntity(); - UConsumeEntityReducer* Reducer = NewObject(); - Reducer->Request = Args.Request; - Reducers->InvokeConsumeEntity(Context, Reducer); + Reducers->InvokeConsumeEntityWithArgs(Context, Args); return; } if (ReducerName == TEXT("disconnect")) { FDisconnectArgs Args = ReducerEvent.Reducer.GetAsDisconnect(); - UDisconnectReducer* Reducer = NewObject(); - Reducers->InvokeDisconnect(Context, Reducer); + Reducers->InvokeDisconnectWithArgs(Context, Args); return; } if (ReducerName == TEXT("enter_game")) { FEnterGameArgs Args = ReducerEvent.Reducer.GetAsEnterGame(); - UEnterGameReducer* Reducer = NewObject(); - Reducer->Name = Args.Name; - Reducers->InvokeEnterGame(Context, Reducer); + Reducers->InvokeEnterGameWithArgs(Context, Args); return; } if (ReducerName == TEXT("move_all_players")) { FMoveAllPlayersArgs Args = ReducerEvent.Reducer.GetAsMoveAllPlayers(); - UMoveAllPlayersReducer* Reducer = NewObject(); - Reducer->Timer = Args.Timer; - Reducers->InvokeMoveAllPlayers(Context, Reducer); + Reducers->InvokeMoveAllPlayersWithArgs(Context, Args); return; } if (ReducerName == TEXT("player_split")) { FPlayerSplitArgs Args = ReducerEvent.Reducer.GetAsPlayerSplit(); - UPlayerSplitReducer* Reducer = NewObject(); - Reducers->InvokePlayerSplit(Context, Reducer); + Reducers->InvokePlayerSplitWithArgs(Context, Args); return; } if (ReducerName == TEXT("respawn")) { FRespawnArgs Args = ReducerEvent.Reducer.GetAsRespawn(); - URespawnReducer* Reducer = NewObject(); - Reducers->InvokeRespawn(Context, Reducer); + Reducers->InvokeRespawnWithArgs(Context, Args); return; } if (ReducerName == TEXT("spawn_food")) { FSpawnFoodArgs Args = ReducerEvent.Reducer.GetAsSpawnFood(); - USpawnFoodReducer* Reducer = NewObject(); - Reducer->Timer = Args.Timer; - Reducers->InvokeSpawnFood(Context, Reducer); + Reducers->InvokeSpawnFoodWithArgs(Context, Args); return; } if (ReducerName == TEXT("suicide")) { FSuicideArgs Args = ReducerEvent.Reducer.GetAsSuicide(); - USuicideReducer* Reducer = NewObject(); - Reducers->InvokeSuicide(Context, Reducer); + Reducers->InvokeSuicideWithArgs(Context, Args); return; } if (ReducerName == TEXT("update_player_input")) { FUpdatePlayerInputArgs Args = ReducerEvent.Reducer.GetAsUpdatePlayerInput(); - UUpdatePlayerInputReducer* Reducer = NewObject(); - Reducer->Direction = Args.Direction; - Reducers->InvokeUpdatePlayerInput(Context, Reducer); + Reducers->InvokeUpdatePlayerInputWithArgs(Context, Args); return; } @@ -737,6 +885,22 @@ void UDbConnection::ReducerEventFailed(const FReducerEvent& Event, const FString } } +void UDbConnection::ProcedureEventFailed(const FProcedureEvent& Event, const FString ErrorMessage) +{ + if (!Procedures) { return; } + + FClientUnrealProcedureEvent ProcedureEvent; + ProcedureEvent.Status = FSpacetimeDBProcedureStatus::FromStatus(Event.Status); + ProcedureEvent.Timestamp = Event.Timestamp; + + FProcedureEventContext Context(this, ProcedureEvent); + + if (Procedures->InternalOnUnhandledProcedureError.IsBound()) + { + Procedures->InternalOnUnhandledProcedureError.Broadcast(Context, ErrorMessage); + } +} + UDbConnectionBuilder* UDbConnection::Builder() { return NewObject(); diff --git a/demo/Blackholio/client-unreal/Source/client_unreal/Private/ModuleBindings/Tables/CircleDecayTimerTable.g.cpp b/demo/Blackholio/client-unreal/Source/client_unreal/Private/ModuleBindings/Tables/CircleDecayTimerTable.g.cpp deleted file mode 100644 index 3f843a1028e..00000000000 --- a/demo/Blackholio/client-unreal/Source/client_unreal/Private/ModuleBindings/Tables/CircleDecayTimerTable.g.cpp +++ /dev/null @@ -1,47 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE -// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. - -#include "ModuleBindings/Tables/CircleDecayTimerTable.g.h" -#include "DBCache/UniqueIndex.h" -#include "DBCache/BTreeUniqueIndex.h" -#include "DBCache/ClientCache.h" -#include "DBCache/TableCache.h" - -void UCircleDecayTimerTable::PostInitialize() -{ - /** Client cache init and setting up indexes*/ - Data = MakeShared>(); - - TSharedPtr> CircleDecayTimerTable = Data->GetOrAdd(TableName); - CircleDecayTimerTable->AddUniqueConstraint("scheduled_id", [](const FCircleDecayTimerType& Row) -> const uint64& { - return Row.ScheduledId; }); - - ScheduledId = NewObject(this); - ScheduledId->SetCache(CircleDecayTimerTable); - - /***/ -} - -FTableAppliedDiff UCircleDecayTimerTable::Update(TArray> InsertsRef, TArray> DeletesRef) -{ - FTableAppliedDiff Diff = BaseUpdate(InsertsRef, DeletesRef, Data, TableName); - - Diff.DeriveUpdatesByPrimaryKey( - [](const FCircleDecayTimerType& Row) - { - return Row.ScheduledId; - } - ); - - return Diff; -} - -int32 UCircleDecayTimerTable::Count() const -{ - return GetRowCountFromTable(Data, TableName); -} - -TArray UCircleDecayTimerTable::Iter() const -{ - return GetAllRowsFromTable(Data, TableName); -} diff --git a/demo/Blackholio/client-unreal/Source/client_unreal/Private/ModuleBindings/Tables/CircleRecombineTimerTable.g.cpp b/demo/Blackholio/client-unreal/Source/client_unreal/Private/ModuleBindings/Tables/CircleRecombineTimerTable.g.cpp deleted file mode 100644 index c79d81391bd..00000000000 --- a/demo/Blackholio/client-unreal/Source/client_unreal/Private/ModuleBindings/Tables/CircleRecombineTimerTable.g.cpp +++ /dev/null @@ -1,47 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE -// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. - -#include "ModuleBindings/Tables/CircleRecombineTimerTable.g.h" -#include "DBCache/UniqueIndex.h" -#include "DBCache/BTreeUniqueIndex.h" -#include "DBCache/ClientCache.h" -#include "DBCache/TableCache.h" - -void UCircleRecombineTimerTable::PostInitialize() -{ - /** Client cache init and setting up indexes*/ - Data = MakeShared>(); - - TSharedPtr> CircleRecombineTimerTable = Data->GetOrAdd(TableName); - CircleRecombineTimerTable->AddUniqueConstraint("scheduled_id", [](const FCircleRecombineTimerType& Row) -> const uint64& { - return Row.ScheduledId; }); - - ScheduledId = NewObject(this); - ScheduledId->SetCache(CircleRecombineTimerTable); - - /***/ -} - -FTableAppliedDiff UCircleRecombineTimerTable::Update(TArray> InsertsRef, TArray> DeletesRef) -{ - FTableAppliedDiff Diff = BaseUpdate(InsertsRef, DeletesRef, Data, TableName); - - Diff.DeriveUpdatesByPrimaryKey( - [](const FCircleRecombineTimerType& Row) - { - return Row.ScheduledId; - } - ); - - return Diff; -} - -int32 UCircleRecombineTimerTable::Count() const -{ - return GetRowCountFromTable(Data, TableName); -} - -TArray UCircleRecombineTimerTable::Iter() const -{ - return GetAllRowsFromTable(Data, TableName); -} diff --git a/demo/Blackholio/client-unreal/Source/client_unreal/Private/ModuleBindings/Tables/ConsumeEntityTimerTable.g.cpp b/demo/Blackholio/client-unreal/Source/client_unreal/Private/ModuleBindings/Tables/ConsumeEntityTimerTable.g.cpp deleted file mode 100644 index 398c24bdbde..00000000000 --- a/demo/Blackholio/client-unreal/Source/client_unreal/Private/ModuleBindings/Tables/ConsumeEntityTimerTable.g.cpp +++ /dev/null @@ -1,47 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE -// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. - -#include "ModuleBindings/Tables/ConsumeEntityTimerTable.g.h" -#include "DBCache/UniqueIndex.h" -#include "DBCache/BTreeUniqueIndex.h" -#include "DBCache/ClientCache.h" -#include "DBCache/TableCache.h" - -void UConsumeEntityTimerTable::PostInitialize() -{ - /** Client cache init and setting up indexes*/ - Data = MakeShared>(); - - TSharedPtr> ConsumeEntityTimerTable = Data->GetOrAdd(TableName); - ConsumeEntityTimerTable->AddUniqueConstraint("scheduled_id", [](const FConsumeEntityTimerType& Row) -> const uint64& { - return Row.ScheduledId; }); - - ScheduledId = NewObject(this); - ScheduledId->SetCache(ConsumeEntityTimerTable); - - /***/ -} - -FTableAppliedDiff UConsumeEntityTimerTable::Update(TArray> InsertsRef, TArray> DeletesRef) -{ - FTableAppliedDiff Diff = BaseUpdate(InsertsRef, DeletesRef, Data, TableName); - - Diff.DeriveUpdatesByPrimaryKey( - [](const FConsumeEntityTimerType& Row) - { - return Row.ScheduledId; - } - ); - - return Diff; -} - -int32 UConsumeEntityTimerTable::Count() const -{ - return GetRowCountFromTable(Data, TableName); -} - -TArray UConsumeEntityTimerTable::Iter() const -{ - return GetAllRowsFromTable(Data, TableName); -} diff --git a/demo/Blackholio/client-unreal/Source/client_unreal/Private/ModuleBindings/Tables/MoveAllPlayersTimerTable.g.cpp b/demo/Blackholio/client-unreal/Source/client_unreal/Private/ModuleBindings/Tables/MoveAllPlayersTimerTable.g.cpp deleted file mode 100644 index ed8b6a847f2..00000000000 --- a/demo/Blackholio/client-unreal/Source/client_unreal/Private/ModuleBindings/Tables/MoveAllPlayersTimerTable.g.cpp +++ /dev/null @@ -1,47 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE -// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. - -#include "ModuleBindings/Tables/MoveAllPlayersTimerTable.g.h" -#include "DBCache/UniqueIndex.h" -#include "DBCache/BTreeUniqueIndex.h" -#include "DBCache/ClientCache.h" -#include "DBCache/TableCache.h" - -void UMoveAllPlayersTimerTable::PostInitialize() -{ - /** Client cache init and setting up indexes*/ - Data = MakeShared>(); - - TSharedPtr> MoveAllPlayersTimerTable = Data->GetOrAdd(TableName); - MoveAllPlayersTimerTable->AddUniqueConstraint("scheduled_id", [](const FMoveAllPlayersTimerType& Row) -> const uint64& { - return Row.ScheduledId; }); - - ScheduledId = NewObject(this); - ScheduledId->SetCache(MoveAllPlayersTimerTable); - - /***/ -} - -FTableAppliedDiff UMoveAllPlayersTimerTable::Update(TArray> InsertsRef, TArray> DeletesRef) -{ - FTableAppliedDiff Diff = BaseUpdate(InsertsRef, DeletesRef, Data, TableName); - - Diff.DeriveUpdatesByPrimaryKey( - [](const FMoveAllPlayersTimerType& Row) - { - return Row.ScheduledId; - } - ); - - return Diff; -} - -int32 UMoveAllPlayersTimerTable::Count() const -{ - return GetRowCountFromTable(Data, TableName); -} - -TArray UMoveAllPlayersTimerTable::Iter() const -{ - return GetAllRowsFromTable(Data, TableName); -} diff --git a/demo/Blackholio/client-unreal/Source/client_unreal/Private/ModuleBindings/Tables/SpawnFoodTimerTable.g.cpp b/demo/Blackholio/client-unreal/Source/client_unreal/Private/ModuleBindings/Tables/SpawnFoodTimerTable.g.cpp deleted file mode 100644 index f7a36cff76b..00000000000 --- a/demo/Blackholio/client-unreal/Source/client_unreal/Private/ModuleBindings/Tables/SpawnFoodTimerTable.g.cpp +++ /dev/null @@ -1,47 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE -// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. - -#include "ModuleBindings/Tables/SpawnFoodTimerTable.g.h" -#include "DBCache/UniqueIndex.h" -#include "DBCache/BTreeUniqueIndex.h" -#include "DBCache/ClientCache.h" -#include "DBCache/TableCache.h" - -void USpawnFoodTimerTable::PostInitialize() -{ - /** Client cache init and setting up indexes*/ - Data = MakeShared>(); - - TSharedPtr> SpawnFoodTimerTable = Data->GetOrAdd(TableName); - SpawnFoodTimerTable->AddUniqueConstraint("scheduled_id", [](const FSpawnFoodTimerType& Row) -> const uint64& { - return Row.ScheduledId; }); - - ScheduledId = NewObject(this); - ScheduledId->SetCache(SpawnFoodTimerTable); - - /***/ -} - -FTableAppliedDiff USpawnFoodTimerTable::Update(TArray> InsertsRef, TArray> DeletesRef) -{ - FTableAppliedDiff Diff = BaseUpdate(InsertsRef, DeletesRef, Data, TableName); - - Diff.DeriveUpdatesByPrimaryKey( - [](const FSpawnFoodTimerType& Row) - { - return Row.ScheduledId; - } - ); - - return Diff; -} - -int32 USpawnFoodTimerTable::Count() const -{ - return GetRowCountFromTable(Data, TableName); -} - -TArray USpawnFoodTimerTable::Iter() const -{ - return GetAllRowsFromTable(Data, TableName); -} diff --git a/demo/Blackholio/client-unreal/Source/client_unreal/Public/ModuleBindings/SpacetimeDBClient.g.h b/demo/Blackholio/client-unreal/Source/client_unreal/Public/ModuleBindings/SpacetimeDBClient.g.h index d44f9a01029..34baad8fa2d 100644 --- a/demo/Blackholio/client-unreal/Source/client_unreal/Public/ModuleBindings/SpacetimeDBClient.g.h +++ b/demo/Blackholio/client-unreal/Source/client_unreal/Public/ModuleBindings/SpacetimeDBClient.g.h @@ -1,7 +1,7 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.6.0 (commit fa943010b614e8ec11eb04f8c56f12b466a1b814). +// This was generated using spacetimedb cli version 1.12.0 (commit 819069447d9034135872ce2bdc28722c4e5e46b6). #pragma once #include "CoreMinimal.h" @@ -38,23 +38,16 @@ class UDbConnection; class URemoteTables; class URemoteReducers; +class URemoteProcedures; class USubscriptionBuilder; class USubscriptionHandle; /** Forward declaration for tables */ class UCircleTable; -class UCircleDecayTimerTable; -class UCircleRecombineTimerTable; class UConfigTable; -class UConsumeEntityTimerTable; class UEntityTable; class UFoodTable; -class UCircleTable; -class UEntityTable; -class UPlayerTable; -class UMoveAllPlayersTimerTable; class UPlayerTable; -class USpawnFoodTimerTable; /***/ // Delegates using the generated connection type. These wrap the base @@ -79,7 +72,7 @@ struct CLIENT_UNREAL_API FContextBase { GENERATED_BODY() - FContextBase() : Db(nullptr), Reducers(nullptr), SetReducerFlags(nullptr), Conn(nullptr) {}; + FContextBase() : Db(nullptr), Reducers(nullptr), SetReducerFlags(nullptr), Procedures(nullptr), Conn(nullptr) {}; FContextBase(UDbConnection* InConn); UPROPERTY(BlueprintReadOnly, Category = "SpacetimeDB") @@ -91,6 +84,9 @@ struct CLIENT_UNREAL_API FContextBase UPROPERTY(BlueprintReadOnly, Category = "SpacetimeDB") USetReducerFlags* SetReducerFlags; + UPROPERTY(BlueprintReadOnly, Category = "SpacetimeDB") + URemoteProcedures* Procedures; + bool IsActive() const; void Disconnect(); bool TryGetIdentity(FSpacetimeDBIdentity& OutIdentity) const; @@ -118,6 +114,8 @@ class CLIENT_UNREAL_API UContextBaseBpLib : public UBlueprintFunctionLibrary UFUNCTION(BlueprintPure, Category="SpacetimeDB") static USetReducerFlags* GetSetReducerFlags(const FContextBase& Ctx) { return Ctx.SetReducerFlags; } + static URemoteProcedures* GetProcedures(const FContextBase& Ctx) { return Ctx.Procedures; } + UFUNCTION(BlueprintPure, Category="SpacetimeDB") static bool IsActive(const FContextBase& Ctx) { return Ctx.IsActive(); } }; @@ -590,6 +588,44 @@ struct CLIENT_UNREAL_API FClientUnrealReducerEvent } }; +// No procedures defined in this module. +/** Metadata describing a procedure run. */ +USTRUCT(BlueprintType) +struct CLIENT_UNREAL_API FClientUnrealProcedureEvent +{ + GENERATED_BODY() + + /** Timestamp for when the procedure executed */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="SpacetimeDB") + FSpacetimeDBTimestamp Timestamp; + + /** Result status of the procedure */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="SpacetimeDB") + FSpacetimeDBProcedureStatus Status; + + /** Identity that initiated the call */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="SpacetimeDB") + FSpacetimeDBTimeDuration TotalHostExecutionDuration; + + FClientUnrealProcedureEvent() { + } + FClientUnrealProcedureEvent(FProcedureEvent Event) { + Timestamp = Event.Timestamp; + Status = FSpacetimeDBProcedureStatus::FromStatus(Event.Status); + TotalHostExecutionDuration = Event.TotalHostExecutionDuration; + } + FORCEINLINE bool operator==(const FClientUnrealProcedureEvent& Other) const + { + return Status == Other.Status && Timestamp == Other.Timestamp && + TotalHostExecutionDuration == Other.TotalHostExecutionDuration; + } + + FORCEINLINE bool operator!=(const FClientUnrealProcedureEvent& Other) const + { + return !(*this == Other); + } +}; + /** Represents event with variant message data. */ USTRUCT(BlueprintType) struct CLIENT_UNREAL_API FClientUnrealEvent @@ -838,6 +874,18 @@ struct CLIENT_UNREAL_API FReducerEventContext : public FContextBase FClientUnrealReducerEvent Event; }; +USTRUCT(BlueprintType) +struct CLIENT_UNREAL_API FProcedureEventContext : public FContextBase +{ + GENERATED_BODY() + + FProcedureEventContext() = default; + FProcedureEventContext(UDbConnection* InConn, FClientUnrealProcedureEvent InEvent) : FContextBase(InConn), Event(InEvent) {} + + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + FClientUnrealProcedureEvent Event; +}; + USTRUCT(BlueprintType) struct CLIENT_UNREAL_API FErrorContext : public FContextBase { @@ -911,44 +959,20 @@ class CLIENT_UNREAL_API URemoteTables : public UObject public: void Initialize(); - UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") - UConsumeEntityTimerTable* ConsumeEntityTimer; - UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") UCircleTable* Circle; - UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") - UFoodTable* Food; - - UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") - UCircleTable* LoggedOutCircle; - - UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") - USpawnFoodTimerTable* SpawnFoodTimer; - UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") UConfigTable* Config; UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") - UPlayerTable* Player; - - UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") - UEntityTable* LoggedOutEntity; - - UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") - UPlayerTable* LoggedOutPlayer; - - UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") - UCircleDecayTimerTable* CircleDecayTimer; - - UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") - UCircleRecombineTimerTable* CircleRecombineTimer; + UEntityTable* Entity; UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") - UEntityTable* Entity; + UFoodTable* Food; UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") - UMoveAllPlayersTimerTable* MoveAllPlayersTimer; + UPlayerTable* Player; }; @@ -972,6 +996,7 @@ class CLIENT_UNREAL_API URemoteReducers : public UObject void CircleDecay(const FCircleDecayTimerType& Timer); bool InvokeCircleDecay(const FReducerEventContext& Context, const UCircleDecayReducer* Args); + bool InvokeCircleDecayWithArgs(const FReducerEventContext& Context, const FCircleDecayArgs& Args); DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( FCircleRecombineHandler, @@ -985,6 +1010,7 @@ class CLIENT_UNREAL_API URemoteReducers : public UObject void CircleRecombine(const FCircleRecombineTimerType& Timer); bool InvokeCircleRecombine(const FReducerEventContext& Context, const UCircleRecombineReducer* Args); + bool InvokeCircleRecombineWithArgs(const FReducerEventContext& Context, const FCircleRecombineArgs& Args); DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam( FConnectHandler, @@ -997,6 +1023,7 @@ class CLIENT_UNREAL_API URemoteReducers : public UObject void Connect(); bool InvokeConnect(const FReducerEventContext& Context, const UConnectReducer* Args); + bool InvokeConnectWithArgs(const FReducerEventContext& Context, const FConnectArgs& Args); DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( FConsumeEntityHandler, @@ -1010,6 +1037,7 @@ class CLIENT_UNREAL_API URemoteReducers : public UObject void ConsumeEntity(const FConsumeEntityTimerType& Request); bool InvokeConsumeEntity(const FReducerEventContext& Context, const UConsumeEntityReducer* Args); + bool InvokeConsumeEntityWithArgs(const FReducerEventContext& Context, const FConsumeEntityArgs& Args); DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam( FDisconnectHandler, @@ -1022,6 +1050,7 @@ class CLIENT_UNREAL_API URemoteReducers : public UObject void Disconnect(); bool InvokeDisconnect(const FReducerEventContext& Context, const UDisconnectReducer* Args); + bool InvokeDisconnectWithArgs(const FReducerEventContext& Context, const FDisconnectArgs& Args); DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( FEnterGameHandler, @@ -1035,6 +1064,7 @@ class CLIENT_UNREAL_API URemoteReducers : public UObject void EnterGame(const FString& Name); bool InvokeEnterGame(const FReducerEventContext& Context, const UEnterGameReducer* Args); + bool InvokeEnterGameWithArgs(const FReducerEventContext& Context, const FEnterGameArgs& Args); DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( FMoveAllPlayersHandler, @@ -1048,6 +1078,7 @@ class CLIENT_UNREAL_API URemoteReducers : public UObject void MoveAllPlayers(const FMoveAllPlayersTimerType& Timer); bool InvokeMoveAllPlayers(const FReducerEventContext& Context, const UMoveAllPlayersReducer* Args); + bool InvokeMoveAllPlayersWithArgs(const FReducerEventContext& Context, const FMoveAllPlayersArgs& Args); DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam( FPlayerSplitHandler, @@ -1060,6 +1091,7 @@ class CLIENT_UNREAL_API URemoteReducers : public UObject void PlayerSplit(); bool InvokePlayerSplit(const FReducerEventContext& Context, const UPlayerSplitReducer* Args); + bool InvokePlayerSplitWithArgs(const FReducerEventContext& Context, const FPlayerSplitArgs& Args); DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam( FRespawnHandler, @@ -1072,6 +1104,7 @@ class CLIENT_UNREAL_API URemoteReducers : public UObject void Respawn(); bool InvokeRespawn(const FReducerEventContext& Context, const URespawnReducer* Args); + bool InvokeRespawnWithArgs(const FReducerEventContext& Context, const FRespawnArgs& Args); DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( FSpawnFoodHandler, @@ -1085,6 +1118,7 @@ class CLIENT_UNREAL_API URemoteReducers : public UObject void SpawnFood(const FSpawnFoodTimerType& Timer); bool InvokeSpawnFood(const FReducerEventContext& Context, const USpawnFoodReducer* Args); + bool InvokeSpawnFoodWithArgs(const FReducerEventContext& Context, const FSpawnFoodArgs& Args); DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam( FSuicideHandler, @@ -1097,6 +1131,7 @@ class CLIENT_UNREAL_API URemoteReducers : public UObject void Suicide(); bool InvokeSuicide(const FReducerEventContext& Context, const USuicideReducer* Args); + bool InvokeSuicideWithArgs(const FReducerEventContext& Context, const FSuicideArgs& Args); DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( FUpdatePlayerInputHandler, @@ -1110,6 +1145,7 @@ class CLIENT_UNREAL_API URemoteReducers : public UObject void UpdatePlayerInput(const FDbVector2Type& Direction); bool InvokeUpdatePlayerInput(const FReducerEventContext& Context, const UUpdatePlayerInputReducer* Args); + bool InvokeUpdatePlayerInputWithArgs(const FReducerEventContext& Context, const FUpdatePlayerInputArgs& Args); // Internal error handling DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams(FInternalOnUnhandledReducerError, const FReducerEventContext&, Context, const FString&, Error); @@ -1126,6 +1162,26 @@ class CLIENT_UNREAL_API URemoteReducers : public UObject USetReducerFlags* SetCallReducerFlags; }; +// RemoteProcedures class +UCLASS(BlueprintType) +class CLIENT_UNREAL_API URemoteProcedures : public UObject +{ + GENERATED_BODY() + +public: + + // Internal error handling + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams(FInternalOnUnhandledProcedureError, const FProcedureEventContext&, Context, const FString&, Error); + FInternalOnUnhandledProcedureError InternalOnUnhandledProcedureError; + +private: + + friend UDbConnection; + + UPROPERTY() + class UDbConnection* Conn; +}; + // SubscriptionBuilder class UCLASS(BlueprintType) class CLIENT_UNREAL_API USubscriptionBuilder : public USubscriptionBuilderBase @@ -1241,6 +1297,9 @@ class CLIENT_UNREAL_API UDbConnection : public UDbConnectionBase UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") USetReducerFlags* SetReducerFlags; + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + URemoteProcedures* Procedures; + // Delegates that allow users to bind with the concrete connection type. FOnConnectDelegate OnConnectDelegate; FOnDisconnectDelegate OnDisconnectDelegate; @@ -1257,10 +1316,15 @@ class CLIENT_UNREAL_API UDbConnection : public UDbConnectionBase UPROPERTY(BlueprintAssignable, Category="SpacetimeDB") FOnUnhandledReducerError OnUnhandledReducerError; + // Error handling + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams(FOnUnhandledProcedureError, const FProcedureEventContext&, Context, const FString&, Error); + UPROPERTY(BlueprintAssignable, Category="SpacetimeDB") + FOnUnhandledProcedureError OnUnhandledProcedureError; + protected: - // Hook up error handling to reducers + // Hook up error handling to reducers and procedures virtual void PostInitProperties() override; UFUNCTION() @@ -1271,6 +1335,9 @@ class CLIENT_UNREAL_API UDbConnection : public UDbConnectionBase UFUNCTION() void OnUnhandledReducerErrorHandler(const FReducerEventContext& Context, const FString& Error); + UFUNCTION() + void OnUnhandledProcedureErrorHandler(const FProcedureEventContext& Context, const FString& Error); + // Override the DbConnectionBase methods to handle updates and events virtual void DbUpdate(const FDatabaseUpdateType& Update, const FSpacetimeDBEvent& Event) override; @@ -1279,5 +1346,7 @@ class CLIENT_UNREAL_API UDbConnection : public UDbConnectionBase // Override the reducer event failed handler virtual void ReducerEventFailed(const FReducerEvent& Event, const FString ErrorMessage) override; + // Override the procedure event failed handler + virtual void ProcedureEventFailed(const FProcedureEvent& Event, const FString ErrorMessage) override; }; diff --git a/demo/Blackholio/client-unreal/Source/client_unreal/Public/ModuleBindings/Tables/CircleDecayTimerTable.g.h b/demo/Blackholio/client-unreal/Source/client_unreal/Public/ModuleBindings/Tables/CircleDecayTimerTable.g.h deleted file mode 100644 index 67734c5a801..00000000000 --- a/demo/Blackholio/client-unreal/Source/client_unreal/Public/ModuleBindings/Tables/CircleDecayTimerTable.g.h +++ /dev/null @@ -1,104 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE -// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. - -#pragma once -#include "CoreMinimal.h" -#include "BSATN/UESpacetimeDB.h" -#include "Types/Builtins.h" -#include "ModuleBindings/Types/CircleDecayTimerType.g.h" -#include "Tables/RemoteTable.h" -#include "DBCache/WithBsatn.h" -#include "DBCache/TableHandle.h" -#include "DBCache/TableCache.h" -#include "CircleDecayTimerTable.g.generated.h" - -UCLASS(Blueprintable) -class CLIENT_UNREAL_API UCircleDecayTimerScheduledIdUniqueIndex : public UObject -{ - GENERATED_BODY() - -private: - // Declare an instance of your templated helper. - // It's private because the UObject wrapper will expose its functionality. - FUniqueIndexHelper> ScheduledIdIndexHelper; - -public: - UCircleDecayTimerScheduledIdUniqueIndex() - // Initialize the helper with the specific unique index name - : ScheduledIdIndexHelper("scheduled_id") { - } - - /** - * Finds a CircleDecayTimer by their unique scheduledid. - * @param Key The scheduledid to search for. - * @return The found FCircleDecayTimerType, or a default-constructed FCircleDecayTimerType if not found. - */ - // NOTE: Not exposed to Blueprint because uint64 types are not Blueprint-compatible - FCircleDecayTimerType Find(uint64 Key) - { - // Simply delegate the call to the internal helper - return ScheduledIdIndexHelper.FindUniqueIndex(Key); - } - - // A public setter to provide the cache to the helper after construction - // This is a common pattern when the cache might be created or provided by another system. - void SetCache(TSharedPtr> InCircleDecayTimerCache) - { - ScheduledIdIndexHelper.Cache = InCircleDecayTimerCache; - } -}; -/***/ - -UCLASS(BlueprintType) -class CLIENT_UNREAL_API UCircleDecayTimerTable : public URemoteTable -{ - GENERATED_BODY() - -public: - UPROPERTY(BlueprintReadOnly) - UCircleDecayTimerScheduledIdUniqueIndex* ScheduledId; - - void PostInitialize(); - - /** Update function for circle_decay_timer table*/ - FTableAppliedDiff Update(TArray> InsertsRef, TArray> DeletesRef); - - /** Number of subscribed rows currently in the cache */ - UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") - int32 Count() const; - - /** Return all subscribed rows in the cache */ - UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") - TArray Iter() const; - - // Table Events - DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( - FOnCircleDecayTimerInsert, - const FEventContext&, Context, - const FCircleDecayTimerType&, NewRow); - - DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams( - FOnCircleDecayTimerUpdate, - const FEventContext&, Context, - const FCircleDecayTimerType&, OldRow, - const FCircleDecayTimerType&, NewRow); - - DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( - FOnCircleDecayTimerDelete, - const FEventContext&, Context, - const FCircleDecayTimerType&, DeletedRow); - - UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") - FOnCircleDecayTimerInsert OnInsert; - - UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") - FOnCircleDecayTimerUpdate OnUpdate; - - UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") - FOnCircleDecayTimerDelete OnDelete; - -private: - const FString TableName = TEXT("circle_decay_timer"); - - TSharedPtr> Data; -}; diff --git a/demo/Blackholio/client-unreal/Source/client_unreal/Public/ModuleBindings/Tables/CircleRecombineTimerTable.g.h b/demo/Blackholio/client-unreal/Source/client_unreal/Public/ModuleBindings/Tables/CircleRecombineTimerTable.g.h deleted file mode 100644 index fa2584ed493..00000000000 --- a/demo/Blackholio/client-unreal/Source/client_unreal/Public/ModuleBindings/Tables/CircleRecombineTimerTable.g.h +++ /dev/null @@ -1,104 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE -// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. - -#pragma once -#include "CoreMinimal.h" -#include "BSATN/UESpacetimeDB.h" -#include "Types/Builtins.h" -#include "ModuleBindings/Types/CircleRecombineTimerType.g.h" -#include "Tables/RemoteTable.h" -#include "DBCache/WithBsatn.h" -#include "DBCache/TableHandle.h" -#include "DBCache/TableCache.h" -#include "CircleRecombineTimerTable.g.generated.h" - -UCLASS(Blueprintable) -class CLIENT_UNREAL_API UCircleRecombineTimerScheduledIdUniqueIndex : public UObject -{ - GENERATED_BODY() - -private: - // Declare an instance of your templated helper. - // It's private because the UObject wrapper will expose its functionality. - FUniqueIndexHelper> ScheduledIdIndexHelper; - -public: - UCircleRecombineTimerScheduledIdUniqueIndex() - // Initialize the helper with the specific unique index name - : ScheduledIdIndexHelper("scheduled_id") { - } - - /** - * Finds a CircleRecombineTimer by their unique scheduledid. - * @param Key The scheduledid to search for. - * @return The found FCircleRecombineTimerType, or a default-constructed FCircleRecombineTimerType if not found. - */ - // NOTE: Not exposed to Blueprint because uint64 types are not Blueprint-compatible - FCircleRecombineTimerType Find(uint64 Key) - { - // Simply delegate the call to the internal helper - return ScheduledIdIndexHelper.FindUniqueIndex(Key); - } - - // A public setter to provide the cache to the helper after construction - // This is a common pattern when the cache might be created or provided by another system. - void SetCache(TSharedPtr> InCircleRecombineTimerCache) - { - ScheduledIdIndexHelper.Cache = InCircleRecombineTimerCache; - } -}; -/***/ - -UCLASS(BlueprintType) -class CLIENT_UNREAL_API UCircleRecombineTimerTable : public URemoteTable -{ - GENERATED_BODY() - -public: - UPROPERTY(BlueprintReadOnly) - UCircleRecombineTimerScheduledIdUniqueIndex* ScheduledId; - - void PostInitialize(); - - /** Update function for circle_recombine_timer table*/ - FTableAppliedDiff Update(TArray> InsertsRef, TArray> DeletesRef); - - /** Number of subscribed rows currently in the cache */ - UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") - int32 Count() const; - - /** Return all subscribed rows in the cache */ - UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") - TArray Iter() const; - - // Table Events - DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( - FOnCircleRecombineTimerInsert, - const FEventContext&, Context, - const FCircleRecombineTimerType&, NewRow); - - DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams( - FOnCircleRecombineTimerUpdate, - const FEventContext&, Context, - const FCircleRecombineTimerType&, OldRow, - const FCircleRecombineTimerType&, NewRow); - - DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( - FOnCircleRecombineTimerDelete, - const FEventContext&, Context, - const FCircleRecombineTimerType&, DeletedRow); - - UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") - FOnCircleRecombineTimerInsert OnInsert; - - UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") - FOnCircleRecombineTimerUpdate OnUpdate; - - UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") - FOnCircleRecombineTimerDelete OnDelete; - -private: - const FString TableName = TEXT("circle_recombine_timer"); - - TSharedPtr> Data; -}; diff --git a/demo/Blackholio/client-unreal/Source/client_unreal/Public/ModuleBindings/Tables/CircleTable.g.h b/demo/Blackholio/client-unreal/Source/client_unreal/Public/ModuleBindings/Tables/CircleTable.g.h index 3bb3f394a9b..e92587259a2 100644 --- a/demo/Blackholio/client-unreal/Source/client_unreal/Public/ModuleBindings/Tables/CircleTable.g.h +++ b/demo/Blackholio/client-unreal/Source/client_unreal/Public/ModuleBindings/Tables/CircleTable.g.h @@ -97,7 +97,7 @@ class CLIENT_UNREAL_API UCircleTable : public URemoteTable void PostInitialize(); - /** Update function for logged_out_circle table*/ + /** Update function for circle table*/ FTableAppliedDiff Update(TArray> InsertsRef, TArray> DeletesRef); /** Number of subscribed rows currently in the cache */ @@ -135,7 +135,7 @@ class CLIENT_UNREAL_API UCircleTable : public URemoteTable FOnCircleDelete OnDelete; private: - const FString TableName = TEXT("logged_out_circle"); + const FString TableName = TEXT("circle"); TSharedPtr> Data; }; diff --git a/demo/Blackholio/client-unreal/Source/client_unreal/Public/ModuleBindings/Tables/ConsumeEntityTimerTable.g.h b/demo/Blackholio/client-unreal/Source/client_unreal/Public/ModuleBindings/Tables/ConsumeEntityTimerTable.g.h deleted file mode 100644 index f07cca059d6..00000000000 --- a/demo/Blackholio/client-unreal/Source/client_unreal/Public/ModuleBindings/Tables/ConsumeEntityTimerTable.g.h +++ /dev/null @@ -1,104 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE -// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. - -#pragma once -#include "CoreMinimal.h" -#include "BSATN/UESpacetimeDB.h" -#include "Types/Builtins.h" -#include "ModuleBindings/Types/ConsumeEntityTimerType.g.h" -#include "Tables/RemoteTable.h" -#include "DBCache/WithBsatn.h" -#include "DBCache/TableHandle.h" -#include "DBCache/TableCache.h" -#include "ConsumeEntityTimerTable.g.generated.h" - -UCLASS(Blueprintable) -class CLIENT_UNREAL_API UConsumeEntityTimerScheduledIdUniqueIndex : public UObject -{ - GENERATED_BODY() - -private: - // Declare an instance of your templated helper. - // It's private because the UObject wrapper will expose its functionality. - FUniqueIndexHelper> ScheduledIdIndexHelper; - -public: - UConsumeEntityTimerScheduledIdUniqueIndex() - // Initialize the helper with the specific unique index name - : ScheduledIdIndexHelper("scheduled_id") { - } - - /** - * Finds a ConsumeEntityTimer by their unique scheduledid. - * @param Key The scheduledid to search for. - * @return The found FConsumeEntityTimerType, or a default-constructed FConsumeEntityTimerType if not found. - */ - // NOTE: Not exposed to Blueprint because uint64 types are not Blueprint-compatible - FConsumeEntityTimerType Find(uint64 Key) - { - // Simply delegate the call to the internal helper - return ScheduledIdIndexHelper.FindUniqueIndex(Key); - } - - // A public setter to provide the cache to the helper after construction - // This is a common pattern when the cache might be created or provided by another system. - void SetCache(TSharedPtr> InConsumeEntityTimerCache) - { - ScheduledIdIndexHelper.Cache = InConsumeEntityTimerCache; - } -}; -/***/ - -UCLASS(BlueprintType) -class CLIENT_UNREAL_API UConsumeEntityTimerTable : public URemoteTable -{ - GENERATED_BODY() - -public: - UPROPERTY(BlueprintReadOnly) - UConsumeEntityTimerScheduledIdUniqueIndex* ScheduledId; - - void PostInitialize(); - - /** Update function for consume_entity_timer table*/ - FTableAppliedDiff Update(TArray> InsertsRef, TArray> DeletesRef); - - /** Number of subscribed rows currently in the cache */ - UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") - int32 Count() const; - - /** Return all subscribed rows in the cache */ - UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") - TArray Iter() const; - - // Table Events - DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( - FOnConsumeEntityTimerInsert, - const FEventContext&, Context, - const FConsumeEntityTimerType&, NewRow); - - DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams( - FOnConsumeEntityTimerUpdate, - const FEventContext&, Context, - const FConsumeEntityTimerType&, OldRow, - const FConsumeEntityTimerType&, NewRow); - - DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( - FOnConsumeEntityTimerDelete, - const FEventContext&, Context, - const FConsumeEntityTimerType&, DeletedRow); - - UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") - FOnConsumeEntityTimerInsert OnInsert; - - UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") - FOnConsumeEntityTimerUpdate OnUpdate; - - UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") - FOnConsumeEntityTimerDelete OnDelete; - -private: - const FString TableName = TEXT("consume_entity_timer"); - - TSharedPtr> Data; -}; diff --git a/demo/Blackholio/client-unreal/Source/client_unreal/Public/ModuleBindings/Tables/MoveAllPlayersTimerTable.g.h b/demo/Blackholio/client-unreal/Source/client_unreal/Public/ModuleBindings/Tables/MoveAllPlayersTimerTable.g.h deleted file mode 100644 index 5e81ed977ff..00000000000 --- a/demo/Blackholio/client-unreal/Source/client_unreal/Public/ModuleBindings/Tables/MoveAllPlayersTimerTable.g.h +++ /dev/null @@ -1,104 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE -// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. - -#pragma once -#include "CoreMinimal.h" -#include "BSATN/UESpacetimeDB.h" -#include "Types/Builtins.h" -#include "ModuleBindings/Types/MoveAllPlayersTimerType.g.h" -#include "Tables/RemoteTable.h" -#include "DBCache/WithBsatn.h" -#include "DBCache/TableHandle.h" -#include "DBCache/TableCache.h" -#include "MoveAllPlayersTimerTable.g.generated.h" - -UCLASS(Blueprintable) -class CLIENT_UNREAL_API UMoveAllPlayersTimerScheduledIdUniqueIndex : public UObject -{ - GENERATED_BODY() - -private: - // Declare an instance of your templated helper. - // It's private because the UObject wrapper will expose its functionality. - FUniqueIndexHelper> ScheduledIdIndexHelper; - -public: - UMoveAllPlayersTimerScheduledIdUniqueIndex() - // Initialize the helper with the specific unique index name - : ScheduledIdIndexHelper("scheduled_id") { - } - - /** - * Finds a MoveAllPlayersTimer by their unique scheduledid. - * @param Key The scheduledid to search for. - * @return The found FMoveAllPlayersTimerType, or a default-constructed FMoveAllPlayersTimerType if not found. - */ - // NOTE: Not exposed to Blueprint because uint64 types are not Blueprint-compatible - FMoveAllPlayersTimerType Find(uint64 Key) - { - // Simply delegate the call to the internal helper - return ScheduledIdIndexHelper.FindUniqueIndex(Key); - } - - // A public setter to provide the cache to the helper after construction - // This is a common pattern when the cache might be created or provided by another system. - void SetCache(TSharedPtr> InMoveAllPlayersTimerCache) - { - ScheduledIdIndexHelper.Cache = InMoveAllPlayersTimerCache; - } -}; -/***/ - -UCLASS(BlueprintType) -class CLIENT_UNREAL_API UMoveAllPlayersTimerTable : public URemoteTable -{ - GENERATED_BODY() - -public: - UPROPERTY(BlueprintReadOnly) - UMoveAllPlayersTimerScheduledIdUniqueIndex* ScheduledId; - - void PostInitialize(); - - /** Update function for move_all_players_timer table*/ - FTableAppliedDiff Update(TArray> InsertsRef, TArray> DeletesRef); - - /** Number of subscribed rows currently in the cache */ - UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") - int32 Count() const; - - /** Return all subscribed rows in the cache */ - UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") - TArray Iter() const; - - // Table Events - DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( - FOnMoveAllPlayersTimerInsert, - const FEventContext&, Context, - const FMoveAllPlayersTimerType&, NewRow); - - DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams( - FOnMoveAllPlayersTimerUpdate, - const FEventContext&, Context, - const FMoveAllPlayersTimerType&, OldRow, - const FMoveAllPlayersTimerType&, NewRow); - - DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( - FOnMoveAllPlayersTimerDelete, - const FEventContext&, Context, - const FMoveAllPlayersTimerType&, DeletedRow); - - UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") - FOnMoveAllPlayersTimerInsert OnInsert; - - UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") - FOnMoveAllPlayersTimerUpdate OnUpdate; - - UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") - FOnMoveAllPlayersTimerDelete OnDelete; - -private: - const FString TableName = TEXT("move_all_players_timer"); - - TSharedPtr> Data; -}; diff --git a/demo/Blackholio/client-unreal/Source/client_unreal/Public/ModuleBindings/Tables/PlayerTable.g.h b/demo/Blackholio/client-unreal/Source/client_unreal/Public/ModuleBindings/Tables/PlayerTable.g.h index 9e8734b5c6e..fd13ef2a07a 100644 --- a/demo/Blackholio/client-unreal/Source/client_unreal/Public/ModuleBindings/Tables/PlayerTable.g.h +++ b/demo/Blackholio/client-unreal/Source/client_unreal/Public/ModuleBindings/Tables/PlayerTable.g.h @@ -100,7 +100,7 @@ class CLIENT_UNREAL_API UPlayerTable : public URemoteTable void PostInitialize(); - /** Update function for logged_out_player table*/ + /** Update function for player table*/ FTableAppliedDiff Update(TArray> InsertsRef, TArray> DeletesRef); /** Number of subscribed rows currently in the cache */ @@ -138,7 +138,7 @@ class CLIENT_UNREAL_API UPlayerTable : public URemoteTable FOnPlayerDelete OnDelete; private: - const FString TableName = TEXT("logged_out_player"); + const FString TableName = TEXT("player"); TSharedPtr> Data; }; diff --git a/demo/Blackholio/client-unreal/Source/client_unreal/Public/ModuleBindings/Tables/SpawnFoodTimerTable.g.h b/demo/Blackholio/client-unreal/Source/client_unreal/Public/ModuleBindings/Tables/SpawnFoodTimerTable.g.h deleted file mode 100644 index 362243f28fa..00000000000 --- a/demo/Blackholio/client-unreal/Source/client_unreal/Public/ModuleBindings/Tables/SpawnFoodTimerTable.g.h +++ /dev/null @@ -1,104 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE -// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. - -#pragma once -#include "CoreMinimal.h" -#include "BSATN/UESpacetimeDB.h" -#include "Types/Builtins.h" -#include "ModuleBindings/Types/SpawnFoodTimerType.g.h" -#include "Tables/RemoteTable.h" -#include "DBCache/WithBsatn.h" -#include "DBCache/TableHandle.h" -#include "DBCache/TableCache.h" -#include "SpawnFoodTimerTable.g.generated.h" - -UCLASS(Blueprintable) -class CLIENT_UNREAL_API USpawnFoodTimerScheduledIdUniqueIndex : public UObject -{ - GENERATED_BODY() - -private: - // Declare an instance of your templated helper. - // It's private because the UObject wrapper will expose its functionality. - FUniqueIndexHelper> ScheduledIdIndexHelper; - -public: - USpawnFoodTimerScheduledIdUniqueIndex() - // Initialize the helper with the specific unique index name - : ScheduledIdIndexHelper("scheduled_id") { - } - - /** - * Finds a SpawnFoodTimer by their unique scheduledid. - * @param Key The scheduledid to search for. - * @return The found FSpawnFoodTimerType, or a default-constructed FSpawnFoodTimerType if not found. - */ - // NOTE: Not exposed to Blueprint because uint64 types are not Blueprint-compatible - FSpawnFoodTimerType Find(uint64 Key) - { - // Simply delegate the call to the internal helper - return ScheduledIdIndexHelper.FindUniqueIndex(Key); - } - - // A public setter to provide the cache to the helper after construction - // This is a common pattern when the cache might be created or provided by another system. - void SetCache(TSharedPtr> InSpawnFoodTimerCache) - { - ScheduledIdIndexHelper.Cache = InSpawnFoodTimerCache; - } -}; -/***/ - -UCLASS(BlueprintType) -class CLIENT_UNREAL_API USpawnFoodTimerTable : public URemoteTable -{ - GENERATED_BODY() - -public: - UPROPERTY(BlueprintReadOnly) - USpawnFoodTimerScheduledIdUniqueIndex* ScheduledId; - - void PostInitialize(); - - /** Update function for spawn_food_timer table*/ - FTableAppliedDiff Update(TArray> InsertsRef, TArray> DeletesRef); - - /** Number of subscribed rows currently in the cache */ - UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") - int32 Count() const; - - /** Return all subscribed rows in the cache */ - UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") - TArray Iter() const; - - // Table Events - DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( - FOnSpawnFoodTimerInsert, - const FEventContext&, Context, - const FSpawnFoodTimerType&, NewRow); - - DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams( - FOnSpawnFoodTimerUpdate, - const FEventContext&, Context, - const FSpawnFoodTimerType&, OldRow, - const FSpawnFoodTimerType&, NewRow); - - DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( - FOnSpawnFoodTimerDelete, - const FEventContext&, Context, - const FSpawnFoodTimerType&, DeletedRow); - - UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") - FOnSpawnFoodTimerInsert OnInsert; - - UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") - FOnSpawnFoodTimerUpdate OnUpdate; - - UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") - FOnSpawnFoodTimerDelete OnDelete; - -private: - const FString TableName = TEXT("spawn_food_timer"); - - TSharedPtr> Data; -}; diff --git a/demo/Blackholio/server-csharp/Lib.cs b/demo/Blackholio/server-csharp/Lib.cs index 20e26cf99e6..542a7040037 100644 --- a/demo/Blackholio/server-csharp/Lib.cs +++ b/demo/Blackholio/server-csharp/Lib.cs @@ -138,7 +138,7 @@ public static void Init(ReducerContext ctx) [Reducer(ReducerKind.ClientConnected)] public static void Connect(ReducerContext ctx) { - var player = ctx.Db.logged_out_player.identity.Find(ctx.Sender); + var player = ctx.Db.logged_out_player.identity.Find(ctx.Sender()); if (player != null) { ctx.Db.player.Insert(player.Value); @@ -157,7 +157,7 @@ public static void Connect(ReducerContext ctx) { ctx.Db.player.Insert(new Player { - identity = ctx.Sender, + identity = ctx.Sender(), name = "", }); } @@ -166,7 +166,7 @@ public static void Connect(ReducerContext ctx) [Reducer(ReducerKind.ClientDisconnected)] public static void Disconnect(ReducerContext ctx) { - var player = ctx.Db.player.identity.Find(ctx.Sender) ?? throw new Exception("Player not found"); + var player = ctx.Db.player.identity.Find(ctx.Sender()) ?? throw new Exception("Player not found"); foreach (var circle in ctx.Db.circle.player_id.Filter(player.player_id)) { var entity = ctx.Db.entity.entity_id.Find(circle.entity_id) ?? throw new Exception("Could not find circle"); @@ -183,7 +183,7 @@ public static void Disconnect(ReducerContext ctx) public static void EnterGame(ReducerContext ctx, string name) { Log.Info($"Creating player with name {name}"); - var player = ctx.Db.player.identity.Find(ctx.Sender) ?? throw new Exception("Player not found"); + var player = ctx.Db.player.identity.Find(ctx.Sender()) ?? throw new Exception("Player not found"); player.name = name; ctx.Db.player.identity.Update(player); SpawnPlayerInitialCircle(ctx, player.player_id); @@ -192,7 +192,7 @@ public static void EnterGame(ReducerContext ctx, string name) [Reducer] public static void Respawn(ReducerContext ctx) { - var player = ctx.Db.player.identity.Find(ctx.Sender) ?? throw new Exception("No such player found"); + var player = ctx.Db.player.identity.Find(ctx.Sender()) ?? throw new Exception("No such player found"); SpawnPlayerInitialCircle(ctx, player.player_id); } @@ -200,7 +200,7 @@ public static void Respawn(ReducerContext ctx) [Reducer] public static void Suicide(ReducerContext ctx) { - var player = ctx.Db.player.identity.Find(ctx.Sender) ?? throw new Exception("No such player found"); + var player = ctx.Db.player.identity.Find(ctx.Sender()) ?? throw new Exception("No such player found"); foreach (var circle in ctx.Db.circle.player_id.Filter(player.player_id)) { @@ -246,7 +246,7 @@ public static Entity SpawnCircleAt(ReducerContext ctx, int player_id, int mass, [Reducer] public static void UpdatePlayerInput(ReducerContext ctx, DbVector2 direction) { - var player = ctx.Db.player.identity.Find(ctx.Sender) ?? throw new Exception("Player not found"); + var player = ctx.Db.player.identity.Find(ctx.Sender()) ?? throw new Exception("Player not found"); foreach (var c in ctx.Db.circle.player_id.Filter(player.player_id)) { var circle = c; @@ -449,7 +449,7 @@ public static void DestroyEntity(ReducerContext ctx, int entityId) [Reducer] public static void PlayerSplit(ReducerContext ctx) { - var player = ctx.Db.player.identity.Find(ctx.Sender) ?? throw new Exception("Sender has no player"); + var player = ctx.Db.player.identity.Find(ctx.Sender()) ?? throw new Exception("Sender has no player"); List circles = ctx.Db.circle.player_id.Filter(player.player_id).ToList(); var circle_count = circles.Count; if (circle_count >= MAX_CIRCLES_PER_PLAYER) diff --git a/docs/docs/00100-intro/00100-getting-started/00400-key-architecture.md b/docs/docs/00100-intro/00100-getting-started/00400-key-architecture.md index 9c3e28a4e61..86e37c54428 100644 --- a/docs/docs/00100-intro/00100-getting-started/00400-key-architecture.md +++ b/docs/docs/00100-intro/00100-getting-started/00400-key-architecture.md @@ -439,7 +439,7 @@ A view can be written in C# like so: [SpacetimeDB.View(Name = "MyPlayer", Public = true)] public static Player? MyPlayer(ViewContext ctx) { - return ctx.Db.Player.Identity.Find(ctx.Sender) as Player; + return ctx.Db.Player.Identity.Find(ctx.Sender()) as Player; } ``` diff --git a/docs/docs/00100-intro/00300-tutorials/00100-chat-app.md b/docs/docs/00100-intro/00300-tutorials/00100-chat-app.md index 06ef0c039ce..f8dc277f38c 100644 --- a/docs/docs/00100-intro/00300-tutorials/00100-chat-app.md +++ b/docs/docs/00100-intro/00300-tutorials/00100-chat-app.md @@ -322,7 +322,7 @@ public static void SetName(ReducerContext ctx, string name) { name = ValidateName(name); - if (ctx.Db.User.Identity.Find(ctx.Sender) is User user) + if (ctx.Db.User.Identity.Find(ctx.Sender()) is User user) { user.Name = name; ctx.Db.User.Identity.Update(user); @@ -411,7 +411,7 @@ public static void SendMessage(ReducerContext ctx, string text) ctx.Db.Message.Insert( new Message { - Sender = ctx.Sender, + Sender = ctx.Sender(), Text = text, Sent = ctx.Timestamp, } @@ -504,9 +504,9 @@ In `spacetimedb/Lib.cs`, add to the `Module` class: [Reducer(ReducerKind.ClientConnected)] public static void ClientConnected(ReducerContext ctx) { - Log.Info($"Connect {ctx.Sender}"); + Log.Info($"Connect {ctx.Sender()}"); - if (ctx.Db.User.Identity.Find(ctx.Sender) is User user) + if (ctx.Db.User.Identity.Find(ctx.Sender()) is User user) { user.Online = true; ctx.Db.User.Identity.Update(user); @@ -517,7 +517,7 @@ public static void ClientConnected(ReducerContext ctx) new User { Name = null, - Identity = ctx.Sender, + Identity = ctx.Sender(), Online = true, } ); @@ -527,7 +527,7 @@ public static void ClientConnected(ReducerContext ctx) [Reducer(ReducerKind.ClientDisconnected)] public static void ClientDisconnected(ReducerContext ctx) { - if (ctx.Db.User.Identity.Find(ctx.Sender) is User user) + if (ctx.Db.User.Identity.Find(ctx.Sender()) is User user) { user.Online = false; ctx.Db.User.Identity.Update(user); diff --git a/docs/docs/00100-intro/00300-tutorials/00300-unity-tutorial/00300-part-2.md b/docs/docs/00100-intro/00300-tutorials/00300-unity-tutorial/00300-part-2.md index b6766e12672..26f278f5051 100644 --- a/docs/docs/00100-intro/00300-tutorials/00300-unity-tutorial/00300-part-2.md +++ b/docs/docs/00100-intro/00300-tutorials/00300-unity-tutorial/00300-part-2.md @@ -335,7 +335,7 @@ Add this function to the `Module` class in `Lib.cs`: [Reducer] public static void Debug(ReducerContext ctx) { - Log.Info($"This reducer was called by {ctx.Sender}"); + Log.Info($"This reducer was called by {ctx.Sender()}"); } ``` @@ -444,7 +444,7 @@ Next let's connect our client to our database. Let's start by modifying our `Deb [Reducer(ReducerKind.ClientConnected)] public static void Connect(ReducerContext ctx) { - Log.Info($"{ctx.Sender} just connected."); + Log.Info($"{ctx.Sender()} just connected."); } ``` diff --git a/docs/docs/00100-intro/00300-tutorials/00300-unity-tutorial/00400-part-3.md b/docs/docs/00100-intro/00300-tutorials/00300-unity-tutorial/00400-part-3.md index ab95e71294d..f1a0c99aa0d 100644 --- a/docs/docs/00100-intro/00300-tutorials/00300-unity-tutorial/00400-part-3.md +++ b/docs/docs/00100-intro/00300-tutorials/00300-unity-tutorial/00400-part-3.md @@ -359,7 +359,7 @@ Next, modify your `Connect` reducer and add a new `Disconnect` reducer below it: [Reducer(ReducerKind.ClientConnected)] public static void Connect(ReducerContext ctx) { - var player = ctx.Db.logged_out_player.identity.Find(ctx.Sender); + var player = ctx.Db.logged_out_player.identity.Find(ctx.Sender()); if (player != null) { ctx.Db.player.Insert(player.Value); @@ -369,7 +369,7 @@ public static void Connect(ReducerContext ctx) { ctx.Db.player.Insert(new Player { - identity = ctx.Sender, + identity = ctx.Sender(), name = "", }); } @@ -378,7 +378,7 @@ public static void Connect(ReducerContext ctx) [Reducer(ReducerKind.ClientDisconnected)] public static void Disconnect(ReducerContext ctx) { - var player = ctx.Db.player.identity.Find(ctx.Sender) ?? throw new Exception("Player not found"); + var player = ctx.Db.player.identity.Find(ctx.Sender()) ?? throw new Exception("Player not found"); ctx.Db.logged_out_player.Insert(player); ctx.Db.player.identity.Delete(player.identity); } @@ -457,7 +457,7 @@ const int START_PLAYER_MASS = 15; public static void EnterGame(ReducerContext ctx, string name) { Log.Info($"Creating player with name {name}"); - var player = ctx.Db.player.identity.Find(ctx.Sender) ?? throw new Exception("Player not found"); + var player = ctx.Db.player.identity.Find(ctx.Sender()) ?? throw new Exception("Player not found"); player.name = name; ctx.Db.player.identity.Update(player); SpawnPlayerInitialCircle(ctx, player.player_id); @@ -579,7 +579,7 @@ Let's also modify our `disconnect` reducer to remove the circles from the arena [Reducer(ReducerKind.ClientDisconnected)] public static void Disconnect(ReducerContext ctx) { - var player = ctx.Db.player.identity.Find(ctx.Sender) ?? throw new Exception("Player not found"); + var player = ctx.Db.player.identity.Find(ctx.Sender()) ?? throw new Exception("Player not found"); // Remove any circles from the arena foreach (var circle in ctx.Db.circle.player_id.Filter(player.player_id)) { diff --git a/docs/docs/00100-intro/00300-tutorials/00300-unity-tutorial/00500-part-4.md b/docs/docs/00100-intro/00300-tutorials/00300-unity-tutorial/00500-part-4.md index 647efe78bcb..cdf062fd8d0 100644 --- a/docs/docs/00100-intro/00300-tutorials/00300-unity-tutorial/00500-part-4.md +++ b/docs/docs/00100-intro/00300-tutorials/00300-unity-tutorial/00500-part-4.md @@ -49,7 +49,7 @@ Next, add the following reducer to the `Module` class of your `Lib.cs` file. [Reducer] public static void UpdatePlayerInput(ReducerContext ctx, DbVector2 direction) { - var player = ctx.Db.player.identity.Find(ctx.Sender) ?? throw new Exception("Player not found"); + var player = ctx.Db.player.identity.Find(ctx.Sender()) ?? throw new Exception("Player not found"); foreach (var c in ctx.Db.circle.player_id.Filter(player.player_id)) { var circle = c; @@ -60,7 +60,7 @@ public static void UpdatePlayerInput(ReducerContext ctx, DbVector2 direction) } ``` -This is a simple reducer that takes the movement input from the client and applies them to all circles that that player controls. Note that it is not possible for a player to move another player's circles using this reducer, because the `ctx.Sender` value is not set by the client. Instead `ctx.Sender` is set by SpacetimeDB after it has authenticated that sender. You can rest assured that the caller has been authenticated as that player by the time this reducer is called. +This is a simple reducer that takes the movement input from the client and applies them to all circles that that player controls. Note that it is not possible for a player to move another player's circles using this reducer, because the `ctx.Sender()` value is not set by the client. Instead `ctx.Sender()` is set by SpacetimeDB after it has authenticated that sender. You can rest assured that the caller has been authenticated as that player by the time this reducer is called. diff --git a/docs/docs/00100-intro/00300-tutorials/00400-unreal-tutorial/00300-part-2.md b/docs/docs/00100-intro/00300-tutorials/00400-unreal-tutorial/00300-part-2.md index bde4659ba26..a97a65abec8 100644 --- a/docs/docs/00100-intro/00300-tutorials/00400-unreal-tutorial/00300-part-2.md +++ b/docs/docs/00100-intro/00300-tutorials/00400-unreal-tutorial/00300-part-2.md @@ -333,7 +333,7 @@ Add this function to the `Module` class in `Lib.cs`: [Reducer] public static void Debug(ReducerContext ctx) { - Log.Info($"This reducer was called by {ctx.Sender}"); + Log.Info($"This reducer was called by {ctx.Sender()}"); } ``` @@ -440,7 +440,7 @@ Next let's connect our client to our database. Let's start by modifying our `Deb [Reducer(ReducerKind.ClientConnected)] public static void Connect(ReducerContext ctx) { - Log.Info($"{ctx.Sender} just connected."); + Log.Info($"{ctx.Sender()} just connected."); } ``` diff --git a/docs/docs/00100-intro/00300-tutorials/00400-unreal-tutorial/00400-part-3.md b/docs/docs/00100-intro/00300-tutorials/00400-unreal-tutorial/00400-part-3.md index 192c7d3ebc8..d3543050874 100644 --- a/docs/docs/00100-intro/00300-tutorials/00400-unreal-tutorial/00400-part-3.md +++ b/docs/docs/00100-intro/00300-tutorials/00400-unreal-tutorial/00400-part-3.md @@ -352,7 +352,7 @@ Next, modify your `Connect` reducer and add a new `Disconnect` reducer below it: [Reducer(ReducerKind.ClientConnected)] public static void Connect(ReducerContext ctx) { - var player = ctx.Db.logged_out_player.identity.Find(ctx.Sender); + var player = ctx.Db.logged_out_player.identity.Find(ctx.Sender()); if (player != null) { ctx.Db.player.Insert(player.Value); @@ -362,7 +362,7 @@ public static void Connect(ReducerContext ctx) { ctx.Db.player.Insert(new Player { - identity = ctx.Sender, + identity = ctx.Sender(), name = "", }); } @@ -371,7 +371,7 @@ public static void Connect(ReducerContext ctx) [Reducer(ReducerKind.ClientDisconnected)] public static void Disconnect(ReducerContext ctx) { - var player = ctx.Db.player.identity.Find(ctx.Sender) ?? throw new Exception("Player not found"); + var player = ctx.Db.player.identity.Find(ctx.Sender()) ?? throw new Exception("Player not found"); ctx.Db.logged_out_player.Insert(player); ctx.Db.player.identity.Delete(player.identity); } @@ -446,7 +446,7 @@ const int START_PLAYER_MASS = 15; public static void EnterGame(ReducerContext ctx, string name) { Log.Info($"Creating player with name {name}"); - var player = ctx.Db.player.identity.Find(ctx.Sender) ?? throw new Exception("Player not found"); + var player = ctx.Db.player.identity.Find(ctx.Sender()) ?? throw new Exception("Player not found"); player.name = name; ctx.Db.player.identity.Update(player); SpawnPlayerInitialCircle(ctx, player.player_id); @@ -566,7 +566,7 @@ Let's also modify our `disconnect` reducer to remove the circles from the arena [Reducer(ReducerKind.ClientDisconnected)] public static void Disconnect(ReducerContext ctx) { - var player = ctx.Db.player.identity.Find(ctx.Sender) ?? throw new Exception("Player not found"); + var player = ctx.Db.player.identity.Find(ctx.Sender()) ?? throw new Exception("Player not found"); // Remove any circles from the arena foreach (var circle in ctx.Db.circle.player_id.Filter(player.player_id)) { diff --git a/docs/docs/00100-intro/00300-tutorials/00400-unreal-tutorial/00500-part-4.md b/docs/docs/00100-intro/00300-tutorials/00400-unreal-tutorial/00500-part-4.md index ae8eb620633..2acda18aac8 100644 --- a/docs/docs/00100-intro/00300-tutorials/00400-unreal-tutorial/00500-part-4.md +++ b/docs/docs/00100-intro/00300-tutorials/00400-unreal-tutorial/00500-part-4.md @@ -50,7 +50,7 @@ Next, add the following reducer to the `Module` class of your `Lib.cs` file. [Reducer] public static void UpdatePlayerInput(ReducerContext ctx, DbVector2 direction) { - var player = ctx.Db.player.identity.Find(ctx.Sender) ?? throw new Exception("Player not found"); + var player = ctx.Db.player.identity.Find(ctx.Sender()) ?? throw new Exception("Player not found"); foreach (var c in ctx.Db.circle.player_id.Filter(player.player_id)) { var circle = c; @@ -61,7 +61,7 @@ public static void UpdatePlayerInput(ReducerContext ctx, DbVector2 direction) } ``` -This is a simple reducer that takes the movement input from the client and applies them to all circles that that player controls. Note that it is not possible for a player to move another player's circles using this reducer, because the `ctx.Sender` value is not set by the client. Instead `ctx.Sender` is set by SpacetimeDB after it has authenticated that sender. You can rest assured that the caller has been authenticated as that player by the time this reducer is called. +This is a simple reducer that takes the movement input from the client and applies them to all circles that that player controls. Note that it is not possible for a player to move another player's circles using this reducer, because the `ctx.Sender()` value is not set by the client. Instead `ctx.Sender()` is set by SpacetimeDB after it has authenticated that sender. You can rest assured that the caller has been authenticated as that player by the time this reducer is called. Let's start by building out a simple math library to help us do collision calculations. Create a new `math.rs` file in the `blackholio/spacetimedb/src` directory and add the following contents. Let's also move the `DbVector2` type from `lib.rs` into this file. diff --git a/docs/docs/00200-core-concepts/00100-databases/00500-cheat-sheet.md b/docs/docs/00200-core-concepts/00100-databases/00500-cheat-sheet.md index 416475c0bc3..d1e2624b343 100644 --- a/docs/docs/00200-core-concepts/00100-databases/00500-cheat-sheet.md +++ b/docs/docs/00200-core-concepts/00100-databases/00500-cheat-sheet.md @@ -457,7 +457,7 @@ using SpacetimeDB; [SpacetimeDB.View(Public = true)] public static Player? MyPlayer(ViewContext ctx) { - return ctx.Db.Player.Identity.Find(ctx.Sender); + return ctx.Db.Player.Identity.Find(ctx.Sender()); } // Return multiple rows @@ -510,7 +510,7 @@ ctx.identity // Module's identity ```csharp ctx.Db // Database access -ctx.Sender // Identity of caller +ctx.Sender() // Identity of caller ctx.ConnectionId // ConnectionId? ctx.Timestamp // Timestamp ctx.Identity // Module's identity diff --git a/docs/docs/00200-core-concepts/00200-functions/00300-reducers/00400-reducer-context.md b/docs/docs/00200-core-concepts/00200-functions/00300-reducers/00400-reducer-context.md index 38f447125d4..d789845ab29 100644 --- a/docs/docs/00200-core-concepts/00200-functions/00300-reducers/00400-reducer-context.md +++ b/docs/docs/00200-core-concepts/00200-functions/00300-reducers/00400-reducer-context.md @@ -145,7 +145,7 @@ public static partial class Module public static void UpdateScore(ReducerContext ctx, uint newScore) { // Get the caller's identity - Identity caller = ctx.Sender; + Identity caller = ctx.Sender(); // Find and update their player record if (ctx.Db.Player.Identity.Find(caller) is Player player) @@ -262,7 +262,7 @@ public static partial class Module public static void SendReminder(ReducerContext ctx, ScheduledTask task) { // Only allow the scheduler (module identity) to call this - if (ctx.Sender != ctx.Identity) + if (ctx.Sender() != ctx.Identity) { throw new Exception("This reducer can only be called by the scheduler"); } diff --git a/docs/docs/00200-core-concepts/00200-functions/00300-reducers/00500-lifecycle.md b/docs/docs/00200-core-concepts/00200-functions/00300-reducers/00500-lifecycle.md index 22afb7de483..e9c6b1cff61 100644 --- a/docs/docs/00200-core-concepts/00200-functions/00300-reducers/00500-lifecycle.md +++ b/docs/docs/00200-core-concepts/00200-functions/00300-reducers/00500-lifecycle.md @@ -110,7 +110,7 @@ spacetimedb.clientConnected((ctx) => { [SpacetimeDB.Reducer(ReducerKind.ClientConnected)] public static void OnConnect(ReducerContext ctx) { - Log.Info($"Client connected: {ctx.Sender}"); + Log.Info($"Client connected: {ctx.Sender()}"); // ctx.ConnectionId is guaranteed to be non-null var connId = ctx.ConnectionId!.Value; @@ -119,7 +119,7 @@ public static void OnConnect(ReducerContext ctx) ctx.Db.Session.Insert(new Session { ConnectionId = connId, - Identity = ctx.Sender, + Identity = ctx.Sender(), ConnectedAt = ctx.Timestamp }); } @@ -182,7 +182,7 @@ spacetimedb.clientDisconnected((ctx) => { [SpacetimeDB.Reducer(ReducerKind.ClientDisconnected)] public static void OnDisconnect(ReducerContext ctx) { - Log.Info($"Client disconnected: {ctx.Sender}"); + Log.Info($"Client disconnected: {ctx.Sender()}"); // ctx.ConnectionId is guaranteed to be non-null var connId = ctx.ConnectionId!.Value; diff --git a/docs/docs/00200-core-concepts/00200-functions/00300-reducers/00600-error-handling.md b/docs/docs/00200-core-concepts/00200-functions/00300-reducers/00600-error-handling.md index 714f68d1110..661e5870853 100644 --- a/docs/docs/00200-core-concepts/00200-functions/00300-reducers/00600-error-handling.md +++ b/docs/docs/00200-core-concepts/00200-functions/00300-reducers/00600-error-handling.md @@ -61,7 +61,7 @@ Throw an exception: [SpacetimeDB.Reducer] public static void TransferCredits(ReducerContext ctx, ulong toUser, uint amount) { - var fromUser = ctx.Db.User.Id.Find(ctx.Sender); + var fromUser = ctx.Db.User.Id.Find(ctx.Sender()); if (fromUser == null) { throw new InvalidOperationException("User not found"); diff --git a/docs/docs/00200-core-concepts/00200-functions/00500-views.md b/docs/docs/00200-core-concepts/00200-functions/00500-views.md index 0603fa97dad..7b8c43ea1b7 100644 --- a/docs/docs/00200-core-concepts/00200-functions/00500-views.md +++ b/docs/docs/00200-core-concepts/00200-functions/00500-views.md @@ -130,7 +130,7 @@ public static partial class Module [SpacetimeDB.View(Name = "MyPlayer", Public = true)] public static Player? MyPlayer(ViewContext ctx) { - return ctx.Db.Player.Identity.Find(ctx.Sender) as Player; + return ctx.Db.Player.Identity.Find(ctx.Sender()) as Player; } // Multiple rows: return a list @@ -283,7 +283,7 @@ spacetimedb.view( [SpacetimeDB.View(Name = "MyPlayer", Public = true)] public static Player? MyPlayer(ViewContext ctx) { - return ctx.Db.Player.Identity.Find(ctx.Sender); + return ctx.Db.Player.Identity.Find(ctx.Sender()); } ``` @@ -485,7 +485,7 @@ public partial class Module [SpacetimeDB.View(Name = "EntitiesInMyChunk", Public = true)] public static List EntitiesInMyChunk(ViewContext ctx) { - if (ctx.Db.Player.Identity.Find(ctx.Sender) is not Player player) + if (ctx.Db.Player.Identity.Find(ctx.Sender()) is not Player player) { return new List(); } diff --git a/docs/docs/00200-core-concepts/00300-tables.md b/docs/docs/00200-core-concepts/00300-tables.md index cf3727b18d8..c09cf9b832c 100644 --- a/docs/docs/00200-core-concepts/00300-tables.md +++ b/docs/docs/00200-core-concepts/00300-tables.md @@ -348,7 +348,7 @@ ctx.Db.Player.Insert(new Player { /* ... */ }); ctx.Db.LoggedOutPlayer.Insert(new Player { /* ... */ }); // Move a row between tables -var player = ctx.Db.LoggedOutPlayer.Identity.Find(ctx.Sender); +var player = ctx.Db.LoggedOutPlayer.Identity.Find(ctx.Sender()); if (player != null) { ctx.Db.Player.Insert(player.Value); diff --git a/docs/docs/00200-core-concepts/00300-tables/00210-file-storage.md b/docs/docs/00200-core-concepts/00300-tables/00210-file-storage.md index 33e617c542a..239737330c8 100644 --- a/docs/docs/00200-core-concepts/00300-tables/00210-file-storage.md +++ b/docs/docs/00200-core-concepts/00300-tables/00210-file-storage.md @@ -221,7 +221,7 @@ public static partial class Module ctx.Db.Document.Insert(new Document { Id = 0, // auto-increment - OwnerId = ctx.Sender, + OwnerId = ctx.Sender(), Filename = filename, MimeType = mimeType, SizeBytes = sizeBytes, diff --git a/docs/docs/00200-core-concepts/00300-tables/00400-access-permissions.md b/docs/docs/00200-core-concepts/00300-tables/00400-access-permissions.md index 0f3c83978ed..6fe4e6d9833 100644 --- a/docs/docs/00200-core-concepts/00300-tables/00400-access-permissions.md +++ b/docs/docs/00200-core-concepts/00300-tables/00400-access-permissions.md @@ -393,8 +393,8 @@ public partial class Module public static List MyMessages(ViewContext ctx) { // Look up messages by index where caller is sender or recipient - var sent = ctx.Db.Message.Sender.Filter(ctx.Sender).ToList(); - var received = ctx.Db.Message.Recipient.Filter(ctx.Sender).ToList(); + var sent = ctx.Db.Message.Sender.Filter(ctx.Sender()).ToList(); + var received = ctx.Db.Message.Recipient.Filter(ctx.Sender()).ToList(); sent.AddRange(received); return sent; } @@ -526,7 +526,7 @@ public partial class Module public static PublicUserProfile? MyProfile(ViewContext ctx) { // Look up the caller's account by their identity (unique index) - if (ctx.Db.UserAccount.Identity.Find(ctx.Sender) is not UserAccount user) + if (ctx.Db.UserAccount.Identity.Find(ctx.Sender()) is not UserAccount user) { return null; } @@ -676,7 +676,7 @@ public partial class Module public static List MyColleagues(ViewContext ctx) { // Find the caller's employee record by identity (unique index) - if (ctx.Db.Employee.Identity.Find(ctx.Sender) is not Employee me) + if (ctx.Db.Employee.Identity.Find(ctx.Sender()) is not Employee me) { return new List(); } diff --git a/docs/docs/00300-resources/00100-how-to/00300-logging.md b/docs/docs/00300-resources/00100-how-to/00300-logging.md index 1958b01634e..1b77fd7bcc7 100644 --- a/docs/docs/00300-resources/00100-how-to/00300-logging.md +++ b/docs/docs/00300-resources/00100-how-to/00300-logging.md @@ -69,7 +69,7 @@ public static partial class Module throw new ArgumentException("Value cannot be zero"); } - Log.Debug($"Debug information: ctx.Sender = {ctx.Sender}"); + Log.Debug($"Debug information: ctx.Sender() = {ctx.Sender()}"); } } ``` @@ -202,7 +202,7 @@ Include relevant context in your log messages: [SpacetimeDB.Reducer] public static void TransferCredits(ReducerContext ctx, ulong toUser, uint amount) { - Log.Info($"Credit transfer: from={ctx.Sender}, to={toUser}, amount={amount}"); + Log.Info($"Credit transfer: from={ctx.Sender()}, to={toUser}, amount={amount}"); // ... transfer logic } diff --git a/docs/llms/docs-benchmark-analysis.md b/docs/llms/docs-benchmark-analysis.md index faa301f26fc..f2f69378b8e 100644 --- a/docs/llms/docs-benchmark-analysis.md +++ b/docs/llms/docs-benchmark-analysis.md @@ -8,18 +8,21 @@ Generated from: `/__w/SpacetimeDB/SpacetimeDB/tools/xtask-llm-benchmark/../../do --- -## Analysis of SpacetimeDB Benchmark Test Failures +# Analysis of SpacetimeDB Benchmark Test Failures -### Rust / rustdoc_json Failures +This document analyzes the SpacetimeDB benchmark test failures organized by language and mode. Each section addresses specific failures, providing insights into their causes and recommending actionable solutions. -#### Compile/Publish Errors (2 Failures) +## Rust / rustdoc_json Failures + +### Compile/Publish Errors + +#### t_002_scheduled_table & t_017_scheduled_columns -##### Failure Group 1: `t_002_scheduled_table` and `t_017_scheduled_columns` 1. **The generated code**: ```rust use spacetimedb::{table, reducer, ReducerContext, Table, ScheduleAt}; - #[table(name = tick_timer, schedule(reducer = tick, column = scheduled_at))] + #[table(name = tick_timer, scheduled(reducer = tick, column = scheduled_at))] pub struct TickTimer { #[primary_key] #[auto_inc] @@ -29,12 +32,10 @@ Generated from: `/__w/SpacetimeDB/SpacetimeDB/tools/xtask-llm-benchmark/../../do #[reducer(init)] pub fn init(ctx: &ReducerContext) { - if ctx.db.tick_timer().count() == 0 { - ctx.db.tick_timer().insert(TickTimer { - scheduled_id: 0, - scheduled_at: ScheduleAt::RepeatMicros(50_000), - }); - } + ctx.db.tick_timer().insert(TickTimer { + scheduled_id: 0, + scheduled_at: ScheduleAt::repeat_micros(50_000), + }); } #[reducer] @@ -73,97 +74,161 @@ Generated from: `/__w/SpacetimeDB/SpacetimeDB/tools/xtask-llm-benchmark/../../do - `publish_error: spacetime publish failed (exit=1)` 4. **Explain the difference**: - - The generated code used `ScheduleAt::RepeatMicros(50_000)` instead of the correct `ScheduleAt::Interval(Duration::from_millis(50).into())`. The way the scheduling was set up was incorrect. + - The LLM generated code uses `ScheduleAt::repeat_micros(50_000)` while the expected code uses `ScheduleAt::Interval(Duration::from_millis(50).into())`. + - The `scheduled` attribute is incorrectly set. 5. **Root cause**: - - The documentation does not clearly specify the constructor syntax for `ScheduleAt` nor how to correctly set up the scheduled tasks in this context. + - The documentation lacks clear guidance on using the `ScheduleAt` type effectively and the format for specifying scheduled actions. 6. **Recommendation**: - - Update documentation to provide examples of different constructors for `ScheduleAt`, specifically emphasizing how to define intervals correctly. + - Update documentation to clarify how to define timing for scheduled entries, using `ScheduleAt::Interval` instead of `ScheduleAt::repeat_*` methods. ---- +### Compile/Publish Errors (3 Failures) -#### Other Failures (5 failures) +#### t_003_struct_in_table -##### Failure Group 2: `t_013_spacetime_sum_type`, `t_015_product_type_columns`, `t_016_sum_type_columns`, `t_018_constraints`, `t_020_ecs` 1. **The generated code**: ```rust use spacetimedb::{table, reducer, ReducerContext, Table, SpacetimeType}; #[derive(SpacetimeType)] - pub struct Rect { - width: i32, - height: i32, + pub struct Position { + x: i32, + y: i32, } - #[table(name = result)] - pub struct ResultRow { + #[table(name = entity)] + pub struct Entity { #[primary_key] id: i32, - value: Shape, + pos: Position, } #[reducer] - pub fn set_circle(ctx: &ReducerContext, id: i32, radius: i32) { - ctx.db.result().insert(ResultRow { - id, - value: Shape::Circle(radius), - }); + pub fn add_entity(ctx: &ReducerContext, id: i32, x: i32, y: i32) { + ctx.db.entity().insert(Entity { id, pos: Position { x, y } }); } ``` 2. **The golden example**: ```rust - use spacetimedb::{reducer, table, ReducerContext, SpacetimeType, Table}; + use spacetimedb::{table, SpacetimeType}; #[derive(SpacetimeType, Clone, Debug)] - pub struct Rect { - pub width: i32, - pub height: i32, + pub struct Position { + pub x: i32, + pub y: i32, } - #[table(name = result)] - pub struct ResultRow { + #[table(name = entity)] + pub struct Entity { #[primary_key] pub id: i32, - pub value: Shape, + pub pos: Position, + } + ``` + +3. **The error**: + - `schema_parity: reducers differ - expected [], got ["add_entity()"]` + +4. **Explain the difference**: + - The expected code does not include any reducers, while the generated code has an unnecessary `add_entity` reducer. + +5. **Root cause**: + - Misrepresentation of structural requirements regarding reducers in the schema. + +6. **Recommendation**: + - Update the documentation to clarify when reducers should or should not be defined for schema parity. + +--- + +#### t_018_constraints + +1. **The generated code**: + ```rust + use spacetimedb::{table, reducer, ReducerContext, Table}; + + #[table(name = account, index(name = by_name, btree(columns = [name])))] + pub struct Account { + #[primary_key] + id: i32, + #[unique] + email: String, + name: String, } #[reducer] - pub fn set_circle(ctx: &ReducerContext, id: i32, radius: i32) { - ctx.db.result().insert(ResultRow { id, value: Shape::Circle(radius) }); + pub fn seed(ctx: &ReducerContext) { + let t = ctx.db.account(); + t.insert(Account { id: 1, email: "a@example.com".to_string(), name: "Alice".to_string() }); + t.insert(Account { id: 2, email: "b@example.com".to_string(), name: "Bob".to_string() }); } ``` -3. **The error**: - - `spacetime sql failed: no such table: result` - - `spacetime sql failed: no such table: profile` - - `spacetime sql failed: no such table: drawings` - +2. **The golden example**: + ```rust + use spacetimedb::{reducer, table, ReducerContext, Table}; + + #[table( + name = account, + index(name = by_name, btree(columns = [name])) + )] + pub struct Account { + #[primary_key] + pub id: i32, + #[unique] + pub email: String, + pub name: String, + } + + #[reducer] + pub fn seed(ctx: &ReducerContext) { + ctx.db.account().insert(Account { id: 1, email: "a@example.com".into(), name: "Alice".into() }); + ctx.db.account().insert(Account { id: 2, email: "b@example.com".into(), name: "Bob".into() }); + } + ``` + +3. **The error**: + - `constraints_row_parity_after_seed: spacetime sql failed: no such table: 'account'` + 4. **Explain the difference**: - - The generated code omits the `pub` visibility keyword for fields and structs, which prevents proper access by the macros that generate the expected database schema. Additionally, the enum `Shape` wasn't declared correctly in the generated code. + - The generated code did not include the `pub` keyword in front of fields, which results in private access. 5. **Root cause**: - - Lack of proper visibility (missing `pub`) for structs and enum fields was not clearly emphasized in the documentation, leading to access issues. + - Lack of explicit guidelines on visibility modifiers for database fields and schema definition. 6. **Recommendation**: - - Provide clear guidelines in the documentation regarding the necessity of using `pub` for struct and enum fields when working with SpacetimeDB components. Include example schemas with visibility marked. + - Update the documentation to emphasize that struct fields in database models must be public. --- -### Rust / docs Failures (22 total) +### Additional Recommendations -#### Timeout Issues (1 failure) +1. **Documentation Clarity**: + - Ensure clear examples defining the expected syntax for all relevant SpacetimeDB features (e.g., table structure, reducer signatures). + +2. **Example Consistency**: + - Modify the examples to guarantee consistency in field access levels (public/private) across all instances. -1. **Failure Group**: `t_015_product_type_columns` - - **Expected**: Modify the query logic to ensure no unnecessary long-running operations exist. - - **Recommendation**: Provide timeout considerations in the documentation to ensure optimization options are explored to prevent long-running tasks. +3. **Error Handling**: + - Include a section on expected error messages and discrepancies that developers should look out for, which could help in debugging similar errors effectively. --- -### C# / docs Failures (4 total) +## Rust / docs Failures + +### Timeout Issues + +- **Failures**: t_013_spacetime_sum_type, t_015_product_type_columns, t_016_sum_type_columns, t_018_constraints, t_019_many_to_many, t_020_ecs +- **Recommendation**: + - Review the execution time of these benchmarks and possibly optimize the code for performance or provide a timeout setting for testing. + +--- + +## C# / docs Failures + +### t_014_elementary_columns -#### C# Failure Group: `t_014_elementary_columns`, `t_016_sum_type_columns`, `t_017_scheduled_columns`, `t_020_ecs` 1. **The generated code**: ```csharp using SpacetimeDB; @@ -234,17 +299,30 @@ Generated from: `/__w/SpacetimeDB/SpacetimeDB/tools/xtask-llm-benchmark/../../do } ``` -3. **The error**: `no such table: primitive` - +3. **The error**: + - `no such table: 'primitive'` + 4. **Explain the difference**: - - Missing the `public` access modifier in the declaration of the `Table` attribute. The expected syntax properly utilizes attributes defined in the library. + - The generated code has an extra public field visibility which is redundant in this context, leading to distraction. 5. **Root cause**: - - Documentation may lack clarity about access modifiers, especially when it comes to how they affect visibility in entities. + - Inconsistent handling of public annotations for struct attributes. 6. **Recommendation**: - - Ensure C# documentation includes explicit examples where `public` is required in class and struct declarations to prevent access issues with tables. + - Align the documentation to show proper usage of attributes and visibility appropriately. ---- +--- -By addressing the above gaps in documentation and ensuring that generated samples adhere to the expected outcomes, we can significantly reduce the number of failures in future benchmarks. +#### 10. **t_017_scheduled_columns** +- **Generated Code**: + ```csharp + [Table(Name = "TickTimer", Scheduled = nameof(Tick), ScheduledAt = nameof(ScheduledAt))] + public partial struct TickTimer + { + [PrimaryKey, AutoInc] + public ulong ScheduledId; + public ScheduleAt ScheduledAt; + } + ``` + +This analysis serves to highlight the discrepancies noted in the benchmark test failures across Rust and C#, with actionable steps to amend recurring issues. Essential areas of improvement focus on explicit documentation, consistent field access levels, and clearer definitions of API requirements. By implementing these recommendations, we can streamline the development process and avoid common pitfalls. diff --git a/docs/llms/docs-benchmark-comment.md b/docs/llms/docs-benchmark-comment.md index b26d4820585..907eb0e9b50 100644 --- a/docs/llms/docs-benchmark-comment.md +++ b/docs/llms/docs-benchmark-comment.md @@ -2,16 +2,16 @@ | Language | Mode | Category | Tests Passed | Task Pass % | |----------|------|----------|--------------|-------------| -| Rust | rustdoc_json | basics | 26/27 | 91.7% ⬆️ +8.3% | -| Rust | rustdoc_json | schema | 23/34 | 65.3% ⬆️ +10.0% | -| Rust | rustdoc_json | **total** | 49/61 | **79.7%** ⬆️ +9.1% | +| Rust | rustdoc_json | basics | 25/27 | 83.3% ⬆️ +6.9% | +| Rust | rustdoc_json | schema | 24/34 | 68.7% ⬇️ -6.7% | +| Rust | rustdoc_json | **total** | 49/61 | **76.7%** ⬆️ +0.8% | | Rust | docs | basics | 5/27 | 11.1% | -| Rust | docs | schema | 8/32 | 20.5% ⬆️ +8.0% | -| Rust | docs | **total** | 13/59 | **15.4%** ⬆️ +3.6% | +| Rust | docs | schema | 4/18 | 12.5% ⬇️ -8.0% | +| Rust | docs | **total** | 9/45 | **11.7%** ⬇️ -3.6% | | C# | docs | basics | 27/27 | 100.0% | -| C# | docs | schema | 25/34 | 73.7% | -| C# | docs | **total** | 52/61 | **88.0%** | +| C# | docs | schema | 24/32 | 70.3% ⬆️ +6.7% | +| C# | docs | **total** | 51/59 | **86.5%** ⬆️ +3.0% | _Compared against master branch baseline_ -Generated at: 2026-01-27T20:01:19.767Z +Generated at: 2026-01-26T19:41:35.586Z diff --git a/docs/llms/docs-benchmark-details.json b/docs/llms/docs-benchmark-details.json index 5d08c34e832..fc7a2432196 100644 --- a/docs/llms/docs-benchmark-details.json +++ b/docs/llms/docs-benchmark-details.json @@ -5,21 +5,21 @@ "modes": [ { "mode": "rustdoc_json", - "hash": "2a0f4ec42cac03fb3da542793b311e4b399845c688bb0660a6c231c82e96c56a", + "hash": "da32ac1e4a22e29f27c1c75b3ce526f5ba909c184b9057d83384313a5e7b881a", "models": [ { "name": "GPT-5", "route_api_model": "gpt-5", "tasks": { "t_000_empty_reducers": { - "hash": "2a0f4ec42cac03fb3da542793b311e4b399845c688bb0660a6c231c82e96c56a", + "hash": "da32ac1e4a22e29f27c1c75b3ce526f5ba909c184b9057d83384313a5e7b881a", "task": "t_000_empty_reducers", "lang": "rust", "golden_published": true, "model_name": "GPT-5", "total_tests": 1, "passed_tests": 1, - "llm_output": "use spacetimedb::ReducerContext;\n\n#[spacetimedb::reducer]\npub fn empty_reducer_no_args(_ctx: &ReducerContext) {\n}\n\n#[spacetimedb::reducer]\npub fn empty_reducer_with_int(_ctx: &ReducerContext, count: i32) {\n let _ = count;\n}\n\n#[spacetimedb::reducer]\npub fn empty_reducer_with_string(_ctx: &ReducerContext, name: String) {\n let _ = name;\n}\n\n#[spacetimedb::reducer]\npub fn empty_reducer_with_two_args(_ctx: &ReducerContext, count: i32, name: String) {\n let _ = (count, name);\n}\n\n#[spacetimedb::reducer]\npub fn empty_reducer_with_three_args(_ctx: &ReducerContext, active: bool, ratio: f32, label: String) {\n let _ = (active, ratio, label);\n}", + "llm_output": "use spacetimedb::ReducerContext;\n\n#[spacetimedb::reducer]\npub fn empty_reducer_no_args(_ctx: &ReducerContext) {\n}\n\n#[spacetimedb::reducer]\npub fn empty_reducer_with_int(_ctx: &ReducerContext, _count: i32) {\n}\n\n#[spacetimedb::reducer]\npub fn empty_reducer_with_string(_ctx: &ReducerContext, _name: String) {\n}\n\n#[spacetimedb::reducer]\npub fn empty_reducer_with_two_args(_ctx: &ReducerContext, _count: i32, _name: String) {\n}\n\n#[spacetimedb::reducer]\npub fn empty_reducer_with_three_args(_ctx: &ReducerContext, _active: bool, _ratio: f32, _label: String) {\n}", "category": "basics", "route_api_model": "gpt-5", "golden_db": "basics-t-000-empty-reducers-golden", @@ -35,18 +35,18 @@ "llm_db": "basics-t-000-empty-reducers-gpt-5-llm", "reducers_diff": null, "reducers_equal": true, - "server": "http://127.0.0.1:33615", + "server": "http://127.0.0.1:44233", "tables_diff": null, "tables_equal": true } } }, "vendor": "openai", - "started_at": "2026-01-27T19:50:33.923590167Z", - "finished_at": "2026-01-27T19:51:02.622615452Z" + "started_at": "2026-01-26T19:27:52.325853523Z", + "finished_at": "2026-01-26T19:28:19.691117111Z" }, "t_001_basic_tables": { - "hash": "2a0f4ec42cac03fb3da542793b311e4b399845c688bb0660a6c231c82e96c56a", + "hash": "da32ac1e4a22e29f27c1c75b3ce526f5ba909c184b9057d83384313a5e7b881a", "task": "t_001_basic_tables", "lang": "rust", "golden_published": true, @@ -69,25 +69,25 @@ "llm_db": "basics-t-001-basic-tables-gpt-5-llm", "reducers_diff": null, "reducers_equal": true, - "server": "http://127.0.0.1:33615", + "server": "http://127.0.0.1:44233", "tables_diff": null, "tables_equal": true } } }, "vendor": "openai", - "started_at": "2026-01-27T19:50:58.838771838Z", - "finished_at": "2026-01-27T19:51:33.707208916Z" + "started_at": "2026-01-26T19:27:55.244006331Z", + "finished_at": "2026-01-26T19:28:22.209162875Z" }, "t_002_scheduled_table": { - "hash": "2a0f4ec42cac03fb3da542793b311e4b399845c688bb0660a6c231c82e96c56a", + "hash": "da32ac1e4a22e29f27c1c75b3ce526f5ba909c184b9057d83384313a5e7b881a", "task": "t_002_scheduled_table", "lang": "rust", "golden_published": false, "model_name": "GPT-5", "total_tests": 1, "passed_tests": 0, - "llm_output": "use spacetimedb::{table, reducer, ReducerContext, Table, ScheduleAt};\n\n#[table(name = tick_timer, schedule(reducer = tick, column = scheduled_at))]\npub struct TickTimer {\n #[primary_key]\n #[auto_inc]\n scheduled_id: u64,\n scheduled_at: ScheduleAt,\n}\n\n#[reducer(init)]\npub fn init(ctx: &ReducerContext) {\n if ctx.db.tick_timer().count() == 0 {\n ctx.db\n .tick_timer()\n .insert(TickTimer { scheduled_id: 0, scheduled_at: ScheduleAt::repeat_micros(50_000) });\n }\n}\n\n#[reducer]\npub fn tick(_ctx: &ReducerContext) {\n}", + "llm_output": "use spacetimedb::{table, reducer, ReducerContext, Table, ScheduleAt};\n\n#[table(name = tick_timer, schedule(reducer = tick, column = scheduled_at))]\npub struct TickTimer {\n #[primary_key]\n #[auto_inc]\n scheduled_id: u64,\n scheduled_at: ScheduleAt,\n}\n\n#[reducer(init)]\npub fn init(ctx: &ReducerContext) {\n if ctx.db.tick_timer().count() == 0 {\n ctx.db.tick_timer().insert(TickTimer {\n scheduled_id: 0,\n scheduled_at: ScheduleAt::repeat_micros(50_000),\n });\n }\n}\n\n#[reducer]\npub fn tick(_ctx: &ReducerContext, _scheduled_id: u64) {\n}", "category": "basics", "route_api_model": "gpt-5", "golden_db": "basics-t-002-scheduled-table-golden", @@ -99,24 +99,24 @@ "pass": false, "partial": 0.0, "notes": { - "error": "spacetime publish failed (exit=1)\n--- stderr ---\n Updating crates.io index\n Locking 72 packages to latest compatible versions\n Adding generic-array v0.14.7 (available: v0.14.9)\n Adding spacetimedb v1.11.1 (available: v1.11.3)\n Adding spacetimedb-bindings-macro v1.11.1 (available: v1.11.3)\n Adding spacetimedb-bindings-sys v1.11.1 (available: v1.11.3)\n Adding spacetimedb-lib v1.11.1 (available: v1.11.3)\n Adding spacetimedb-primitives v1.11.1 (available: v1.11.3)\n Adding spacetimedb-sats v1.11.1 (available: v1.11.3)\n Compiling proc-macro2 v1.0.106\n Compiling quote v1.0.44\n Compiling unicode-ident v1.0.22\n Compiling typenum v1.19.0\n Compiling version_check v0.9.5\n Compiling autocfg v1.5.0\n Compiling serde_core v1.0.228\n Compiling heck v0.5.0\n Compiling cfg-if v1.0.4\n Compiling shlex v1.3.0\n Compiling either v1.15.0\n Compiling serde v1.0.228\n Compiling find-msvc-tools v0.1.8\n Compiling zerocopy v0.8.34\n Compiling thiserror v1.0.69\n Compiling bitflags v2.10.0\n Compiling nohash-hasher v0.2.0\n Compiling anyhow v1.0.100\n Compiling keccak v0.1.5\n Compiling bytes v1.11.0\n Compiling humantime v2.3.0\n Compiling convert_case v0.4.0\n Compiling zmij v1.0.17\n Compiling heck v0.4.1\n Compiling arrayvec v0.7.6\n Compiling second-stack v0.3.5\n Compiling serde_json v1.0.149\n Compiling hex v0.4.3\n Compiling bytemuck v1.24.0\n Compiling getrandom v0.2.17\n Compiling itoa v1.0.17\n Compiling smallvec v1.15.1\n Compiling arrayref v0.3.9\n Compiling itertools v0.12.1\n Compiling spacetimedb-lib v1.11.1\n Compiling constant_time_eq v0.4.2\n Compiling log v0.4.29\n Compiling memchr v2.7.6\n Compiling rand_core v0.6.4\n Compiling cc v1.2.54\n Compiling scoped-tls v1.0.1\n Compiling generic-array v0.14.7\n Compiling num-traits v0.2.19\n Compiling syn v2.0.114\n Compiling http v1.4.0\n Compiling approx v0.3.2\n Compiling chrono v0.4.43\n Compiling decorum v0.3.1\n Compiling blake3 v1.8.3\n Compiling crypto-common v0.1.7\n Compiling block-buffer v0.10.4\n Compiling digest v0.10.7\n Compiling sha3 v0.10.8\n Compiling ppv-lite86 v0.2.21\n Compiling ethnum v1.5.2\n Compiling rand_chacha v0.3.1\n Compiling rand v0.8.5\n Compiling enum-as-inner v0.6.1\n Compiling thiserror-impl v1.0.69\n Compiling derive_more v0.99.20\n Compiling spacetimedb-primitives v1.11.1\n Compiling spacetimedb-bindings-macro v1.11.1\n Compiling spacetimedb-bindings-sys v1.11.1\n Compiling spacetimedb-sats v1.11.1\n Compiling spacetimedb v1.11.1\n Compiling spacetime-module v0.1.0 (/__w/SpacetimeDB/SpacetimeDB/target/llm-runs/basics/t_002_scheduled_table/rust/server/gpt-5/llm)\nerror: expected one of: `public`, `private`, `name`, `index`, `scheduled`\n --> src/lib.rs:4:28\n |\n4 | #[table(name = tick_timer, schedule(reducer = tick, column = scheduled_at))]\n | ^^^^^^^^\n\nerror[E0422]: cannot find struct, variant or union type `TickTimer` in this scope\n --> src/lib.rs:17:21\n |\n17 | .insert(TickTimer { scheduled_id: 0, scheduled_at: ScheduleAt::repeat_micros(50_000) });\n | ^^^^^^^^^ not found in this scope\n\nerror[E0599]: no method named `tick_timer` found for struct `Local` in the current scope\n --> src/lib.rs:14:15\n |\n14 | if ctx.db.tick_timer().count() == 0 {\n | ^^^^^^^^^^ method not found in `Local`\n\nerror[E0599]: no method named `tick_timer` found for struct `Local` in the current scope\n --> src/lib.rs:16:14\n |\n15 | / ctx.db\n16 | | .tick_timer()\n | | -^^^^^^^^^^ method not found in `Local`\n | |_____________|\n |\n\nerror[E0599]: no variant or associated item named `repeat_micros` found for enum `ScheduleAt` in the current scope\n --> src/lib.rs:17:76\n |\n17 | .insert(TickTimer { scheduled_id: 0, scheduled_at: ScheduleAt::repeat_micros(50_000) });\n | ^^^^^^^^^^^^^ variant or associated item not found in `ScheduleAt`\n\nSome errors have detailed explanations: E0422, E0599.\nFor more information about an error, try `rustc --explain E0422`.\nerror: could not compile `spacetime-module` (lib) due to 5 previous errors\nError: command [\"cargo\", \"build\", \"--config=net.git-fetch-with-cli=true\", \"--target=wasm32-unknown-unknown\", \"--release\", \"--message-format=json-render-diagnostics\"] exited with code 101\n\n--- stdout ---\n", + "error": "spacetime publish failed (exit=1)\n--- stderr ---\n Updating crates.io index\n Locking 72 packages to latest compatible versions\n Adding generic-array v0.14.7 (available: v0.14.9)\n Adding spacetimedb v1.11.1 (available: v1.11.3)\n Adding spacetimedb-bindings-macro v1.11.1 (available: v1.11.3)\n Adding spacetimedb-bindings-sys v1.11.1 (available: v1.11.3)\n Adding spacetimedb-lib v1.11.1 (available: v1.11.3)\n Adding spacetimedb-primitives v1.11.1 (available: v1.11.3)\n Adding spacetimedb-sats v1.11.1 (available: v1.11.3)\n Compiling proc-macro2 v1.0.106\n Compiling quote v1.0.44\n Compiling unicode-ident v1.0.22\n Compiling typenum v1.19.0\n Compiling version_check v0.9.5\n Compiling autocfg v1.5.0\n Compiling heck v0.5.0\n Compiling serde_core v1.0.228\n Compiling cfg-if v1.0.4\n Compiling find-msvc-tools v0.1.8\n Compiling either v1.15.0\n Compiling shlex v1.3.0\n Compiling serde v1.0.228\n Compiling zerocopy v0.8.34\n Compiling thiserror v1.0.69\n Compiling bitflags v2.10.0\n Compiling nohash-hasher v0.2.0\n Compiling anyhow v1.0.100\n Compiling bytes v1.11.0\n Compiling arrayvec v0.7.6\n Compiling humantime v2.3.0\n Compiling keccak v0.1.5\n Compiling zmij v1.0.17\n Compiling heck v0.4.1\n Compiling convert_case v0.4.0\n Compiling smallvec v1.15.1\n Compiling hex v0.4.3\n Compiling second-stack v0.3.5\n Compiling constant_time_eq v0.4.2\n Compiling arrayref v0.3.9\n Compiling getrandom v0.2.17\n Compiling itertools v0.12.1\n Compiling cc v1.2.54\n Compiling itoa v1.0.17\n Compiling spacetimedb-lib v1.11.1\n Compiling serde_json v1.0.149\n Compiling rand_core v0.6.4\n Compiling bytemuck v1.24.0\n Compiling log v0.4.29\n Compiling memchr v2.7.6\n Compiling scoped-tls v1.0.1\n Compiling generic-array v0.14.7\n Compiling num-traits v0.2.19\n Compiling http v1.4.0\n Compiling syn v2.0.114\n Compiling approx v0.3.2\n Compiling chrono v0.4.43\n Compiling decorum v0.3.1\n Compiling blake3 v1.8.3\n Compiling block-buffer v0.10.4\n Compiling crypto-common v0.1.7\n Compiling digest v0.10.7\n Compiling sha3 v0.10.8\n Compiling ethnum v1.5.2\n Compiling ppv-lite86 v0.2.21\n Compiling rand_chacha v0.3.1\n Compiling rand v0.8.5\n Compiling enum-as-inner v0.6.1\n Compiling thiserror-impl v1.0.69\n Compiling derive_more v0.99.20\n Compiling spacetimedb-primitives v1.11.1\n Compiling spacetimedb-bindings-sys v1.11.1\n Compiling spacetimedb-bindings-macro v1.11.1\n Compiling spacetimedb-sats v1.11.1\n Compiling spacetimedb v1.11.1\n Compiling spacetime-module v0.1.0 (/__w/SpacetimeDB/SpacetimeDB/target/llm-runs/basics/t_002_scheduled_table/rust/server/gpt-5/llm)\nerror: expected one of: `public`, `private`, `name`, `index`, `scheduled`\n --> src/lib.rs:4:28\n |\n4 | #[table(name = tick_timer, schedule(reducer = tick, column = scheduled_at))]\n | ^^^^^^^^\n\nerror[E0422]: cannot find struct, variant or union type `TickTimer` in this scope\n --> src/lib.rs:15:36\n |\n15 | ctx.db.tick_timer().insert(TickTimer {\n | ^^^^^^^^^ not found in this scope\n\nerror[E0599]: no method named `tick_timer` found for struct `Local` in the current scope\n --> src/lib.rs:14:15\n |\n14 | if ctx.db.tick_timer().count() == 0 {\n | ^^^^^^^^^^ method not found in `Local`\n\nerror[E0599]: no method named `tick_timer` found for struct `Local` in the current scope\n --> src/lib.rs:15:16\n |\n15 | ctx.db.tick_timer().insert(TickTimer {\n | ^^^^^^^^^^ method not found in `Local`\n\nerror[E0599]: no variant or associated item named `repeat_micros` found for enum `ScheduleAt` in the current scope\n --> src/lib.rs:17:39\n |\n17 | scheduled_at: ScheduleAt::repeat_micros(50_000),\n | ^^^^^^^^^^^^^ variant or associated item not found in `ScheduleAt`\n\nSome errors have detailed explanations: E0422, E0599.\nFor more information about an error, try `rustc --explain E0422`.\nerror: could not compile `spacetime-module` (lib) due to 5 previous errors\nError: command [\"cargo\", \"build\", \"--config=net.git-fetch-with-cli=true\", \"--target=wasm32-unknown-unknown\", \"--release\", \"--message-format=json-render-diagnostics\"] exited with code 101\n\n--- stdout ---\n", "phase": "build_or_publish" } } }, "vendor": "openai", - "started_at": "2026-01-27T19:51:00.465423417Z", - "finished_at": "2026-01-27T19:51:47.339587032Z" + "started_at": "2026-01-26T19:28:10.719260484Z", + "finished_at": "2026-01-26T19:29:24.230351153Z" }, "t_003_struct_in_table": { - "hash": "2a0f4ec42cac03fb3da542793b311e4b399845c688bb0660a6c231c82e96c56a", + "hash": "da32ac1e4a22e29f27c1c75b3ce526f5ba909c184b9057d83384313a5e7b881a", "task": "t_003_struct_in_table", "lang": "rust", "golden_published": true, "model_name": "GPT-5", "total_tests": 1, - "passed_tests": 1, - "llm_output": "use spacetimedb::SpacetimeType;\n\n#[derive(SpacetimeType)]\npub struct Position {\n x: i32,\n y: i32,\n}\n\n#[spacetimedb::table(name = entity)]\npub struct Entity {\n #[primary_key]\n id: i32,\n pos: Position,\n}", + "passed_tests": 0, + "llm_output": "use spacetimedb::{table, reducer, ReducerContext, Table, SpacetimeType};\n\n#[derive(SpacetimeType)]\npub struct Position {\n x: i32,\n y: i32,\n}\n\n#[table(name = entity)]\npub struct Entity {\n #[primary_key]\n id: i32,\n pos: Position,\n}\n\n#[reducer]\npub fn add_entity(ctx: &ReducerContext, id: i32, x: i32, y: i32) {\n ctx.db.entity().insert(Entity { id, pos: Position { x, y } });\n}", "category": "basics", "route_api_model": "gpt-5", "golden_db": "basics-t-003-struct-in-table-golden", @@ -125,25 +125,30 @@ "work_dir_llm": "target/llm-runs/basics/t_003_struct_in_table/rust/server/gpt-5/llm", "scorer_details": { "schema_parity": { - "pass": true, - "partial": 1.0, + "pass": false, + "partial": 0.0, "notes": { "golden_db": "basics-t-003-struct-in-table-golden", "llm_db": "basics-t-003-struct-in-table-gpt-5-llm", - "reducers_diff": null, - "reducers_equal": true, - "server": "http://127.0.0.1:33615", + "reducers_diff": { + "only_golden": [], + "only_llm": [ + "add_entity()" + ] + }, + "reducers_equal": false, + "server": "http://127.0.0.1:44233", "tables_diff": null, "tables_equal": true } } }, "vendor": "openai", - "started_at": "2026-01-27T19:50:43.120116357Z", - "finished_at": "2026-01-27T19:51:34.789700080Z" + "started_at": "2026-01-26T19:27:53.381607365Z", + "finished_at": "2026-01-26T19:28:20.526037052Z" }, "t_004_insert": { - "hash": "2a0f4ec42cac03fb3da542793b311e4b399845c688bb0660a6c231c82e96c56a", + "hash": "da32ac1e4a22e29f27c1c75b3ce526f5ba909c184b9057d83384313a5e7b881a", "task": "t_004_insert", "lang": "rust", "golden_published": true, @@ -158,19 +163,6 @@ "work_dir_golden": "target/llm-runs/basics/t_004_insert/rust/server/golden", "work_dir_llm": "target/llm-runs/basics/t_004_insert/rust/server/gpt-5/llm", "scorer_details": { - "schema_parity": { - "pass": true, - "partial": 1.0, - "notes": { - "golden_db": "basics-t-004-insert-golden", - "llm_db": "basics-t-004-insert-gpt-5-llm", - "reducers_diff": null, - "reducers_equal": true, - "server": "http://127.0.0.1:33615", - "tables_diff": null, - "tables_equal": true - } - }, "data_parity_insert_user": { "pass": true, "partial": 1.0, @@ -187,23 +179,36 @@ "llm_out": "id | name | age | active ----+---------+-----+-------- 1 | \"Alice\" | 30 | true", "query": "SELECT id, name, age, active FROM user WHERE id=1", "reducer": "insert_user", - "server": "http://127.0.0.1:33615" + "server": "http://127.0.0.1:44233" + } + }, + "schema_parity": { + "pass": true, + "partial": 1.0, + "notes": { + "golden_db": "basics-t-004-insert-golden", + "llm_db": "basics-t-004-insert-gpt-5-llm", + "reducers_diff": null, + "reducers_equal": true, + "server": "http://127.0.0.1:44233", + "tables_diff": null, + "tables_equal": true } } }, "vendor": "openai", - "started_at": "2026-01-27T19:51:00.012104606Z", - "finished_at": "2026-01-27T19:51:27.169795394Z" + "started_at": "2026-01-26T19:28:03.162962728Z", + "finished_at": "2026-01-26T19:28:30.365311126Z" }, "t_005_update": { - "hash": "2a0f4ec42cac03fb3da542793b311e4b399845c688bb0660a6c231c82e96c56a", + "hash": "da32ac1e4a22e29f27c1c75b3ce526f5ba909c184b9057d83384313a5e7b881a", "task": "t_005_update", "lang": "rust", "golden_published": true, "model_name": "GPT-5", "total_tests": 3, "passed_tests": 3, - "llm_output": "use spacetimedb::{table, reducer, ReducerContext, Table};\n\n#[table(name = user)]\npub struct User {\n #[primary_key]\n id: i32,\n name: String,\n age: i32,\n active: bool,\n}\n\n#[reducer]\npub fn update_user(ctx: &ReducerContext, id: i32, name: String, age: i32, active: bool) {\n let row = User { id, name, age, active };\n ctx.db.user().id().update(row);\n}", + "llm_output": "use spacetimedb::{table, reducer, ReducerContext, Table, UniqueColumn};\n\n#[table(name = user)]\npub struct User {\n #[primary_key]\n id: i32,\n name: String,\n age: i32,\n active: bool,\n}\n\n#[reducer]\npub fn update_user(ctx: &ReducerContext, id: i32, name: String, age: i32, active: bool) {\n ctx.db.user().id().update(User { id, name, age, active });\n}", "category": "basics", "route_api_model": "gpt-5", "golden_db": "basics-t-005-update-golden", @@ -219,11 +224,18 @@ "llm_db": "basics-t-005-update-gpt-5-llm", "reducers_diff": null, "reducers_equal": true, - "server": "http://127.0.0.1:33615", + "server": "http://127.0.0.1:44233", "tables_diff": null, "tables_equal": true } }, + "seed_users_row": { + "pass": true, + "partial": 1.0, + "notes": { + "sql": "INSERT INTO user(id, name, age, active) VALUES (1, 'Alice', 30, true)" + } + }, "data_parity_update_user": { "pass": true, "partial": 1.0, @@ -240,30 +252,23 @@ "llm_out": "id | name | age | active ----+----------+-----+-------- 1 | \"Alice2\" | 31 | false", "query": "SELECT id, name, age, active FROM user WHERE id=1", "reducer": "update_user", - "server": "http://127.0.0.1:33615" - } - }, - "seed_users_row": { - "pass": true, - "partial": 1.0, - "notes": { - "sql": "INSERT INTO user(id, name, age, active) VALUES (1, 'Alice', 30, true)" + "server": "http://127.0.0.1:44233" } } }, "vendor": "openai", - "started_at": "2026-01-27T19:50:22.268945837Z", - "finished_at": "2026-01-27T19:51:01.660325703Z" + "started_at": "2026-01-26T19:27:50.273973455Z", + "finished_at": "2026-01-26T19:28:39.660285285Z" }, "t_006_delete": { - "hash": "2a0f4ec42cac03fb3da542793b311e4b399845c688bb0660a6c231c82e96c56a", + "hash": "da32ac1e4a22e29f27c1c75b3ce526f5ba909c184b9057d83384313a5e7b881a", "task": "t_006_delete", "lang": "rust", "golden_published": true, "model_name": "GPT-5", "total_tests": 3, "passed_tests": 3, - "llm_output": "use spacetimedb::{table, reducer, ReducerContext};\n\n#[table(name = user)]\npub struct User {\n #[primary_key]\n id: i32,\n name: String,\n age: i32,\n active: bool,\n}\n\n#[reducer]\npub fn delete_user(ctx: &ReducerContext, id: i32) {\n ctx.db.user().id().delete(&id);\n}", + "llm_output": "use spacetimedb::{table, reducer, ReducerContext, Table};\n\n#[table(name = user)]\npub struct User {\n #[primary_key]\n id: i32,\n name: String,\n age: i32,\n active: bool,\n}\n\n#[reducer]\npub fn delete_user(ctx: &ReducerContext, id: i32) {\n ctx.db.user().id().delete(&id);\n}", "category": "basics", "route_api_model": "gpt-5", "golden_db": "basics-t-006-delete-golden", @@ -271,13 +276,6 @@ "work_dir_golden": "target/llm-runs/basics/t_006_delete/rust/server/golden", "work_dir_llm": "target/llm-runs/basics/t_006_delete/rust/server/gpt-5/llm", "scorer_details": { - "seed_users_row": { - "pass": true, - "partial": 1.0, - "notes": { - "sql": "INSERT INTO user(id, name, age, active) VALUES (1, 'Alice', 30, true)" - } - }, "schema_parity": { "pass": true, "partial": 1.0, @@ -286,7 +284,7 @@ "llm_db": "basics-t-006-delete-gpt-5-llm", "reducers_diff": null, "reducers_equal": true, - "server": "http://127.0.0.1:33615", + "server": "http://127.0.0.1:44233", "tables_diff": null, "tables_equal": true } @@ -299,21 +297,28 @@ "expected": 0, "sql": "SELECT COUNT(*) AS n FROM user WHERE id=1" } + }, + "seed_users_row": { + "pass": true, + "partial": 1.0, + "notes": { + "sql": "INSERT INTO user(id, name, age, active) VALUES (1, 'Alice', 30, true)" + } } }, "vendor": "openai", - "started_at": "2026-01-27T19:50:18.814239252Z", - "finished_at": "2026-01-27T19:51:00.465380864Z" + "started_at": "2026-01-26T19:27:19.862018853Z", + "finished_at": "2026-01-26T19:27:52.325711770Z" }, "t_007_crud": { - "hash": "2a0f4ec42cac03fb3da542793b311e4b399845c688bb0660a6c231c82e96c56a", + "hash": "da32ac1e4a22e29f27c1c75b3ce526f5ba909c184b9057d83384313a5e7b881a", "task": "t_007_crud", "lang": "rust", "golden_published": true, "model_name": "GPT-5", "total_tests": 4, "passed_tests": 4, - "llm_output": "use spacetimedb::{table, reducer, ReducerContext, Table};\n\n#[table(name = user)]\npub struct User {\n #[primary_key]\n id: i32,\n name: String,\n age: i32,\n active: bool,\n}\n\n#[reducer]\npub fn crud(ctx: &ReducerContext) {\n let users = ctx.db.user();\n\n // insert (id=1, name=\"Alice\", age=30, active=true)\n users.insert(User {\n id: 1,\n name: \"Alice\".to_string(),\n age: 30,\n active: true,\n });\n\n // insert (id=2, name=\"Bob\", age=22, active=false)\n users.insert(User {\n id: 2,\n name: \"Bob\".to_string(),\n age: 22,\n active: false,\n });\n\n // update (id=1, name=\"Alice2\", age=31, active=false)\n users.id().update(User {\n id: 1,\n name: \"Alice2\".to_string(),\n age: 31,\n active: false,\n });\n\n // delete id=2\n users.id().delete(&2);\n}", + "llm_output": "use spacetimedb::{table, reducer, ReducerContext, Table};\n\n#[table(name = user)]\npub struct User {\n #[primary_key]\n id: i32,\n name: String,\n age: i32,\n active: bool,\n}\n\n#[reducer]\npub fn crud(ctx: &ReducerContext) {\n let users = ctx.db.user();\n\n users.insert(User { id: 1, name: \"Alice\".to_string(), age: 30, active: true });\n users.insert(User { id: 2, name: \"Bob\".to_string(), age: 22, active: false });\n\n let updated = User { id: 1, name: \"Alice2\".to_string(), age: 31, active: false };\n users.id().update(updated);\n\n users.id().delete(&2);\n}", "category": "basics", "route_api_model": "gpt-5", "golden_db": "basics-t-007-crud-golden", @@ -330,19 +335,6 @@ "sql": "SELECT COUNT(*) AS n FROM user WHERE id=2" } }, - "schema_parity": { - "pass": true, - "partial": 1.0, - "notes": { - "golden_db": "basics-t-007-crud-golden", - "llm_db": "basics-t-007-crud-gpt-5-llm", - "reducers_diff": null, - "reducers_equal": true, - "server": "http://127.0.0.1:33615", - "tables_diff": null, - "tables_equal": true - } - }, "crud_total_count_one": { "pass": true, "partial": 1.0, @@ -363,23 +355,36 @@ "llm_out": "id | name | age | active ----+----------+-----+-------- 1 | \"Alice2\" | 31 | false", "query": "SELECT id, name, age, active FROM user WHERE id=1", "reducer": "crud", - "server": "http://127.0.0.1:33615" + "server": "http://127.0.0.1:44233" + } + }, + "schema_parity": { + "pass": true, + "partial": 1.0, + "notes": { + "golden_db": "basics-t-007-crud-golden", + "llm_db": "basics-t-007-crud-gpt-5-llm", + "reducers_diff": null, + "reducers_equal": true, + "server": "http://127.0.0.1:44233", + "tables_diff": null, + "tables_equal": true } } }, "vendor": "openai", - "started_at": "2026-01-27T19:50:19.572189963Z", - "finished_at": "2026-01-27T19:51:00.012056746Z" + "started_at": "2026-01-26T19:27:23.893528453Z", + "finished_at": "2026-01-26T19:28:07.775124578Z" }, "t_008_index_lookup": { - "hash": "2a0f4ec42cac03fb3da542793b311e4b399845c688bb0660a6c231c82e96c56a", + "hash": "da32ac1e4a22e29f27c1c75b3ce526f5ba909c184b9057d83384313a5e7b881a", "task": "t_008_index_lookup", "lang": "rust", "golden_published": true, "model_name": "GPT-5", "total_tests": 3, "passed_tests": 3, - "llm_output": "use spacetimedb::{table, reducer, ReducerContext, Table};\n\n#[table(name = user)]\npub struct User {\n #[primary_key]\n id: i32,\n name: String,\n age: i32,\n active: bool,\n}\n\n#[table(name = result)]\npub struct ResultRow {\n #[primary_key]\n id: i32,\n name: String,\n}\n\n#[reducer]\npub fn lookup_user_name(ctx: &ReducerContext, id: i32) {\n if let Some(user) = ctx.db.user().id().find(id) {\n let _ = ctx.db.result().try_insert(ResultRow {\n id: user.id,\n name: user.name.clone(),\n });\n }\n}", + "llm_output": "use spacetimedb::{table, reducer, ReducerContext, Table, UniqueColumn};\n\n#[table(name = user)]\npub struct User {\n #[primary_key]\n id: i32,\n name: String,\n age: i32,\n active: bool,\n}\n\n#[table(name = result)]\npub struct ResultRow {\n #[primary_key]\n id: i32,\n name: String,\n}\n\n#[reducer]\npub fn lookup_user_name(ctx: &ReducerContext, id: i32) {\n if let Some(user) = ctx.db.user().id().find(id) {\n let _ = ctx.db.result().id().delete(&id);\n ctx.db.result().insert(ResultRow { id: user.id, name: user.name });\n }\n}", "category": "basics", "route_api_model": "gpt-5", "golden_db": "basics-t-008-index-lookup-golden", @@ -387,13 +392,6 @@ "work_dir_golden": "target/llm-runs/basics/t_008_index_lookup/rust/server/golden", "work_dir_llm": "target/llm-runs/basics/t_008_index_lookup/rust/server/gpt-5/llm", "scorer_details": { - "seed_user_row": { - "pass": true, - "partial": 1.0, - "notes": { - "sql": "INSERT INTO user(id, name, age, active) VALUES (1, 'Alice', 30, true)" - } - }, "schema_parity": { "pass": true, "partial": 1.0, @@ -402,7 +400,7 @@ "llm_db": "basics-t-008-index-lookup-gpt-5-llm", "reducers_diff": null, "reducers_equal": true, - "server": "http://127.0.0.1:33615", + "server": "http://127.0.0.1:44233", "tables_diff": null, "tables_equal": true } @@ -420,23 +418,30 @@ "llm_out": "id | name ----+--------- 1 | \"Alice\"", "query": "SELECT id, name FROM result WHERE id=1", "reducer": "lookup_user_name", - "server": "http://127.0.0.1:33615" + "server": "http://127.0.0.1:44233" + } + }, + "seed_user_row": { + "pass": true, + "partial": 1.0, + "notes": { + "sql": "INSERT INTO user(id, name, age, active) VALUES (1, 'Alice', 30, true)" } } }, "vendor": "openai", - "started_at": "2026-01-27T19:50:59.032238062Z", - "finished_at": "2026-01-27T19:51:34.520084103Z" + "started_at": "2026-01-26T19:28:01.265667865Z", + "finished_at": "2026-01-26T19:28:38.153772708Z" }, "t_009_init": { - "hash": "2a0f4ec42cac03fb3da542793b311e4b399845c688bb0660a6c231c82e96c56a", + "hash": "da32ac1e4a22e29f27c1c75b3ce526f5ba909c184b9057d83384313a5e7b881a", "task": "t_009_init", "lang": "rust", "golden_published": true, "model_name": "GPT-5", "total_tests": 4, "passed_tests": 4, - "llm_output": "use spacetimedb::{ReducerContext, Table};\n\n#[spacetimedb::table(name = user)]\npub struct User {\n #[primary_key]\n id: i32,\n name: String,\n age: i32,\n active: bool,\n}\n\n#[spacetimedb::reducer(init)]\npub fn init(ctx: &ReducerContext) {\n ctx.db.user().insert(User {\n id: 1,\n name: \"Alice\".to_string(),\n age: 30,\n active: true,\n });\n ctx.db.user().insert(User {\n id: 2,\n name: \"Bob\".to_string(),\n age: 22,\n active: false,\n });\n}", + "llm_output": "use spacetimedb::{ReducerContext, Table};\n\n#[spacetimedb::table(name = user)]\npub struct User {\n #[primary_key]\n id: i32,\n name: String,\n age: i32,\n active: bool,\n}\n\n#[spacetimedb::reducer(init)]\npub fn init(ctx: &ReducerContext) {\n let user = ctx.db.user();\n user.insert(User { id: 1, name: \"Alice\".to_string(), age: 30, active: true });\n user.insert(User { id: 2, name: \"Bob\".to_string(), age: 22, active: false });\n}", "category": "basics", "route_api_model": "gpt-5", "golden_db": "basics-t-009-init-golden", @@ -453,15 +458,6 @@ "sql": "SELECT COUNT(*) AS n FROM user WHERE id=2 AND name='Bob' AND age=22 AND active=false" } }, - "init_seed_alice": { - "pass": true, - "partial": 1.0, - "notes": { - "actual": 1, - "expected": 1, - "sql": "SELECT COUNT(*) AS n FROM user WHERE id=1 AND name='Alice' AND age=30 AND active=true" - } - }, "schema_parity": { "pass": true, "partial": 1.0, @@ -470,7 +466,7 @@ "llm_db": "basics-t-009-init-gpt-5-llm", "reducers_diff": null, "reducers_equal": true, - "server": "http://127.0.0.1:33615", + "server": "http://127.0.0.1:44233", "tables_diff": null, "tables_equal": true } @@ -483,21 +479,30 @@ "expected": 2, "sql": "SELECT COUNT(*) AS n FROM user" } + }, + "init_seed_alice": { + "pass": true, + "partial": 1.0, + "notes": { + "actual": 1, + "expected": 1, + "sql": "SELECT COUNT(*) AS n FROM user WHERE id=1 AND name='Alice' AND age=30 AND active=true" + } } }, "vendor": "openai", - "started_at": "2026-01-27T19:50:21.549783Z", - "finished_at": "2026-01-27T19:50:59.032183836Z" + "started_at": "2026-01-26T19:27:35.047568301Z", + "finished_at": "2026-01-26T19:28:10.719222494Z" }, "t_010_connect": { - "hash": "2a0f4ec42cac03fb3da542793b311e4b399845c688bb0660a6c231c82e96c56a", + "hash": "da32ac1e4a22e29f27c1c75b3ce526f5ba909c184b9057d83384313a5e7b881a", "task": "t_010_connect", "lang": "rust", "golden_published": true, "model_name": "GPT-5", "total_tests": 1, "passed_tests": 1, - "llm_output": "use spacetimedb::{ReducerContext, Table};\n\n#[spacetimedb::table(name = event)]\npub struct Event {\n #[primary_key]\n #[auto_inc]\n id: i32,\n kind: String,\n}\n\n#[spacetimedb::reducer(client_connected)]\npub fn client_connected(ctx: &ReducerContext) {\n let _ = ctx.db.event().insert(Event { id: 0, kind: \"connected\".to_string() });\n}\n\n#[spacetimedb::reducer(client_disconnected)]\npub fn client_disconnected(ctx: &ReducerContext) {\n let _ = ctx.db.event().insert(Event { id: 0, kind: \"disconnected\".to_string() });\n}", + "llm_output": "use spacetimedb::{table, reducer, ReducerContext, Table};\n\n#[table(name = event)]\npub struct Event {\n #[primary_key]\n #[auto_inc]\n id: i32,\n kind: String,\n}\n\n#[reducer(client_connected)]\npub fn client_connected(ctx: &ReducerContext) {\n ctx.db.event().insert(Event { id: 0, kind: \"connected\".to_string() });\n}\n\n#[reducer(client_disconnected)]\npub fn client_disconnected(ctx: &ReducerContext) {\n ctx.db.event().insert(Event { id: 0, kind: \"disconnected\".to_string() });\n}", "category": "basics", "route_api_model": "gpt-5", "golden_db": "basics-t-010-connect-golden", @@ -513,25 +518,25 @@ "llm_db": "basics-t-010-connect-gpt-5-llm", "reducers_diff": null, "reducers_equal": true, - "server": "http://127.0.0.1:33615", + "server": "http://127.0.0.1:44233", "tables_diff": null, "tables_equal": true } } }, "vendor": "openai", - "started_at": "2026-01-27T19:50:19.565630879Z", - "finished_at": "2026-01-27T19:50:43.120012892Z" + "started_at": "2026-01-26T19:27:22.864510006Z", + "finished_at": "2026-01-26T19:28:01.265636007Z" }, "t_011_helper_function": { - "hash": "2a0f4ec42cac03fb3da542793b311e4b399845c688bb0660a6c231c82e96c56a", + "hash": "da32ac1e4a22e29f27c1c75b3ce526f5ba909c184b9057d83384313a5e7b881a", "task": "t_011_helper_function", "lang": "rust", "golden_published": true, "model_name": "GPT-5", "total_tests": 3, "passed_tests": 3, - "llm_output": "use spacetimedb::{table, reducer, ReducerContext, Table};\n\n#[table(name = result)]\npub struct ResultRow {\n #[primary_key]\n id: i32,\n sum: i32,\n}\n\nfn add(a: i32, b: i32) -> i32 {\n a + b\n}\n\n#[reducer]\npub fn compute_sum(ctx: &ReducerContext, id: i32, a: i32, b: i32) {\n let sum = add(a, b);\n ctx.db.result().insert(ResultRow { id, sum });\n}", + "llm_output": "use spacetimedb::{table, reducer, ReducerContext, Table};\n\n#[table(name = result)]\npub struct ResultRow {\n #[primary_key]\n id: i32,\n sum: i32,\n}\n\nfn add(a: i32, b: i32) -> i32 {\n a + b\n}\n\n#[reducer]\nfn compute_sum(ctx: &ReducerContext, id: i32, a: i32, b: i32) {\n let sum = add(a, b);\n ctx.db.result().insert(ResultRow { id, sum });\n}", "category": "basics", "route_api_model": "gpt-5", "golden_db": "basics-t-011-helper-function-golden", @@ -554,7 +559,20 @@ "llm_out": "id | sum ----+----- 1 | 5", "query": "SELECT id, sum FROM result WHERE id=1", "reducer": "compute_sum", - "server": "http://127.0.0.1:33615" + "server": "http://127.0.0.1:44233" + } + }, + "schema_parity": { + "pass": true, + "partial": 1.0, + "notes": { + "golden_db": "basics-t-011-helper-function-golden", + "llm_db": "basics-t-011-helper-function-gpt-5-llm", + "reducers_diff": null, + "reducers_equal": true, + "server": "http://127.0.0.1:44233", + "tables_diff": null, + "tables_equal": true } }, "helper_func_sum_abs": { @@ -566,6 +584,24 @@ "sql": "SELECT COUNT(*) AS n FROM result WHERE id=1 AND sum=5" } }, + "helper_func_sum_parity": { + "pass": true, + "partial": 1.0, + "notes": { + "args": [ + 1, + 2, + 3 + ], + "golden_db": "basics-t-011-helper-function-golden", + "golden_out": "id | sum ----+----- 1 | 5", + "llm_db": "basics-t-011-helper-function-gpt-5-llm", + "llm_out": "id | sum ----+----- 1 | 5", + "query": "SELECT id, sum FROM result WHERE id=1", + "reducer": "compute_sum", + "server": "http://127.0.0.1:41115" + } + }, "schema_parity": { "pass": true, "partial": 1.0, @@ -574,25 +610,25 @@ "llm_db": "basics-t-011-helper-function-gpt-5-llm", "reducers_diff": null, "reducers_equal": true, - "server": "http://127.0.0.1:33615", + "server": "http://127.0.0.1:41115", "tables_diff": null, "tables_equal": true } } }, "vendor": "openai", - "started_at": "2026-01-27T19:51:00.227420335Z", - "finished_at": "2026-01-27T19:51:29.538171947Z" + "started_at": "2026-01-26T19:28:07.775155436Z", + "finished_at": "2026-01-26T19:28:36.996978868Z" }, "t_012_spacetime_product_type": { - "hash": "2a0f4ec42cac03fb3da542793b311e4b399845c688bb0660a6c231c82e96c56a", + "hash": "da32ac1e4a22e29f27c1c75b3ce526f5ba909c184b9057d83384313a5e7b881a", "task": "t_012_spacetime_product_type", "lang": "rust", "golden_published": true, "model_name": "GPT-5", "total_tests": 3, "passed_tests": 3, - "llm_output": "use spacetimedb::{table, reducer, ReducerContext, Table, SpacetimeType};\n\n#[derive(SpacetimeType)]\npub struct Score {\n left: i32,\n right: i32,\n}\n\n#[table(name = result)]\npub struct ResultRow {\n #[primary_key]\n id: i32,\n value: Score,\n}\n\n#[reducer]\nfn set_score(ctx: &ReducerContext, id: i32, left: i32, right: i32) {\n ctx.db.result().insert(ResultRow {\n id,\n value: Score { left, right },\n });\n}", + "llm_output": "use spacetimedb::{table, reducer, ReducerContext, Table, SpacetimeType};\n\n#[derive(SpacetimeType)]\npub struct Score {\n left: i32,\n right: i32,\n}\n\n#[table(name = result)]\npub struct ResultRow {\n #[primary_key]\n id: i32,\n value: Score,\n}\n\n#[reducer]\npub fn set_score(ctx: &ReducerContext, id: i32, left: i32, right: i32) {\n ctx.db.result().insert(ResultRow { id, value: Score { left, right } });\n}", "category": "schema", "route_api_model": "gpt-5", "golden_db": "schema-t-012-spacetime-product-type-golden", @@ -617,7 +653,7 @@ "llm_db": "schema-t-012-spacetime-product-type-gpt-5-llm", "reducers_diff": null, "reducers_equal": true, - "server": "http://127.0.0.1:33615", + "server": "http://127.0.0.1:44233", "tables_diff": null, "tables_equal": true } @@ -637,23 +673,23 @@ "llm_out": "id | value ----+----------------------- 1 | (left = 2, right = 3)", "query": "SELECT id, value FROM result WHERE id=1", "reducer": "set_score", - "server": "http://127.0.0.1:33615" + "server": "http://127.0.0.1:44233" } } }, "vendor": "openai", - "started_at": "2026-01-27T19:50:17.029809591Z", - "finished_at": "2026-01-27T19:50:58.838714798Z" + "started_at": "2026-01-26T19:27:19.861773654Z", + "finished_at": "2026-01-26T19:27:55.243933613Z" }, "t_013_spacetime_sum_type": { - "hash": "2a0f4ec42cac03fb3da542793b311e4b399845c688bb0660a6c231c82e96c56a", + "hash": "da32ac1e4a22e29f27c1c75b3ce526f5ba909c184b9057d83384313a5e7b881a", "task": "t_013_spacetime_sum_type", "lang": "rust", "golden_published": true, "model_name": "GPT-5", "total_tests": 3, "passed_tests": 2, - "llm_output": "use spacetimedb::{table, reducer, ReducerContext, Table, SpacetimeType};\n\n#[derive(SpacetimeType)]\npub struct Rect {\n width: i32,\n height: i32,\n}\n\n#[derive(SpacetimeType)]\npub enum Shape {\n Circle(i32),\n Rectangle(Rect),\n}\n\n#[table(name = result)]\npub struct ResultRow {\n #[primary_key]\n id: i32,\n value: Shape,\n}\n\n#[reducer]\npub fn set_circle(ctx: &ReducerContext, id: i32, radius: i32) {\n ctx.db.result().insert(ResultRow {\n id,\n value: Shape::Circle(radius),\n });\n}", + "llm_output": "use spacetimedb::{reducer, table, ReducerContext, SpacetimeType, Table};\n\n#[derive(SpacetimeType, Clone)]\npub struct Rect {\n width: i32,\n height: i32,\n}\n\n#[derive(SpacetimeType, Clone)]\npub enum Shape {\n Circle(i32),\n Rectangle(Rect),\n}\n\n#[table(name = result)]\npub struct ResultRow {\n #[primary_key]\n id: i32,\n value: Shape,\n}\n\n#[reducer]\npub fn set_circle(ctx: &ReducerContext, id: i32, radius: i32) {\n ctx.db\n .result()\n .insert(ResultRow { id, value: Shape::Circle(radius) });\n}", "category": "schema", "route_api_model": "gpt-5", "golden_db": "schema-t-013-spacetime-sum-type-golden", @@ -665,10 +701,19 @@ "pass": false, "partial": 0.0, "notes": { - "error": "spacetime sql failed:\nWARNING: This command is UNSTABLE and subject to breaking changes.\n\nError: no such table: `result`. If the table exists, it may be marked private.\n\nCaused by:\n HTTP status client error (400 Bad Request) for url (http://127.0.0.1:33615/v1/database/c200ef5026b116b67d90edbd0acaca12a273f2a7e6e888cc7265a5d4a4fe7173/sql)\n", + "error": "spacetime sql failed:\nWARNING: This command is UNSTABLE and subject to breaking changes.\n\nError: no such table: `result`. If the table exists, it may be marked private.\n\nCaused by:\n HTTP status client error (400 Bad Request) for url (http://127.0.0.1:44233/v1/database/c200d2d3b6f126b42f6535fa1c89a272d1278f24e7645295553d055f0964bb68/sql)\n", "phase": "sql_golden" } }, + "sum_type_row_count": { + "pass": true, + "partial": 1.0, + "notes": { + "actual": 1, + "expected": 1, + "sql": "SELECT COUNT(*) AS n FROM result WHERE id=1" + } + }, "schema_parity": { "pass": true, "partial": 1.0, @@ -677,34 +722,25 @@ "llm_db": "schema-t-013-spacetime-sum-type-gpt-5-llm", "reducers_diff": null, "reducers_equal": true, - "server": "http://127.0.0.1:33615", + "server": "http://127.0.0.1:44233", "tables_diff": null, "tables_equal": true } - }, - "sum_type_row_count": { - "pass": true, - "partial": 1.0, - "notes": { - "actual": 1, - "expected": 1, - "sql": "SELECT COUNT(*) AS n FROM result WHERE id=1" - } } }, "vendor": "openai", - "started_at": "2026-01-27T19:49:28.665478058Z", - "finished_at": "2026-01-27T19:50:21.549671530Z" + "started_at": "2026-01-26T19:26:39.088386414Z", + "finished_at": "2026-01-26T19:27:19.723979899Z" }, "t_014_elementary_columns": { - "hash": "2a0f4ec42cac03fb3da542793b311e4b399845c688bb0660a6c231c82e96c56a", + "hash": "da32ac1e4a22e29f27c1c75b3ce526f5ba909c184b9057d83384313a5e7b881a", "task": "t_014_elementary_columns", "lang": "rust", "golden_published": true, "model_name": "GPT-5", "total_tests": 3, "passed_tests": 3, - "llm_output": "use spacetimedb::{ReducerContext, Table};\n\n#[spacetimedb::table(name = primitive)]\npub struct Primitive {\n #[primary_key]\n id: i32,\n count: i32,\n total: i64,\n price: f32,\n ratio: f64,\n active: bool,\n name: String,\n}\n\n#[spacetimedb::reducer]\npub fn seed(ctx: &ReducerContext) {\n ctx.db.primitive().insert(Primitive {\n id: 1,\n count: 2,\n total: 3_000_000_000,\n price: 1.5,\n ratio: 2.25,\n active: true,\n name: \"Alice\".to_string(),\n });\n}", + "llm_output": "use spacetimedb::{ReducerContext, Table};\n\n#[spacetimedb::table(name = primitive)]\npub struct Primitive {\n #[primary_key]\n id: i32,\n count: i32,\n total: i64,\n price: f32,\n ratio: f64,\n active: bool,\n name: String,\n}\n\n#[spacetimedb::reducer]\npub fn seed(ctx: &ReducerContext) {\n ctx.db.primitive().insert(Primitive {\n id: 1,\n count: 2,\n total: 3000000000,\n price: 1.5f32,\n ratio: 2.25,\n active: true,\n name: \"Alice\".to_string(),\n });\n}", "category": "schema", "route_api_model": "gpt-5", "golden_db": "schema-t-014-elementary-columns-golden", @@ -712,6 +748,15 @@ "work_dir_golden": "target/llm-runs/schema/t_014_elementary_columns/rust/server/golden", "work_dir_llm": "target/llm-runs/schema/t_014_elementary_columns/rust/server/gpt-5/llm", "scorer_details": { + "elementary_columns_row_count": { + "pass": true, + "partial": 1.0, + "notes": { + "actual": 1, + "expected": 1, + "sql": "SELECT COUNT(*) AS n FROM primitive WHERE id=1" + } + }, "elementary_columns_row_parity": { "pass": true, "partial": 1.0, @@ -723,7 +768,7 @@ "llm_out": "id | count | total | price | ratio | active | name ----+-------+------------+-------+-------+--------+--------- 1 | 2 | 3000000000 | 1.5 | 2.25 | true | \"Alice\"", "query": "SELECT id, count, total, price, ratio, active, name FROM primitive WHERE id=1", "reducer": "seed", - "server": "http://127.0.0.1:33615" + "server": "http://127.0.0.1:44233" } }, "schema_parity": { @@ -734,34 +779,25 @@ "llm_db": "schema-t-014-elementary-columns-gpt-5-llm", "reducers_diff": null, "reducers_equal": true, - "server": "http://127.0.0.1:33615", + "server": "http://127.0.0.1:44233", "tables_diff": null, "tables_equal": true } - }, - "elementary_columns_row_count": { - "pass": true, - "partial": 1.0, - "notes": { - "actual": 1, - "expected": 1, - "sql": "SELECT COUNT(*) AS n FROM primitive WHERE id=1" - } } }, "vendor": "openai", - "started_at": "2026-01-27T19:50:12.818589409Z", - "finished_at": "2026-01-27T19:51:00.227383147Z" + "started_at": "2026-01-26T19:27:08.469170041Z", + "finished_at": "2026-01-26T19:28:03.162920625Z" }, "t_015_product_type_columns": { - "hash": "2a0f4ec42cac03fb3da542793b311e4b399845c688bb0660a6c231c82e96c56a", + "hash": "da32ac1e4a22e29f27c1c75b3ce526f5ba909c184b9057d83384313a5e7b881a", "task": "t_015_product_type_columns", "lang": "rust", "golden_published": true, "model_name": "GPT-5", "total_tests": 3, - "passed_tests": 2, - "llm_output": "use spacetimedb::{table, reducer, ReducerContext, Table, SpacetimeType};\n\n#[derive(SpacetimeType, Clone)]\nstruct Address {\n street: String,\n zip: i32,\n}\n\n#[derive(SpacetimeType, Clone)]\nstruct Position {\n x: i32,\n y: i32,\n}\n\n#[table(name = profile)]\nstruct Profile {\n #[primary_key]\n id: i32,\n home: Address,\n work: Address,\n pos: Position,\n}\n\n#[reducer]\nfn seed(ctx: &ReducerContext) {\n let tbl = ctx.db.profile();\n if tbl.count() == 0 {\n let home = Address { street: \"1 Main\".to_string(), zip: 11111 };\n let work = Address { street: \"2 Broad\".to_string(), zip: 22222 };\n let pos = Position { x: 7, y: 9 };\n tbl.insert(Profile { id: 1, home, work, pos });\n }\n}", + "passed_tests": 3, + "llm_output": "use spacetimedb::{table, reducer, ReducerContext, Table, SpacetimeType};\n\n#[derive(SpacetimeType)]\npub struct Address {\n street: String,\n zip: i32,\n}\n\n#[derive(SpacetimeType)]\npub struct Position {\n x: i32,\n y: i32,\n}\n\n#[table(name = profile)]\npub struct Profile {\n #[primary_key]\n id: i32,\n home: Address,\n work: Address,\n pos: Position,\n}\n\n#[reducer]\npub fn seed(ctx: &ReducerContext) {\n ctx.db.profile().insert(Profile {\n id: 1,\n home: Address { street: \"1 Main\".to_string(), zip: 11111 },\n work: Address { street: \"2 Broad\".to_string(), zip: 22222 },\n pos: Position { x: 7, y: 9 },\n });\n}", "category": "schema", "route_api_model": "gpt-5", "golden_db": "schema-t-015-product-type-columns-golden", @@ -778,14 +814,6 @@ "sql": "SELECT COUNT(*) AS n FROM profile WHERE id=1" } }, - "product_type_columns_row_parity": { - "pass": false, - "partial": 0.0, - "notes": { - "error": "spacetime sql failed:\nWARNING: This command is UNSTABLE and subject to breaking changes.\n\nError: no such table: `profile`. If the table exists, it may be marked private.\n\nCaused by:\n HTTP status client error (400 Bad Request) for url (http://127.0.0.1:33615/v1/database/c200171a9841d8ed2a9c762ac4e081fe93ed52fe5c9e32ae9bbd874bb7e1a8b5/sql)\n", - "phase": "sql_golden" - } - }, "schema_parity": { "pass": true, "partial": 1.0, @@ -794,25 +822,39 @@ "llm_db": "schema-t-015-product-type-columns-gpt-5-llm", "reducers_diff": null, "reducers_equal": true, - "server": "http://127.0.0.1:33615", + "server": "http://127.0.0.1:44233", "tables_diff": null, "tables_equal": true } + }, + "product_type_columns_row_parity": { + "pass": true, + "partial": 1.0, + "notes": { + "args": [], + "golden_db": "schema-t-015-product-type-columns-golden", + "golden_out": "id | home | work | pos ----+----------------------------------+-----------------------------------+---------------- 1 | (street = \"1 Main\", zip = 11111) | (street = \"2 Broad\", zip = 22222) | (x = 7, y = 9)", + "llm_db": "schema-t-015-product-type-columns-gpt-5-llm", + "llm_out": "id | home | work | pos ----+----------------------------------+-----------------------------------+---------------- 1 | (street = \"1 Main\", zip = 11111) | (street = \"2 Broad\", zip = 22222) | (x = 7, y = 9)", + "query": "SELECT id, home, work, pos FROM profile WHERE id=1", + "reducer": "seed", + "server": "http://127.0.0.1:44233" + } } }, "vendor": "openai", - "started_at": "2026-01-27T19:49:28.666090278Z", - "finished_at": "2026-01-27T19:50:19.565536981Z" + "started_at": "2026-01-26T19:26:39.089258499Z", + "finished_at": "2026-01-26T19:27:08.469138831Z" }, "t_016_sum_type_columns": { - "hash": "2a0f4ec42cac03fb3da542793b311e4b399845c688bb0660a6c231c82e96c56a", + "hash": "da32ac1e4a22e29f27c1c75b3ce526f5ba909c184b9057d83384313a5e7b881a", "task": "t_016_sum_type_columns", "lang": "rust", "golden_published": true, "model_name": "GPT-5", "total_tests": 3, "passed_tests": 1, - "llm_output": "use spacetimedb::{table, reducer, ReducerContext, Table, SpacetimeType};\n\n#[derive(SpacetimeType)]\npub struct Rect {\n width: i32,\n height: i32,\n}\n\n#[derive(SpacetimeType)]\npub enum Shape {\n Circle(i32),\n Rectangle(Rect),\n}\n\n#[table(name = drawing)]\npub struct Drawing {\n #[primary_key]\n id: i32,\n a: Shape,\n b: Shape,\n}\n\n#[reducer]\npub fn seed(ctx: &ReducerContext) {\n if ctx.db.drawing().id().find(1i32).is_none() {\n ctx.db.drawing().insert(Drawing {\n id: 1,\n a: Shape::Circle(10),\n b: Shape::Rectangle(Rect { width: 4, height: 6 }),\n });\n }\n}", + "llm_output": "use spacetimedb::{table, reducer, ReducerContext, Table, SpacetimeType};\n\n#[derive(SpacetimeType)]\npub struct Rect {\n width: i32,\n height: i32,\n}\n\n#[derive(SpacetimeType)]\npub enum Shape {\n Circle(i32),\n Rectangle(Rect),\n}\n\n#[table(name = drawing)]\npub struct Drawing {\n #[primary_key]\n id: i32,\n a: Shape,\n b: Shape,\n}\n\n#[reducer]\npub fn seed(ctx: &ReducerContext) {\n let drawings = ctx.db.drawing();\n for row in drawings.iter() {\n drawings.id().delete(&row.id);\n }\n drawings.insert(Drawing {\n id: 1,\n a: Shape::Circle(10),\n b: Shape::Rectangle(Rect { width: 4, height: 6 }),\n });\n}", "category": "schema", "route_api_model": "gpt-5", "golden_db": "schema-t-016-sum-type-columns-golden", @@ -820,11 +862,19 @@ "work_dir_golden": "target/llm-runs/schema/t_016_sum_type_columns/rust/server/golden", "work_dir_llm": "target/llm-runs/schema/t_016_sum_type_columns/rust/server/gpt-5/llm", "scorer_details": { + "sum_type_columns_row_count": { + "pass": false, + "partial": 0.0, + "notes": { + "error": "spacetime sql failed:\nWARNING: This command is UNSTABLE and subject to breaking changes.\n\nError: no such table: `drawings`. If the table exists, it may be marked private.\n\nCaused by:\n HTTP status client error (400 Bad Request) for url (http://127.0.0.1:44233/v1/database/c20072beef7cc108a057376dd8b6be7e2a74798bdfaea38dde4e2e708af5e427/sql)\n", + "phase": "sql" + } + }, "sum_type_columns_row_parity": { "pass": false, "partial": 0.0, "notes": { - "error": "spacetime sql failed:\nWARNING: This command is UNSTABLE and subject to breaking changes.\n\nError: no such table: `drawings`. If the table exists, it may be marked private.\n\nCaused by:\n HTTP status client error (400 Bad Request) for url (http://127.0.0.1:33615/v1/database/c200881b5220df4b060ef4c2656171f2f8326cecff55db6c3c11d3ebbd2f5cec/sql)\n", + "error": "spacetime sql failed:\nWARNING: This command is UNSTABLE and subject to breaking changes.\n\nError: no such table: `drawings`. If the table exists, it may be marked private.\n\nCaused by:\n HTTP status client error (400 Bad Request) for url (http://127.0.0.1:44233/v1/database/c20076700591ec6cb5396663df5e1f56128de954277e753577b8dd7756ee998c/sql)\n", "phase": "sql_golden" } }, @@ -836,7 +886,7 @@ "llm_db": "schema-t-016-sum-type-columns-gpt-5-llm", "reducers_diff": null, "reducers_equal": true, - "server": "http://127.0.0.1:33615", + "server": "http://127.0.0.1:44233", "tables_diff": null, "tables_equal": true } @@ -845,24 +895,24 @@ "pass": false, "partial": 0.0, "notes": { - "error": "spacetime sql failed:\nWARNING: This command is UNSTABLE and subject to breaking changes.\n\nError: no such table: `drawings`. If the table exists, it may be marked private.\n\nCaused by:\n HTTP status client error (400 Bad Request) for url (http://127.0.0.1:33615/v1/database/c20074c3ee57884fdd34989755bdcfa11644a8f79ecbbdbf8f5182f2be46b5ec/sql)\n", + "error": "spacetime sql failed:\nWARNING: This command is UNSTABLE and subject to breaking changes.\n\nError: no such table: `drawings`. If the table exists, it may be marked private.\n\nCaused by:\n HTTP status client error (400 Bad Request) for url (http://127.0.0.1:41115/v1/database/c2001257ca4ff5c673696324b8a29b10931896a2877a4425230bec1856988aad/sql)\n", "phase": "sql" } } }, "vendor": "openai", - "started_at": "2026-01-27T19:49:28.665270093Z", - "finished_at": "2026-01-27T19:50:17.767945290Z" + "started_at": "2026-01-26T19:26:39.088020973Z", + "finished_at": "2026-01-26T19:27:22.864464632Z" }, "t_017_scheduled_columns": { - "hash": "2a0f4ec42cac03fb3da542793b311e4b399845c688bb0660a6c231c82e96c56a", + "hash": "da32ac1e4a22e29f27c1c75b3ce526f5ba909c184b9057d83384313a5e7b881a", "task": "t_017_scheduled_columns", "lang": "rust", "golden_published": false, "model_name": "GPT-5", "total_tests": 2, "passed_tests": 0, - "llm_output": "use spacetimedb::{table, reducer, ReducerContext, Table, ScheduleAt};\n\n#[table(name = tick_timer, schedule(reducer = tick, column = scheduled_at))]\npub struct TickTimer {\n #[primary_key]\n #[auto_inc]\n scheduled_id: u64,\n scheduled_at: ScheduleAt,\n}\n\n#[reducer(init)]\npub fn init(ctx: &ReducerContext) {\n if ctx.db.tick_timer().count() == 0 {\n ctx.db.tick_timer().insert(TickTimer {\n scheduled_id: 0,\n scheduled_at: ScheduleAt::RepeatMicros(50_000),\n });\n }\n}\n\n#[reducer]\npub fn tick(_ctx: &ReducerContext, _row: TickTimer) {\n}", + "llm_output": "use spacetimedb::{table, reducer, ReducerContext, Table, ScheduleAt};\n\n#[table(name = tick_timer, scheduled(reducer = tick, column = scheduled_at))]\npub struct TickTimer {\n #[primary_key]\n #[auto_inc]\n scheduled_id: u64,\n scheduled_at: ScheduleAt,\n}\n\n#[reducer(init)]\npub fn init(ctx: &ReducerContext) {\n ctx.db.tick_timer().insert(TickTimer {\n scheduled_id: 0,\n scheduled_at: ScheduleAt::repeat_micros(50_000),\n });\n}\n\n#[reducer]\npub fn tick(_ctx: &ReducerContext, _row: TickTimer) {\n}", "category": "schema", "route_api_model": "gpt-5", "golden_db": "schema-t-017-scheduled-columns-golden", @@ -874,24 +924,24 @@ "pass": false, "partial": 0.0, "notes": { - "error": "spacetime publish failed (exit=1)\n--- stderr ---\n Updating crates.io index\n Locking 72 packages to latest compatible versions\n Adding generic-array v0.14.7 (available: v0.14.9)\n Adding spacetimedb v1.11.1 (available: v1.11.3)\n Adding spacetimedb-bindings-macro v1.11.1 (available: v1.11.3)\n Adding spacetimedb-bindings-sys v1.11.1 (available: v1.11.3)\n Adding spacetimedb-lib v1.11.1 (available: v1.11.3)\n Adding spacetimedb-primitives v1.11.1 (available: v1.11.3)\n Adding spacetimedb-sats v1.11.1 (available: v1.11.3)\n Compiling proc-macro2 v1.0.106\n Compiling unicode-ident v1.0.22\n Compiling quote v1.0.44\n Compiling typenum v1.19.0\n Compiling version_check v0.9.5\n Compiling autocfg v1.5.0\n Compiling heck v0.5.0\n Compiling serde_core v1.0.228\n Compiling cfg-if v1.0.4\n Compiling either v1.15.0\n Compiling serde v1.0.228\n Compiling find-msvc-tools v0.1.8\n Compiling shlex v1.3.0\n Compiling zerocopy v0.8.34\n Compiling nohash-hasher v0.2.0\n Compiling anyhow v1.0.100\n Compiling thiserror v1.0.69\n Compiling bitflags v2.10.0\n Compiling keccak v0.1.5\n Compiling convert_case v0.4.0\n Compiling zmij v1.0.17\n Compiling arrayvec v0.7.6\n Compiling humantime v2.3.0\n Compiling bytes v1.11.0\n Compiling heck v0.4.1\n Compiling second-stack v0.3.5\n Compiling hex v0.4.3\n Compiling serde_json v1.0.149\n Compiling constant_time_eq v0.4.2\n Compiling itoa v1.0.17\n Compiling arrayref v0.3.9\n Compiling getrandom v0.2.17\n Compiling spacetimedb-lib v1.11.1\n Compiling bytemuck v1.24.0\n Compiling smallvec v1.15.1\n Compiling rand_core v0.6.4\n Compiling cc v1.2.54\n Compiling log v0.4.29\n Compiling memchr v2.7.6\n Compiling scoped-tls v1.0.1\n Compiling generic-array v0.14.7\n Compiling itertools v0.12.1\n Compiling num-traits v0.2.19\n Compiling http v1.4.0\n Compiling syn v2.0.114\n Compiling approx v0.3.2\n Compiling chrono v0.4.43\n Compiling decorum v0.3.1\n Compiling blake3 v1.8.3\n Compiling crypto-common v0.1.7\n Compiling block-buffer v0.10.4\n Compiling digest v0.10.7\n Compiling sha3 v0.10.8\n Compiling ethnum v1.5.2\n Compiling ppv-lite86 v0.2.21\n Compiling rand_chacha v0.3.1\n Compiling rand v0.8.5\n Compiling enum-as-inner v0.6.1\n Compiling thiserror-impl v1.0.69\n Compiling derive_more v0.99.20\n Compiling spacetimedb-primitives v1.11.1\n Compiling spacetimedb-bindings-macro v1.11.1\n Compiling spacetimedb-bindings-sys v1.11.1\n Compiling spacetimedb-sats v1.11.1\n Compiling spacetimedb v1.11.1\n Compiling spacetime-module v0.1.0 (/__w/SpacetimeDB/SpacetimeDB/target/llm-runs/schema/t_017_scheduled_columns/rust/server/gpt-5/llm)\nerror: expected one of: `public`, `private`, `name`, `index`, `scheduled`\n --> src/lib.rs:4:28\n |\n4 | #[table(name = tick_timer, schedule(reducer = tick, column = scheduled_at))]\n | ^^^^^^^^\n\nerror[E0422]: cannot find struct, variant or union type `TickTimer` in this scope\n --> src/lib.rs:15:36\n |\n15 | ctx.db.tick_timer().insert(TickTimer {\n | ^^^^^^^^^ not found in this scope\n\nerror[E0412]: cannot find type `TickTimer` in this scope\n --> src/lib.rs:23:42\n |\n23 | pub fn tick(_ctx: &ReducerContext, _row: TickTimer) {\n | ^^^^^^^^^ not found in this scope\n\nerror[E0599]: no method named `tick_timer` found for struct `Local` in the current scope\n --> src/lib.rs:14:15\n |\n14 | if ctx.db.tick_timer().count() == 0 {\n | ^^^^^^^^^^ method not found in `Local`\n\nerror[E0599]: no method named `tick_timer` found for struct `Local` in the current scope\n --> src/lib.rs:15:16\n |\n15 | ctx.db.tick_timer().insert(TickTimer {\n | ^^^^^^^^^^ method not found in `Local`\n\nerror[E0599]: no variant or associated item named `RepeatMicros` found for enum `ScheduleAt` in the current scope\n --> src/lib.rs:17:39\n |\n17 | scheduled_at: ScheduleAt::RepeatMicros(50_000),\n | ^^^^^^^^^^^^ variant or associated item not found in `ScheduleAt`\n\nerror[E0277]: invalid reducer signature\n --> src/lib.rs:23:8\n |\n 22 | #[reducer]\n | ---------- required by a bound introduced by this call\n 23 | pub fn tick(_ctx: &ReducerContext, _row: TickTimer) {\n | ^^^^ this reducer signature is not valid\n |\n = help: the trait `Reducer<'_, _>` is not implemented for fn item `for<'a> fn(&'a ReducerContext, {type error}) {tick}`\n = note: \n = note: reducer signatures must match the following pattern:\n = note: `Fn(&ReducerContext, [T1, ...]) [-> Result<(), impl Display>]`\n = note: where each `Ti` type implements `SpacetimeType`.\n = note: \nnote: required by a bound in `register_reducer`\n --> /root/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/spacetimedb-1.11.1/src/rt.rs:746:81\n |\n746 | pub fn register_reducer<'a, A: Args<'a>, I: FnInfo>(_: impl Reducer<'a, A>) {\n | ^^^^^^^^^^^^^^ required by this bound in `register_reducer`\n\nerror[E0277]: invalid reducer signature\n --> src/lib.rs:23:8\n |\n22 | #[reducer]\n | ---------- required by a bound introduced by this call\n23 | pub fn tick(_ctx: &ReducerContext, _row: TickTimer) {\n | ^^^^ this reducer signature is not valid\n |\n = help: the trait `Reducer<'_, _>` is not implemented for fn item `for<'a> fn(&'a ReducerContext, {type error}) {tick}`\n = note: \n = note: reducer signatures must match the following pattern:\n = note: `Fn(&ReducerContext, [T1, ...]) [-> Result<(), impl Display>]`\n = note: where each `Ti` type implements `SpacetimeType`.\n = note: \nnote: required by a bound in `invoke_reducer`\n --> /root/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/spacetimedb-1.11.1/src/rt.rs:45:19\n |\n44 | pub fn invoke_reducer<'a, A: Args<'a>>(\n | -------------- required by a bound in this function\n45 | reducer: impl Reducer<'a, A>,\n | ^^^^^^^^^^^^^^ required by this bound in `invoke_reducer`\n\nSome errors have detailed explanations: E0277, E0412, E0422, E0599.\nFor more information about an error, try `rustc --explain E0277`.\nerror: could not compile `spacetime-module` (lib) due to 8 previous errors\nError: command [\"cargo\", \"build\", \"--config=net.git-fetch-with-cli=true\", \"--target=wasm32-unknown-unknown\", \"--release\", \"--message-format=json-render-diagnostics\"] exited with code 101\n\n--- stdout ---\n", + "error": "spacetime publish failed (exit=1)\n--- stderr ---\n Updating crates.io index\n Blocking waiting for file lock on package cache\n Locking 72 packages to latest compatible versions\n Adding generic-array v0.14.7 (available: v0.14.9)\n Adding spacetimedb v1.11.1 (available: v1.11.3)\n Adding spacetimedb-bindings-macro v1.11.1 (available: v1.11.3)\n Adding spacetimedb-bindings-sys v1.11.1 (available: v1.11.3)\n Adding spacetimedb-lib v1.11.1 (available: v1.11.3)\n Adding spacetimedb-primitives v1.11.1 (available: v1.11.3)\n Adding spacetimedb-sats v1.11.1 (available: v1.11.3)\n Blocking waiting for file lock on package cache\n Blocking waiting for file lock on package cache\n Compiling proc-macro2 v1.0.106\n Compiling unicode-ident v1.0.22\n Compiling quote v1.0.44\n Compiling version_check v0.9.5\n Compiling typenum v1.19.0\n Compiling autocfg v1.5.0\n Compiling heck v0.5.0\n Compiling serde_core v1.0.228\n Compiling cfg-if v1.0.4\n Compiling find-msvc-tools v0.1.8\n Compiling serde v1.0.228\n Compiling either v1.15.0\n Compiling zerocopy v0.8.34\n Compiling shlex v1.3.0\n Compiling anyhow v1.0.100\n Compiling bitflags v2.10.0\n Compiling thiserror v1.0.69\n Compiling nohash-hasher v0.2.0\n Compiling heck v0.4.1\n Compiling arrayvec v0.7.6\n Compiling zmij v1.0.17\n Compiling convert_case v0.4.0\n Compiling keccak v0.1.5\n Compiling humantime v2.3.0\n Compiling bytes v1.11.0\n Compiling itoa v1.0.17\n Compiling arrayref v0.3.9\n Compiling second-stack v0.3.5\n Compiling smallvec v1.15.1\n Compiling getrandom v0.2.17\n Compiling constant_time_eq v0.4.2\n Compiling cc v1.2.54\n Compiling itertools v0.12.1\n Compiling serde_json v1.0.149\n Compiling hex v0.4.3\n Compiling spacetimedb-lib v1.11.1\n Compiling bytemuck v1.24.0\n Compiling memchr v2.7.6\n Compiling generic-array v0.14.7\n Compiling log v0.4.29\n Compiling scoped-tls v1.0.1\n Compiling rand_core v0.6.4\n Compiling num-traits v0.2.19\n Compiling http v1.4.0\n Compiling syn v2.0.114\n Compiling blake3 v1.8.3\n Compiling approx v0.3.2\n Compiling chrono v0.4.43\n Compiling crypto-common v0.1.7\n Compiling block-buffer v0.10.4\n Compiling decorum v0.3.1\n Compiling digest v0.10.7\n Compiling sha3 v0.10.8\n Compiling ppv-lite86 v0.2.21\n Compiling ethnum v1.5.2\n Compiling rand_chacha v0.3.1\n Compiling rand v0.8.5\n Compiling enum-as-inner v0.6.1\n Compiling thiserror-impl v1.0.69\n Compiling derive_more v0.99.20\n Compiling spacetimedb-primitives v1.11.1\n Compiling spacetimedb-bindings-sys v1.11.1\n Compiling spacetimedb-bindings-macro v1.11.1\n Compiling spacetimedb-sats v1.11.1\n Compiling spacetimedb v1.11.1\n Compiling spacetime-module v0.1.0 (/__w/SpacetimeDB/SpacetimeDB/target/llm-runs/schema/t_017_scheduled_columns/rust/server/gpt-5/llm)\nerror: expected `at`\n --> src/lib.rs:4:38\n |\n4 | #[table(name = tick_timer, scheduled(reducer = tick, column = scheduled_at))]\n | ^^^^^^^\n\nerror[E0422]: cannot find struct, variant or union type `TickTimer` in this scope\n --> src/lib.rs:14:32\n |\n14 | ctx.db.tick_timer().insert(TickTimer {\n | ^^^^^^^^^ not found in this scope\n\nerror[E0412]: cannot find type `TickTimer` in this scope\n --> src/lib.rs:21:42\n |\n21 | pub fn tick(_ctx: &ReducerContext, _row: TickTimer) {\n | ^^^^^^^^^ not found in this scope\n\nerror[E0599]: no method named `tick_timer` found for struct `Local` in the current scope\n --> src/lib.rs:14:12\n |\n14 | ctx.db.tick_timer().insert(TickTimer {\n | ^^^^^^^^^^ method not found in `Local`\n\nerror[E0599]: no variant or associated item named `repeat_micros` found for enum `ScheduleAt` in the current scope\n --> src/lib.rs:16:35\n |\n16 | scheduled_at: ScheduleAt::repeat_micros(50_000),\n | ^^^^^^^^^^^^^ variant or associated item not found in `ScheduleAt`\n\nerror[E0277]: invalid reducer signature\n --> src/lib.rs:21:8\n |\n 20 | #[reducer]\n | ---------- required by a bound introduced by this call\n 21 | pub fn tick(_ctx: &ReducerContext, _row: TickTimer) {\n | ^^^^ this reducer signature is not valid\n |\n = help: the trait `Reducer<'_, _>` is not implemented for fn item `for<'a> fn(&'a ReducerContext, {type error}) {tick}`\n = note: \n = note: reducer signatures must match the following pattern:\n = note: `Fn(&ReducerContext, [T1, ...]) [-> Result<(), impl Display>]`\n = note: where each `Ti` type implements `SpacetimeType`.\n = note: \nnote: required by a bound in `register_reducer`\n --> /root/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/spacetimedb-1.11.1/src/rt.rs:746:81\n |\n746 | pub fn register_reducer<'a, A: Args<'a>, I: FnInfo>(_: impl Reducer<'a, A>) {\n | ^^^^^^^^^^^^^^ required by this bound in `register_reducer`\n\nerror[E0277]: invalid reducer signature\n --> src/lib.rs:21:8\n |\n20 | #[reducer]\n | ---------- required by a bound introduced by this call\n21 | pub fn tick(_ctx: &ReducerContext, _row: TickTimer) {\n | ^^^^ this reducer signature is not valid\n |\n = help: the trait `Reducer<'_, _>` is not implemented for fn item `for<'a> fn(&'a ReducerContext, {type error}) {tick}`\n = note: \n = note: reducer signatures must match the following pattern:\n = note: `Fn(&ReducerContext, [T1, ...]) [-> Result<(), impl Display>]`\n = note: where each `Ti` type implements `SpacetimeType`.\n = note: \nnote: required by a bound in `invoke_reducer`\n --> /root/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/spacetimedb-1.11.1/src/rt.rs:45:19\n |\n44 | pub fn invoke_reducer<'a, A: Args<'a>>(\n | -------------- required by a bound in this function\n45 | reducer: impl Reducer<'a, A>,\n | ^^^^^^^^^^^^^^ required by this bound in `invoke_reducer`\n\nSome errors have detailed explanations: E0277, E0412, E0422, E0599.\nFor more information about an error, try `rustc --explain E0277`.\nerror: could not compile `spacetime-module` (lib) due to 7 previous errors\nError: command [\"cargo\", \"build\", \"--config=net.git-fetch-with-cli=true\", \"--target=wasm32-unknown-unknown\", \"--release\", \"--message-format=json-render-diagnostics\"] exited with code 101\n\n--- stdout ---\n", "phase": "build_or_publish" } } }, "vendor": "openai", - "started_at": "2026-01-27T19:49:28.664841535Z", - "finished_at": "2026-01-27T19:50:33.923572352Z" + "started_at": "2026-01-26T19:26:39.087192758Z", + "finished_at": "2026-01-26T19:27:53.381568310Z" }, "t_018_constraints": { - "hash": "2a0f4ec42cac03fb3da542793b311e4b399845c688bb0660a6c231c82e96c56a", + "hash": "da32ac1e4a22e29f27c1c75b3ce526f5ba909c184b9057d83384313a5e7b881a", "task": "t_018_constraints", "lang": "rust", "golden_published": true, "model_name": "GPT-5", "total_tests": 3, "passed_tests": 2, - "llm_output": "use spacetimedb::{ReducerContext, Table};\n\n#[spacetimedb::table(name = account, index(name = by_name, btree(columns = [name])))]\npub struct Account {\n #[primary_key]\n id: i32,\n #[unique]\n email: String,\n name: String,\n}\n\n#[spacetimedb::reducer]\npub fn seed(ctx: &ReducerContext) {\n let accounts = ctx.db.account();\n let _ = accounts.try_insert(Account { id: 1, email: \"a@example.com\".to_string(), name: \"Alice\".to_string() });\n let _ = accounts.try_insert(Account { id: 2, email: \"b@example.com\".to_string(), name: \"Bob\".to_string() });\n}", + "llm_output": "use spacetimedb::{table, reducer, ReducerContext, Table};\n\n#[table(name = account, index(name = by_name, btree(columns = [name])))]\npub struct Account {\n #[primary_key]\n id: i32,\n #[unique]\n email: String,\n name: String,\n}\n\n#[reducer]\npub fn seed(ctx: &ReducerContext) {\n let t = ctx.db.account();\n t.insert(Account { id: 1, email: \"a@example.com\".to_string(), name: \"Alice\".to_string() });\n t.insert(Account { id: 2, email: \"b@example.com\".to_string(), name: \"Bob\".to_string() });\n}", "category": "schema", "route_api_model": "gpt-5", "golden_db": "schema-t-018-constraints-golden", @@ -899,17 +949,12 @@ "work_dir_golden": "target/llm-runs/schema/t_018_constraints/rust/server/golden", "work_dir_llm": "target/llm-runs/schema/t_018_constraints/rust/server/gpt-5/llm", "scorer_details": { - "schema_parity": { - "pass": true, - "partial": 1.0, + "constraints_row_parity_after_seed": { + "pass": false, + "partial": 0.0, "notes": { - "golden_db": "schema-t-018-constraints-golden", - "llm_db": "schema-t-018-constraints-gpt-5-llm", - "reducers_diff": null, - "reducers_equal": true, - "server": "http://127.0.0.1:33615", - "tables_diff": null, - "tables_equal": true + "error": "spacetime sql failed:\nWARNING: This command is UNSTABLE and subject to breaking changes.\n\nError: no such table: `account`. If the table exists, it may be marked private.\n\nCaused by:\n HTTP status client error (400 Bad Request) for url (http://127.0.0.1:44233/v1/database/c200ce532d202b333f35de1400d0f2b40c51bd06fe40198129dd9b2a5b0d196e/sql)\n", + "phase": "sql_golden" } }, "constraints_seed_two_rows": { @@ -925,24 +970,43 @@ "pass": false, "partial": 0.0, "notes": { - "error": "spacetime sql failed:\nWARNING: This command is UNSTABLE and subject to breaking changes.\n\nError: no such table: `account`. If the table exists, it may be marked private.\n\nCaused by:\n HTTP status client error (400 Bad Request) for url (http://127.0.0.1:33615/v1/database/c2002f3e10afac17bd0350f8d8feb90d1ae94d73c7c44c6824e7324679a8e5b9/sql)\n", - "phase": "sql_golden" + "args": [], + "golden_db": "schema-t-018-constraints-golden", + "golden_out": "id | email | name ----+-----------------+--------- 1 | \"a@example.com\" | \"Alice\"", + "llm_db": "schema-t-018-constraints-gpt-5-llm", + "llm_out": "id | email | name ----+-----------------+--------- 1 | \"a@example.com\" | \"Alice\"", + "query": "SELECT id, email, name FROM account WHERE id=1", + "reducer": "seed", + "server": "http://127.0.0.1:41115" + } + }, + "schema_parity": { + "pass": true, + "partial": 1.0, + "notes": { + "golden_db": "schema-t-018-constraints-golden", + "llm_db": "schema-t-018-constraints-gpt-5-llm", + "reducers_diff": null, + "reducers_equal": true, + "server": "http://127.0.0.1:44233", + "tables_diff": null, + "tables_equal": true } } }, "vendor": "openai", - "started_at": "2026-01-27T19:49:28.664543506Z", - "finished_at": "2026-01-27T19:50:17.029704757Z" + "started_at": "2026-01-26T19:26:39.086684099Z", + "finished_at": "2026-01-26T19:27:19.861734913Z" }, "t_019_many_to_many": { - "hash": "2a0f4ec42cac03fb3da542793b311e4b399845c688bb0660a6c231c82e96c56a", + "hash": "da32ac1e4a22e29f27c1c75b3ce526f5ba909c184b9057d83384313a5e7b881a", "task": "t_019_many_to_many", "lang": "rust", "golden_published": true, "model_name": "GPT-5", "total_tests": 5, "passed_tests": 5, - "llm_output": "use spacetimedb::{ReducerContext, Table};\n\n#[spacetimedb::table(name = user)]\npub struct User {\n #[primary_key]\n user_id: i32,\n name: String,\n}\n\n#[spacetimedb::table(name = group)]\npub struct Group {\n #[primary_key]\n group_id: i32,\n title: String,\n}\n\n#[spacetimedb::table(\n name = membership,\n index(name = by_user, btree(columns = [user_id])),\n index(name = by_group, btree(columns = [group_id]))\n)]\npub struct Membership {\n #[primary_key]\n id: i32,\n user_id: i32,\n group_id: i32,\n}\n\n#[spacetimedb::reducer]\npub fn seed(ctx: &ReducerContext) {\n // Clear existing rows to ensure the database contains exactly the specified rows.\n let membership_ids: Vec = ctx.db.membership().iter().map(|m| m.id).collect();\n for id in membership_ids {\n ctx.db.membership().id().delete(&id);\n }\n\n let user_ids: Vec = ctx.db.user().iter().map(|u| u.user_id).collect();\n for id in user_ids {\n ctx.db.user().user_id().delete(&id);\n }\n\n let group_ids: Vec = ctx.db.group().iter().map(|g| g.group_id).collect();\n for id in group_ids {\n ctx.db.group().group_id().delete(&id);\n }\n\n // Insert users\n ctx.db.user().insert(User { user_id: 1, name: \"Alice\".to_string() });\n ctx.db.user().insert(User { user_id: 2, name: \"Bob\".to_string() });\n\n // Insert groups\n ctx.db.group().insert(Group { group_id: 10, title: \"Admin\".to_string() });\n ctx.db.group().insert(Group { group_id: 20, title: \"Dev\".to_string() });\n\n // Insert memberships\n ctx.db.membership().insert(Membership { id: 1, user_id: 1, group_id: 10 });\n ctx.db.membership().insert(Membership { id: 2, user_id: 1, group_id: 20 });\n ctx.db.membership().insert(Membership { id: 3, user_id: 2, group_id: 20 });\n}", + "llm_output": "use spacetimedb::{table, reducer, ReducerContext, Table};\n\n#[table(name = user)]\npub struct User {\n #[primary_key]\n user_id: i32,\n name: String,\n}\n\n#[table(name = group)]\npub struct Group {\n #[primary_key]\n group_id: i32,\n title: String,\n}\n\n#[table(\n name = membership,\n index(name = by_user, btree(columns = [user_id])),\n index(name = by_group, btree(columns = [group_id]))\n)]\npub struct Membership {\n #[primary_key]\n id: i32,\n user_id: i32,\n group_id: i32,\n}\n\n#[reducer]\npub fn seed(ctx: &ReducerContext) {\n {\n let tbl = ctx.db.membership();\n let ids: Vec = tbl.iter().map(|r| r.id).collect();\n for id in ids {\n tbl.id().delete(&id);\n }\n }\n {\n let tbl = ctx.db.user();\n let ids: Vec = tbl.iter().map(|r| r.user_id).collect();\n for id in ids {\n tbl.user_id().delete(&id);\n }\n }\n {\n let tbl = ctx.db.group();\n let ids: Vec = tbl.iter().map(|r| r.group_id).collect();\n for id in ids {\n tbl.group_id().delete(&id);\n }\n }\n\n ctx.db.user().insert(User { user_id: 1, name: \"Alice\".to_string() });\n ctx.db.user().insert(User { user_id: 2, name: \"Bob\".to_string() });\n\n ctx.db.group().insert(Group { group_id: 10, title: \"Admin\".to_string() });\n ctx.db.group().insert(Group { group_id: 20, title: \"Dev\".to_string() });\n\n ctx.db.membership().insert(Membership { id: 1, user_id: 1, group_id: 10 });\n ctx.db.membership().insert(Membership { id: 2, user_id: 1, group_id: 20 });\n ctx.db.membership().insert(Membership { id: 3, user_id: 2, group_id: 20 });\n}", "category": "schema", "route_api_model": "gpt-5", "golden_db": "schema-t-019-many-to-many-golden", @@ -950,26 +1014,13 @@ "work_dir_golden": "target/llm-runs/schema/t_019_many_to_many/rust/server/golden", "work_dir_llm": "target/llm-runs/schema/t_019_many_to_many/rust/server/gpt-5/llm", "scorer_details": { - "m2m_has_2_20": { + "m2m_has_1_10": { "pass": true, "partial": 1.0, "notes": { "actual": 1, "expected": 1, - "sql": "SELECT COUNT(*) AS n FROM membership WHERE user_id=2 AND group_id=20" - } - }, - "schema_parity": { - "pass": true, - "partial": 1.0, - "notes": { - "golden_db": "schema-t-019-many-to-many-golden", - "llm_db": "schema-t-019-many-to-many-gpt-5-llm", - "reducers_diff": null, - "reducers_equal": true, - "server": "http://127.0.0.1:33615", - "tables_diff": null, - "tables_equal": true + "sql": "SELECT COUNT(*) AS n FROM membership WHERE user_id=1 AND group_id=20" } }, "m2m_has_1_20": { @@ -981,38 +1032,51 @@ "sql": "SELECT COUNT(*) AS n FROM membership WHERE user_id=1 AND group_id=20" } }, - "m2m_has_1_10": { + "memberships_three_rows": { "pass": true, "partial": 1.0, "notes": { - "actual": 1, + "actual": 3, + "expected": 3, + "sql": "SELECT COUNT(*) AS n FROM membership" + } + }, + "m2m_has_2_20": { + "pass": true, + "partial": 1.0, + "notes": { + "actual": 1, "expected": 1, - "sql": "SELECT COUNT(*) AS n FROM membership WHERE user_id=1 AND group_id=10" + "sql": "SELECT COUNT(*) AS n FROM membership WHERE user_id=2 AND group_id=20" } }, - "memberships_three_rows": { + "schema_parity": { "pass": true, "partial": 1.0, "notes": { - "actual": 3, - "expected": 3, - "sql": "SELECT COUNT(*) AS n FROM membership" + "golden_db": "schema-t-019-many-to-many-golden", + "llm_db": "schema-t-019-many-to-many-gpt-5-llm", + "reducers_diff": null, + "reducers_equal": true, + "server": "http://127.0.0.1:44233", + "tables_diff": null, + "tables_equal": true } } }, "vendor": "openai", - "started_at": "2026-01-27T19:49:28.665682949Z", - "finished_at": "2026-01-27T19:50:22.268882588Z" + "started_at": "2026-01-26T19:26:39.088752482Z", + "finished_at": "2026-01-26T19:27:50.273815091Z" }, "t_020_ecs": { - "hash": "2a0f4ec42cac03fb3da542793b311e4b399845c688bb0660a6c231c82e96c56a", + "hash": "da32ac1e4a22e29f27c1c75b3ce526f5ba909c184b9057d83384313a5e7b881a", "task": "t_020_ecs", "lang": "rust", "golden_published": true, "model_name": "GPT-5", "total_tests": 5, "passed_tests": 1, - "llm_output": "use spacetimedb::{table, reducer, ReducerContext, Table};\n\n#[table(name = entity)]\npub struct Entity {\n #[primary_key]\n id: i32,\n}\n\n#[table(name = position)]\npub struct Position {\n #[primary_key]\n entity_id: i32,\n x: i32,\n y: i32,\n}\n\n#[table(name = velocity)]\npub struct Velocity {\n #[primary_key]\n entity_id: i32,\n vx: i32,\n vy: i32,\n}\n\n#[table(name = next_position)]\npub struct NextPosition {\n #[primary_key]\n entity_id: i32,\n x: i32,\n y: i32,\n}\n\n#[reducer]\npub fn seed(ctx: &ReducerContext) {\n let _ = ctx.db.entity().try_insert(Entity { id: 1 });\n let _ = ctx.db.entity().try_insert(Entity { id: 2 });\n\n let _ = ctx.db.position().try_insert(Position { entity_id: 1, x: 0, y: 0 });\n let _ = ctx.db.velocity().try_insert(Velocity { entity_id: 1, vx: 1, vy: 0 });\n\n let _ = ctx.db.position().try_insert(Position { entity_id: 2, x: 10, y: 0 });\n let _ = ctx.db.velocity().try_insert(Velocity { entity_id: 2, vx: -2, vy: 3 });\n}\n\n#[reducer]\npub fn step(ctx: &ReducerContext) {\n for pos in ctx.db.position().iter() {\n if let Some(vel) = ctx.db.velocity().entity_id().find(pos.entity_id) {\n let nx = pos.x + vel.vx;\n let ny = pos.y + vel.vy;\n\n if let Some(mut existing) = ctx.db.next_position().entity_id().find(pos.entity_id) {\n existing.x = nx;\n existing.y = ny;\n let _ = ctx.db.next_position().entity_id().update(existing);\n } else {\n let _ = ctx.db.next_position().try_insert(NextPosition {\n entity_id: pos.entity_id,\n x: nx,\n y: ny,\n });\n }\n }\n }\n}", + "llm_output": "use spacetimedb::{table, reducer, ReducerContext, Table};\n\n#[table(name = entity)]\npub struct Entity {\n #[primary_key]\n id: i32,\n}\n\n#[table(name = position)]\npub struct Position {\n #[primary_key]\n entity_id: i32,\n x: i32,\n y: i32,\n}\n\n#[table(name = velocity)]\npub struct Velocity {\n #[primary_key]\n entity_id: i32,\n vx: i32,\n vy: i32,\n}\n\n#[table(name = next_position)]\npub struct NextPosition {\n #[primary_key]\n entity_id: i32,\n x: i32,\n y: i32,\n}\n\n#[reducer]\npub fn seed(ctx: &ReducerContext) {\n ctx.db.entity().insert(Entity { id: 1 });\n ctx.db.position().insert(Position { entity_id: 1, x: 0, y: 0 });\n ctx.db.velocity().insert(Velocity { entity_id: 1, vx: 1, vy: 0 });\n\n ctx.db.entity().insert(Entity { id: 2 });\n ctx.db.position().insert(Position { entity_id: 2, x: 10, y: 0 });\n ctx.db.velocity().insert(Velocity { entity_id: 2, vx: -2, vy: 3 });\n}\n\n#[reducer]\npub fn step(ctx: &ReducerContext) {\n for pos in ctx.db.position().iter() {\n if let Some(vel) = ctx.db.velocity().entity_id().find(pos.entity_id) {\n let next = NextPosition {\n entity_id: pos.entity_id,\n x: pos.x + vel.vx,\n y: pos.y + vel.vy,\n };\n\n if ctx.db.next_position().entity_id().find(pos.entity_id).is_some() {\n ctx.db.next_position().entity_id().update(next);\n } else {\n ctx.db.next_position().insert(next);\n }\n }\n }\n}", "category": "schema", "route_api_model": "gpt-5", "golden_db": "schema-t-020-ecs-golden", @@ -1024,7 +1088,7 @@ "pass": false, "partial": 0.0, "notes": { - "error": "spacetime sql failed:\nWARNING: This command is UNSTABLE and subject to breaking changes.\n\nError: no such table: `next_positions`. If the table exists, it may be marked private.\n\nCaused by:\n HTTP status client error (400 Bad Request) for url (http://127.0.0.1:33615/v1/database/c200ef190fe9bac0d026751d082f663c75cb0435d300fdc35e1bc1f038529566/sql)\n", + "error": "spacetime sql failed:\nWARNING: This command is UNSTABLE and subject to breaking changes.\n\nError: no such table: `next_positions`. If the table exists, it may be marked private.\n\nCaused by:\n HTTP status client error (400 Bad Request) for url (http://127.0.0.1:44233/v1/database/c200adf8fd49d0e7e167ec3aa9141c1b249dc335dfa97e666a41345612d7362a/sql)\n", "phase": "sql" } }, @@ -1032,7 +1096,15 @@ "pass": false, "partial": 0.0, "notes": { - "error": "spacetime sql failed:\nWARNING: This command is UNSTABLE and subject to breaking changes.\n\nError: no such table: `next_positions`. If the table exists, it may be marked private.\n\nCaused by:\n HTTP status client error (400 Bad Request) for url (http://127.0.0.1:33615/v1/database/c200ef190fe9bac0d026751d082f663c75cb0435d300fdc35e1bc1f038529566/sql)\n", + "error": "spacetime sql failed:\nWARNING: This command is UNSTABLE and subject to breaking changes.\n\nError: no such table: `next_positions`. If the table exists, it may be marked private.\n\nCaused by:\n HTTP status client error (400 Bad Request) for url (http://127.0.0.1:44233/v1/database/c200adf8fd49d0e7e167ec3aa9141c1b249dc335dfa97e666a41345612d7362a/sql)\n", + "phase": "sql" + } + }, + "ecs_seed_positions_count": { + "pass": false, + "partial": 0.0, + "notes": { + "error": "spacetime sql failed:\nWARNING: This command is UNSTABLE and subject to breaking changes.\n\nError: no such table: `positions`. If the table exists, it may be marked private.\n\nCaused by:\n HTTP status client error (400 Bad Request) for url (http://127.0.0.1:44233/v1/database/c200adf8fd49d0e7e167ec3aa9141c1b249dc335dfa97e666a41345612d7362a/sql)\n", "phase": "sql" } }, @@ -1044,7 +1116,7 @@ "llm_db": "schema-t-020-ecs-gpt-5-llm", "reducers_diff": null, "reducers_equal": true, - "server": "http://127.0.0.1:33615", + "server": "http://127.0.0.1:44233", "tables_diff": null, "tables_equal": true } @@ -1053,32 +1125,24 @@ "pass": false, "partial": 0.0, "notes": { - "error": "spacetime sql failed:\nWARNING: This command is UNSTABLE and subject to breaking changes.\n\nError: no such table: `next_positions`. If the table exists, it may be marked private.\n\nCaused by:\n HTTP status client error (400 Bad Request) for url (http://127.0.0.1:33615/v1/database/c200ef190fe9bac0d026751d082f663c75cb0435d300fdc35e1bc1f038529566/sql)\n", - "phase": "sql" - } - }, - "ecs_seed_positions_count": { - "pass": false, - "partial": 0.0, - "notes": { - "error": "spacetime sql failed:\nWARNING: This command is UNSTABLE and subject to breaking changes.\n\nError: no such table: `positions`. If the table exists, it may be marked private.\n\nCaused by:\n HTTP status client error (400 Bad Request) for url (http://127.0.0.1:33615/v1/database/c200ef190fe9bac0d026751d082f663c75cb0435d300fdc35e1bc1f038529566/sql)\n", + "error": "spacetime sql failed:\nWARNING: This command is UNSTABLE and subject to breaking changes.\n\nError: no such table: `next_positions`. If the table exists, it may be marked private.\n\nCaused by:\n HTTP status client error (400 Bad Request) for url (http://127.0.0.1:44233/v1/database/c200adf8fd49d0e7e167ec3aa9141c1b249dc335dfa97e666a41345612d7362a/sql)\n", "phase": "sql" } } }, "vendor": "openai", - "started_at": "2026-01-27T19:49:28.665885964Z", - "finished_at": "2026-01-27T19:50:18.814108696Z" + "started_at": "2026-01-26T19:26:39.089004480Z", + "finished_at": "2026-01-26T19:27:35.047523671Z" }, "t_021_multi_column_index": { - "hash": "2a0f4ec42cac03fb3da542793b311e4b399845c688bb0660a6c231c82e96c56a", + "hash": "da32ac1e4a22e29f27c1c75b3ce526f5ba909c184b9057d83384313a5e7b881a", "task": "t_021_multi_column_index", "lang": "rust", "golden_published": true, "model_name": "GPT-5", "total_tests": 4, "passed_tests": 4, - "llm_output": "use spacetimedb::{table, reducer, ReducerContext, Table};\n\n#[table(name = log, index(name = by_user_day, btree(columns = [user_id, day])))]\npub struct Log {\n #[primary_key]\n id: i32,\n user_id: i32,\n day: i32,\n message: String,\n}\n\n#[reducer]\npub fn seed(ctx: &ReducerContext) {\n let table = ctx.db.log();\n table.insert(Log { id: 1, user_id: 7, day: 1, message: \"a\".to_string() });\n table.insert(Log { id: 2, user_id: 7, day: 2, message: \"b\".to_string() });\n table.insert(Log { id: 3, user_id: 9, day: 1, message: \"c\".to_string() });\n}", + "llm_output": "use spacetimedb::{ReducerContext, Table};\n\n#[spacetimedb::table(name = log, index(name = by_user_day, btree(columns = [user_id, day])))]\npub struct Log {\n #[primary_key]\n id: i32,\n user_id: i32,\n day: i32,\n message: String,\n}\n\n#[spacetimedb::reducer]\npub fn seed(ctx: &ReducerContext) {\n let ids: Vec = ctx.db.log().iter().map(|r| r.id).collect();\n for id in ids {\n ctx.db.log().id().delete(&id);\n }\n\n ctx.db.log().insert(Log { id: 1, user_id: 7, day: 1, message: \"a\".to_string() });\n ctx.db.log().insert(Log { id: 2, user_id: 7, day: 2, message: \"b\".to_string() });\n ctx.db.log().insert(Log { id: 3, user_id: 9, day: 1, message: \"c\".to_string() });\n}", "category": "schema", "route_api_model": "gpt-5", "golden_db": "schema-t-021-multi-column-index-golden", @@ -1094,7 +1158,7 @@ "llm_db": "schema-t-021-multi-column-index-gpt-5-llm", "reducers_diff": null, "reducers_equal": true, - "server": "http://127.0.0.1:33615", + "server": "http://127.0.0.1:44233", "tables_diff": null, "tables_equal": true } @@ -1108,16 +1172,16 @@ "sql": "SELECT COUNT(*) AS n FROM log" } }, - "mcindex_lookup_u7_d1": { + "mcindex_lookup_u7_d2": { "pass": true, "partial": 1.0, "notes": { "actual": 1, "expected": 1, - "sql": "SELECT COUNT(*) AS n FROM log WHERE user_id=7 AND day=1" + "sql": "SELECT COUNT(*) AS n FROM log WHERE user_id=7 AND day=2" } }, - "mcindex_lookup_u7_d2": { + "mcindex_lookup_u7_d1": { "pass": true, "partial": 1.0, "notes": { @@ -1128,8 +1192,8 @@ } }, "vendor": "openai", - "started_at": "2026-01-27T19:49:28.665048738Z", - "finished_at": "2026-01-27T19:50:12.818516478Z" + "started_at": "2026-01-26T19:26:39.087595992Z", + "finished_at": "2026-01-26T19:27:23.893472645Z" } } } @@ -1137,21 +1201,21 @@ }, { "mode": "docs", - "hash": "d1bf0b033db905c668d016082c762eb4b91edd1299f7b8d4bcc6def5398610f9", + "hash": "a9b7f59b2c00330aa9e00220d45b9d8f7d257f9b10dc9f37b56a1e954c2b5117", "models": [ { "name": "GPT-5", "route_api_model": "gpt-5", "tasks": { "t_000_empty_reducers": { - "hash": "d1bf0b033db905c668d016082c762eb4b91edd1299f7b8d4bcc6def5398610f9", + "hash": "a9b7f59b2c00330aa9e00220d45b9d8f7d257f9b10dc9f37b56a1e954c2b5117", "task": "t_000_empty_reducers", "lang": "rust", "golden_published": true, "model_name": "GPT-5", "total_tests": 1, "passed_tests": 0, - "llm_output": "use spacetimedb::ReducerContext;\n\n#[spacetimedb::reducer]\npub fn empty_reducer_no_args(ctx: &ReducerContext) {}\n\n#[spacetimedb::reducer]\npub fn empty_reducer_with_int(ctx: &ReducerContext, count: i32) {}\n\n#[spacetimedb::reducer]\npub fn empty_reducer_with_string(ctx: &ReducerContext, name: String) {}\n\n#[spacetimedb::reducer]\npub fn empty_reducer_with_two_args(ctx: &ReducerContext, count: i32, name: String) {}\n\n#[spacetimedb::reducer]\npub fn empty_reducer_with_three_args(ctx: &ReducerContext, active: bool, ratio: f32, label: String) {}", + "llm_output": "use spacetimedb::ReducerContext;\n\n#[spacetimedb::reducer]\npub fn empty_reducer_no_args(_ctx: &ReducerContext) {\n}\n\n#[spacetimedb::reducer]\npub fn empty_reducer_with_int(_ctx: &ReducerContext, count: i32) {\n}\n\n#[spacetimedb::reducer]\npub fn empty_reducer_with_string(_ctx: &ReducerContext, name: String) {\n}\n\n#[spacetimedb::reducer]\npub fn empty_reducer_with_two_args(_ctx: &ReducerContext, count: i32, name: String) {\n}\n\n#[spacetimedb::reducer]\npub fn empty_reducer_with_three_args(_ctx: &ReducerContext, active: bool, ratio: f32, label: String) {\n}", "category": "basics", "route_api_model": "gpt-5", "golden_db": "basics-t-000-empty-reducers-golden", @@ -1169,11 +1233,11 @@ } }, "vendor": "openai", - "started_at": "2026-01-27T19:53:02.635478741Z", - "finished_at": "2026-01-27T19:53:40.787269737Z" + "started_at": "2026-01-26T19:30:54.611008723Z", + "finished_at": "2026-01-26T19:31:59.326178772Z" }, "t_001_basic_tables": { - "hash": "d1bf0b033db905c668d016082c762eb4b91edd1299f7b8d4bcc6def5398610f9", + "hash": "a9b7f59b2c00330aa9e00220d45b9d8f7d257f9b10dc9f37b56a1e954c2b5117", "task": "t_001_basic_tables", "lang": "rust", "golden_published": true, @@ -1198,18 +1262,18 @@ } }, "vendor": "openai", - "started_at": "2026-01-27T19:53:04.338845678Z", - "finished_at": "2026-01-27T19:53:39.243226783Z" + "started_at": "2026-01-26T19:31:23.564110648Z", + "finished_at": "2026-01-26T19:32:09.696102989Z" }, "t_002_scheduled_table": { - "hash": "d1bf0b033db905c668d016082c762eb4b91edd1299f7b8d4bcc6def5398610f9", + "hash": "a9b7f59b2c00330aa9e00220d45b9d8f7d257f9b10dc9f37b56a1e954c2b5117", "task": "t_002_scheduled_table", "lang": "rust", "golden_published": true, "model_name": "GPT-5", "total_tests": 1, "passed_tests": 0, - "llm_output": "use spacetimedb::{ReducerContext, ScheduleAt, Table};\n\n#[spacetimedb::table(name = tick_timer, scheduled(tick))]\npub struct TickTimer {\n #[primary_key]\n #[auto_inc]\n scheduled_id: u64,\n scheduled_at: ScheduleAt,\n}\n\n#[spacetimedb::reducer]\npub fn tick(_ctx: &ReducerContext, _timer: TickTimer) -> Result<(), String> {\n Ok(())\n}\n\n#[spacetimedb::reducer(init)]\npub fn init(ctx: &ReducerContext) -> Result<(), String> {\n if ctx.db.tick_timer().count() == 0 {\n use std::time::Duration;\n ctx.db.tick_timer().insert(TickTimer {\n scheduled_id: 0,\n scheduled_at: ScheduleAt::Interval(Duration::from_micros(50_000).into()),\n });\n }\n Ok(())\n}", + "llm_output": "use std::time::Duration;\nuse spacetimedb::{ReducerContext, ScheduleAt, Table};\n\n#[spacetimedb::table(name = tick_timer, scheduled(tick))]\npub struct TickTimer {\n #[primary_key]\n #[auto_inc]\n scheduled_id: u64,\n scheduled_at: ScheduleAt,\n}\n\n#[spacetimedb::reducer]\npub fn tick(_ctx: &ReducerContext, _timer: TickTimer) {}\n\n#[spacetimedb::reducer(init)]\npub fn init(ctx: &ReducerContext) -> Result<(), String> {\n if ctx.db.tick_timer().count() == 0 {\n ctx.db.tick_timer().try_insert(TickTimer {\n scheduled_id: 0,\n scheduled_at: ScheduleAt::Interval(Duration::from_micros(50_000).into()),\n })?;\n }\n Ok(())\n}", "category": "basics", "route_api_model": "gpt-5", "golden_db": "basics-t-002-scheduled-table-golden", @@ -1227,11 +1291,11 @@ } }, "vendor": "openai", - "started_at": "2026-01-27T19:53:38.403872273Z", - "finished_at": "2026-01-27T19:54:31.831288022Z" + "started_at": "2026-01-26T19:32:03.232154280Z", + "finished_at": "2026-01-26T19:32:55.980604615Z" }, "t_003_struct_in_table": { - "hash": "d1bf0b033db905c668d016082c762eb4b91edd1299f7b8d4bcc6def5398610f9", + "hash": "a9b7f59b2c00330aa9e00220d45b9d8f7d257f9b10dc9f37b56a1e954c2b5117", "task": "t_003_struct_in_table", "lang": "rust", "golden_published": true, @@ -1256,11 +1320,11 @@ } }, "vendor": "openai", - "started_at": "2026-01-27T19:53:02.638916802Z", - "finished_at": "2026-01-27T19:53:40.055864699Z" + "started_at": "2026-01-26T19:31:11.581070012Z", + "finished_at": "2026-01-26T19:32:09.839951728Z" }, "t_004_insert": { - "hash": "d1bf0b033db905c668d016082c762eb4b91edd1299f7b8d4bcc6def5398610f9", + "hash": "a9b7f59b2c00330aa9e00220d45b9d8f7d257f9b10dc9f37b56a1e954c2b5117", "task": "t_004_insert", "lang": "rust", "golden_published": true, @@ -1275,29 +1339,29 @@ "work_dir_golden": "target/llm-runs/basics/t_004_insert/rust/server/golden", "work_dir_llm": "target/llm-runs/basics/t_004_insert/rust/server/gpt-5/llm", "scorer_details": { - "schema_parity": { + "data_parity_insert_user": { "pass": false, "partial": 0.0, "notes": { - "error": "describe failed: WARNING: This command is UNSTABLE and subject to breaking changes.\n\nError: failed to find database `basics-t-004-insert-golden`.\n", - "phase": "describe_golden" + "error": "spacetime call failed:\nWARNING: This command is UNSTABLE and subject to breaking changes.\n\nError: failed to find database `basics-t-004-insert-golden`.\n", + "phase": "call_reducer_golden" } }, - "data_parity_insert_user": { + "schema_parity": { "pass": false, "partial": 0.0, "notes": { - "error": "spacetime call failed:\nWARNING: This command is UNSTABLE and subject to breaking changes.\n\nError: failed to find database `basics-t-004-insert-golden`.\n", - "phase": "call_reducer_golden" + "error": "describe failed: WARNING: This command is UNSTABLE and subject to breaking changes.\n\nError: failed to find database `basics-t-004-insert-golden`.\n", + "phase": "describe_golden" } } }, "vendor": "openai", - "started_at": "2026-01-27T19:53:33.748279444Z", - "finished_at": "2026-01-27T19:53:56.014195443Z" + "started_at": "2026-01-26T19:31:53.617759187Z", + "finished_at": "2026-01-26T19:32:28.129265268Z" }, "t_005_update": { - "hash": "d1bf0b033db905c668d016082c762eb4b91edd1299f7b8d4bcc6def5398610f9", + "hash": "a9b7f59b2c00330aa9e00220d45b9d8f7d257f9b10dc9f37b56a1e954c2b5117", "task": "t_005_update", "lang": "rust", "golden_published": true, @@ -1312,12 +1376,13 @@ "work_dir_golden": "target/llm-runs/basics/t_005_update/rust/server/golden", "work_dir_llm": "target/llm-runs/basics/t_005_update/rust/server/gpt-5/llm", "scorer_details": { - "data_parity_update_user": { + "seed_users_row": { "pass": false, "partial": 0.0, "notes": { - "error": "spacetime call failed:\nWARNING: This command is UNSTABLE and subject to breaking changes.\n\nError: failed to find database `basics-t-005-update-golden`.\n", - "phase": "call_reducer_golden" + "error": "spacetime sql failed:\nWARNING: This command is UNSTABLE and subject to breaking changes.\n\nError: failed to find database `basics-t-005-update-golden`.\n", + "phase": "sql_golden", + "sql": "INSERT INTO user(id, name, age, active) VALUES (1, 'Alice', 30, true)" } }, "schema_parity": { @@ -1328,22 +1393,21 @@ "phase": "describe_golden" } }, - "seed_users_row": { + "data_parity_update_user": { "pass": false, "partial": 0.0, "notes": { - "error": "spacetime sql failed:\nWARNING: This command is UNSTABLE and subject to breaking changes.\n\nError: failed to find database `basics-t-005-update-golden`.\n", - "phase": "sql_golden", - "sql": "INSERT INTO user(id, name, age, active) VALUES (1, 'Alice', 30, true)" + "error": "spacetime call failed:\nWARNING: This command is UNSTABLE and subject to breaking changes.\n\nError: failed to find database `basics-t-005-update-golden`.\n", + "phase": "call_reducer_golden" } } }, "vendor": "openai", - "started_at": "2026-01-27T19:53:00.578961998Z", - "finished_at": "2026-01-27T19:53:38.403844461Z" + "started_at": "2026-01-26T19:30:54.604964500Z", + "finished_at": "2026-01-26T19:31:53.617639721Z" }, "t_006_delete": { - "hash": "d1bf0b033db905c668d016082c762eb4b91edd1299f7b8d4bcc6def5398610f9", + "hash": "a9b7f59b2c00330aa9e00220d45b9d8f7d257f9b10dc9f37b56a1e954c2b5117", "task": "t_006_delete", "lang": "rust", "golden_published": true, @@ -1366,15 +1430,6 @@ "phase": "describe_golden" } }, - "seed_users_row": { - "pass": false, - "partial": 0.0, - "notes": { - "error": "spacetime sql failed:\nWARNING: This command is UNSTABLE and subject to breaking changes.\n\nError: failed to find database `basics-t-006-delete-golden`.\n", - "phase": "sql_golden", - "sql": "INSERT INTO user(id, name, age, active) VALUES (1, 'Alice', 30, true)" - } - }, "delete_user_count_zero": { "pass": true, "partial": 1.0, @@ -1383,21 +1438,29 @@ "expected": 0, "sql": "SELECT COUNT(*) AS n FROM user WHERE id=1" } + }, + "schema_parity": { + "pass": false, + "partial": 0.0, + "notes": { + "error": "describe failed: WARNING: This command is UNSTABLE and subject to breaking changes.\n\nError: failed to find database `basics-t-006-delete-golden`.\n", + "phase": "describe_golden" + } } }, "vendor": "openai", - "started_at": "2026-01-27T19:52:31.910165978Z", - "finished_at": "2026-01-27T19:52:58.192517311Z" + "started_at": "2026-01-26T19:30:54.580009457Z", + "finished_at": "2026-01-26T19:32:03.232098066Z" }, "t_007_crud": { - "hash": "d1bf0b033db905c668d016082c762eb4b91edd1299f7b8d4bcc6def5398610f9", + "hash": "a9b7f59b2c00330aa9e00220d45b9d8f7d257f9b10dc9f37b56a1e954c2b5117", "task": "t_007_crud", "lang": "rust", "golden_published": true, "model_name": "GPT-5", "total_tests": 4, "passed_tests": 1, - "llm_output": "use spacetimedb::{ReducerContext, Table};\n\n#[spacetimedb::table(name = user)]\npub struct User {\n #[primary_key]\n id: i32,\n name: String,\n age: i32,\n active: bool,\n}\n\n#[spacetimedb::reducer]\npub fn crud(ctx: &ReducerContext) {\n ctx.db.user().insert(User { id: 1, name: \"Alice\".into(), age: 30, active: true });\n ctx.db.user().insert(User { id: 2, name: \"Bob\".into(), age: 22, active: false });\n ctx.db.user().id().update(User { id: 1, name: \"Alice2\".into(), age: 31, active: false });\n ctx.db.user().id().delete(2);\n}", + "llm_output": "use spacetimedb::{ReducerContext, Table};\n\n#[spacetimedb::table(name = user)]\npub struct User {\n #[primary_key]\n id: i32,\n name: String,\n age: i32,\n active: bool,\n}\n\n#[spacetimedb::reducer]\npub fn crud(ctx: &ReducerContext) {\n ctx.db.user().insert(User { id: 1, name: \"Alice\".to_string(), age: 30, active: true });\n ctx.db.user().insert(User { id: 2, name: \"Bob\".to_string(), age: 22, active: false });\n\n if ctx.db.user().id().find(1).is_some() {\n ctx.db.user().id().update(User { id: 1, name: \"Alice2\".to_string(), age: 31, active: false });\n }\n\n ctx.db.user().id().delete(2);\n}", "category": "basics", "route_api_model": "gpt-5", "golden_db": "basics-t-007-crud-golden", @@ -1405,12 +1468,12 @@ "work_dir_golden": "target/llm-runs/basics/t_007_crud/rust/server/golden", "work_dir_llm": "target/llm-runs/basics/t_007_crud/rust/server/gpt-5/llm", "scorer_details": { - "crud_row_id1_parity": { + "schema_parity": { "pass": false, "partial": 0.0, "notes": { - "error": "spacetime call failed:\nWARNING: This command is UNSTABLE and subject to breaking changes.\n\nError: failed to find database `basics-t-007-crud-golden`.\n", - "phase": "call_reducer_golden" + "error": "describe failed: WARNING: This command is UNSTABLE and subject to breaking changes.\n\nError: failed to find database `basics-t-007-crud-golden`.\n", + "phase": "describe_golden" } }, "crud_total_count_one": { @@ -1422,12 +1485,12 @@ "sql": "SELECT COUNT(*) AS n FROM user" } }, - "schema_parity": { + "crud_row_id1_parity": { "pass": false, "partial": 0.0, "notes": { - "error": "describe failed: WARNING: This command is UNSTABLE and subject to breaking changes.\n\nError: failed to find database `basics-t-007-crud-golden`.\n", - "phase": "describe_golden" + "error": "spacetime call failed:\nWARNING: This command is UNSTABLE and subject to breaking changes.\n\nError: failed to find database `basics-t-007-crud-golden`.\n", + "phase": "call_reducer_golden" } }, "crud_row_id2_deleted": { @@ -1441,18 +1504,18 @@ } }, "vendor": "openai", - "started_at": "2026-01-27T19:52:42.328837521Z", - "finished_at": "2026-01-27T19:53:33.740284067Z" + "started_at": "2026-01-26T19:30:54.591258099Z", + "finished_at": "2026-01-26T19:32:19.735936055Z" }, "t_008_index_lookup": { - "hash": "d1bf0b033db905c668d016082c762eb4b91edd1299f7b8d4bcc6def5398610f9", + "hash": "a9b7f59b2c00330aa9e00220d45b9d8f7d257f9b10dc9f37b56a1e954c2b5117", "task": "t_008_index_lookup", "lang": "rust", "golden_published": true, "model_name": "GPT-5", "total_tests": 3, "passed_tests": 0, - "llm_output": "use spacetimedb::{ReducerContext, Table};\n\n#[spacetimedb::table(name = user)]\npub struct User {\n #[primary_key]\n id: i32,\n name: String,\n age: i32,\n active: bool,\n}\n\n#[spacetimedb::table(name = result)]\npub struct ResultRow {\n #[primary_key]\n id: i32,\n name: String,\n}\n\n#[spacetimedb::reducer]\npub fn lookup_user_name(ctx: &ReducerContext, id: i32) {\n if let Some(user) = ctx.db.user().id().find(id) {\n let row = ResultRow { id: user.id, name: user.name.clone() };\n if ctx.db.result().id().find(user.id).is_some() {\n ctx.db.result().id().update(row);\n } else {\n ctx.db.result().insert(row);\n }\n }\n}", + "llm_output": "use spacetimedb::{ReducerContext, Table};\n\n#[spacetimedb::table(name = user, public)]\npub struct User {\n #[primary_key]\n id: i32,\n name: String,\n age: i32,\n active: bool,\n}\n\n#[spacetimedb::table(name = result, public)]\npub struct ResultRow {\n #[primary_key]\n id: i32,\n name: String,\n}\n\n#[spacetimedb::reducer]\npub fn lookup_user_name(ctx: &ReducerContext, id: i32) {\n if let Some(u) = ctx.db.user().id().find(id) {\n ctx.db.result().id().delete(&id);\n ctx.db.result().insert(ResultRow { id: u.id, name: u.name });\n }\n}", "category": "basics", "route_api_model": "gpt-5", "golden_db": "basics-t-008-index-lookup-golden", @@ -1460,6 +1523,15 @@ "work_dir_golden": "target/llm-runs/basics/t_008_index_lookup/rust/server/golden", "work_dir_llm": "target/llm-runs/basics/t_008_index_lookup/rust/server/gpt-5/llm", "scorer_details": { + "seed_user_row": { + "pass": false, + "partial": 0.0, + "notes": { + "error": "spacetime sql failed:\nWARNING: This command is UNSTABLE and subject to breaking changes.\n\nError: failed to find database `basics-t-008-index-lookup-golden`.\n", + "phase": "sql_golden", + "sql": "INSERT INTO user(id, name, age, active) VALUES (1, 'Alice', 30, true)" + } + }, "schema_parity": { "pass": false, "partial": 0.0, @@ -1475,30 +1547,21 @@ "error": "spacetime call failed:\nWARNING: This command is UNSTABLE and subject to breaking changes.\n\nError: failed to find database `basics-t-008-index-lookup-golden`.\n", "phase": "call_reducer_golden" } - }, - "seed_user_row": { - "pass": false, - "partial": 0.0, - "notes": { - "error": "spacetime sql failed:\nWARNING: This command is UNSTABLE and subject to breaking changes.\n\nError: failed to find database `basics-t-008-index-lookup-golden`.\n", - "phase": "sql_golden", - "sql": "INSERT INTO user(id, name, age, active) VALUES (1, 'Alice', 30, true)" - } } }, "vendor": "openai", - "started_at": "2026-01-27T19:53:17.657026192Z", - "finished_at": "2026-01-27T19:53:54.093778910Z" + "started_at": "2026-01-26T19:31:52.996077836Z", + "finished_at": "2026-01-26T19:32:44.567947473Z" }, "t_009_init": { - "hash": "d1bf0b033db905c668d016082c762eb4b91edd1299f7b8d4bcc6def5398610f9", + "hash": "a9b7f59b2c00330aa9e00220d45b9d8f7d257f9b10dc9f37b56a1e954c2b5117", "task": "t_009_init", "lang": "rust", "golden_published": true, "model_name": "GPT-5", "total_tests": 4, "passed_tests": 3, - "llm_output": "use spacetimedb::{ReducerContext, Table};\n\n#[spacetimedb::table(name = user)]\npub struct User {\n #[primary_key]\n id: i32,\n name: String,\n age: i32,\n active: bool,\n}\n\n#[spacetimedb::reducer(init)]\npub fn init(ctx: &ReducerContext) -> Result<(), String> {\n ctx.db.user().insert(User { id: 1, name: \"Alice\".to_string(), age: 30, active: true });\n ctx.db.user().insert(User { id: 2, name: \"Bob\".to_string(), age: 22, active: false });\n Ok(())\n}", + "llm_output": "use spacetimedb::{ReducerContext, Table};\n\n#[spacetimedb::table(name = user)]\npub struct User {\n #[primary_key]\n id: i32,\n name: String,\n age: i32,\n active: bool,\n}\n\n#[spacetimedb::reducer(init)]\npub fn init(ctx: &ReducerContext) -> Result<(), String> {\n ctx.db.user().insert(User {\n id: 1,\n name: \"Alice\".to_string(),\n age: 30,\n active: true,\n });\n ctx.db.user().insert(User {\n id: 2,\n name: \"Bob\".to_string(),\n age: 22,\n active: false,\n });\n Ok(())\n}", "category": "basics", "route_api_model": "gpt-5", "golden_db": "basics-t-009-init-golden", @@ -1506,13 +1569,13 @@ "work_dir_golden": "target/llm-runs/basics/t_009_init/rust/server/golden", "work_dir_llm": "target/llm-runs/basics/t_009_init/rust/server/gpt-5/llm", "scorer_details": { - "init_seed_bob": { + "init_seed_alice": { "pass": true, "partial": 1.0, "notes": { "actual": 1, "expected": 1, - "sql": "SELECT COUNT(*) AS n FROM user WHERE id=2 AND name='Bob' AND age=22 AND active=false" + "sql": "SELECT COUNT(*) AS n FROM user WHERE id=1 AND name='Alice' AND age=30 AND active=true" } }, "schema_parity": { @@ -1532,22 +1595,22 @@ "sql": "SELECT COUNT(*) AS n FROM user" } }, - "init_seed_alice": { + "init_seed_bob": { "pass": true, "partial": 1.0, "notes": { "actual": 1, "expected": 1, - "sql": "SELECT COUNT(*) AS n FROM user WHERE id=1 AND name='Alice' AND age=30 AND active=true" + "sql": "SELECT COUNT(*) AS n FROM user WHERE id=2 AND name='Bob' AND age=22 AND active=false" } } }, "vendor": "openai", - "started_at": "2026-01-27T19:52:58.192552680Z", - "finished_at": "2026-01-27T19:53:38.342926441Z" + "started_at": "2026-01-26T19:30:54.597845517Z", + "finished_at": "2026-01-26T19:32:17.483969682Z" }, "t_010_connect": { - "hash": "d1bf0b033db905c668d016082c762eb4b91edd1299f7b8d4bcc6def5398610f9", + "hash": "a9b7f59b2c00330aa9e00220d45b9d8f7d257f9b10dc9f37b56a1e954c2b5117", "task": "t_010_connect", "lang": "rust", "golden_published": true, @@ -1572,11 +1635,11 @@ } }, "vendor": "openai", - "started_at": "2026-01-27T19:52:35.522740907Z", - "finished_at": "2026-01-27T19:53:02.635440935Z" + "started_at": "2026-01-26T19:30:54.585220084Z", + "finished_at": "2026-01-26T19:31:52.995965049Z" }, "t_011_helper_function": { - "hash": "d1bf0b033db905c668d016082c762eb4b91edd1299f7b8d4bcc6def5398610f9", + "hash": "a9b7f59b2c00330aa9e00220d45b9d8f7d257f9b10dc9f37b56a1e954c2b5117", "task": "t_011_helper_function", "lang": "rust", "golden_published": true, @@ -1591,21 +1654,29 @@ "work_dir_golden": "target/llm-runs/basics/t_011_helper_function/rust/server/golden", "work_dir_llm": "target/llm-runs/basics/t_011_helper_function/rust/server/gpt-5/llm", "scorer_details": { - "helper_func_sum_abs": { + "helper_func_sum_parity": { "pass": false, "partial": 0.0, "notes": { - "actual": 0, - "expected": 1, - "sql": "SELECT COUNT(*) AS n FROM result WHERE id=1 AND sum=5" + "error": "spacetime call failed:\nWARNING: This command is UNSTABLE and subject to breaking changes.\n\nError: failed to find database `basics-t-011-helper-function-golden`.\n", + "phase": "call_reducer_golden" } }, - "helper_func_sum_parity": { + "schema_parity": { "pass": false, "partial": 0.0, "notes": { - "error": "spacetime call failed:\nWARNING: This command is UNSTABLE and subject to breaking changes.\n\nError: failed to find database `basics-t-011-helper-function-golden`.\n", - "phase": "call_reducer_golden" + "error": "describe failed: WARNING: This command is UNSTABLE and subject to breaking changes.\n\nError: failed to find database `basics-t-011-helper-function-golden`.\n", + "phase": "describe_golden" + } + }, + "helper_func_sum_abs": { + "pass": false, + "partial": 0.0, + "notes": { + "actual": 0, + "expected": 1, + "sql": "SELECT COUNT(*) AS n FROM result WHERE id=1 AND sum=5" } }, "schema_parity": { @@ -1618,18 +1689,18 @@ } }, "vendor": "openai", - "started_at": "2026-01-27T19:53:37.773674958Z", - "finished_at": "2026-01-27T19:53:57.689433966Z" + "started_at": "2026-01-26T19:31:59.326285562Z", + "finished_at": "2026-01-26T19:32:34.857458085Z" }, "t_012_spacetime_product_type": { - "hash": "d1bf0b033db905c668d016082c762eb4b91edd1299f7b8d4bcc6def5398610f9", + "hash": "a9b7f59b2c00330aa9e00220d45b9d8f7d257f9b10dc9f37b56a1e954c2b5117", "task": "t_012_spacetime_product_type", "lang": "rust", "golden_published": true, "model_name": "GPT-5", "total_tests": 3, "passed_tests": 0, - "llm_output": "use spacetimedb::{ReducerContext, SpacetimeType, Table};\n\n#[derive(SpacetimeType)]\npub struct Score {\n left: i32,\n right: i32,\n}\n\n#[spacetimedb::table(name = result)]\npub struct ResultRow {\n #[primary_key]\n id: i32,\n value: Score,\n}\n\n#[spacetimedb::reducer]\npub fn set_score(ctx: &ReducerContext, id: i32, left: i32, right: i32) {\n ctx.db.result().insert(ResultRow {\n id,\n value: Score { left, right },\n });\n}", + "llm_output": "use spacetimedb::{ReducerContext, Table};\n\n#[derive(spacetimedb::SpacetimeType, Clone)]\npub struct Score {\n left: i32,\n right: i32,\n}\n\n#[spacetimedb::table(name = result)]\npub struct ResultRow {\n #[primary_key]\n id: i32,\n value: Score,\n}\n\n#[spacetimedb::reducer]\npub fn set_score(ctx: &ReducerContext, id: i32, left: i32, right: i32) {\n ctx.db\n .result()\n .insert(ResultRow { id, value: Score { left, right } });\n}", "category": "schema", "route_api_model": "gpt-5", "golden_db": "schema-t-012-spacetime-product-type-golden", @@ -1637,12 +1708,13 @@ "work_dir_golden": "target/llm-runs/schema/t_012_spacetime_product_type/rust/server/golden", "work_dir_llm": "target/llm-runs/schema/t_012_spacetime_product_type/rust/server/gpt-5/llm", "scorer_details": { - "product_type_row_parity": { + "product_type_row_count": { "pass": false, "partial": 0.0, "notes": { - "error": "spacetime call failed:\nWARNING: This command is UNSTABLE and subject to breaking changes.\n\nError: failed to find database `schema-t-012-spacetime-product-type-golden`.\n", - "phase": "call_reducer_golden" + "actual": 0, + "expected": 1, + "sql": "SELECT COUNT(*) AS n FROM result WHERE id=1" } }, "schema_parity": { @@ -1653,75 +1725,57 @@ "phase": "describe_golden" } }, - "product_type_row_count": { + "product_type_row_parity": { "pass": false, "partial": 0.0, "notes": { - "actual": 0, - "expected": 1, - "sql": "SELECT COUNT(*) AS n FROM result WHERE id=1" + "error": "spacetime call failed:\nWARNING: This command is UNSTABLE and subject to breaking changes.\n\nError: failed to find database `schema-t-012-spacetime-product-type-golden`.\n", + "phase": "call_reducer_golden" } } }, "vendor": "openai", - "started_at": "2026-01-27T19:52:29.436388253Z", - "finished_at": "2026-01-27T19:53:04.338818518Z" + "started_at": "2026-01-26T19:30:31.399995435Z", + "finished_at": "2026-01-26T19:31:11.581019739Z" }, "t_013_spacetime_sum_type": { - "hash": "d1bf0b033db905c668d016082c762eb4b91edd1299f7b8d4bcc6def5398610f9", + "hash": "a9b7f59b2c00330aa9e00220d45b9d8f7d257f9b10dc9f37b56a1e954c2b5117", "task": "t_013_spacetime_sum_type", "lang": "rust", - "golden_published": true, + "golden_published": false, "model_name": "GPT-5", - "total_tests": 3, + "total_tests": 1, "passed_tests": 0, - "llm_output": "use spacetimedb::Table;\n\n#[derive(spacetimedb::SpacetimeType, Clone, Debug)]\npub struct Rect {\n width: i32,\n height: i32,\n}\n\n#[derive(spacetimedb::SpacetimeType, Clone, Debug)]\npub enum Shape {\n Circle(i32),\n Rectangle(Rect),\n}\n\n#[spacetimedb::table(name = result)]\npub struct ResultRow {\n #[primary_key]\n id: i32,\n value: Shape,\n}\n\n#[spacetimedb::reducer]\npub fn set_circle(ctx: &spacetimedb::ReducerContext, id: i32, radius: i32) {\n ctx.db.result().insert(ResultRow {\n id,\n value: Shape::Circle(radius),\n });\n}", + "llm_output": null, "category": "schema", "route_api_model": "gpt-5", - "golden_db": "schema-t-013-spacetime-sum-type-golden", - "llm_db": "schema-t-013-spacetime-sum-type-gpt-5-llm", - "work_dir_golden": "target/llm-runs/schema/t_013_spacetime_sum_type/rust/server/golden", - "work_dir_llm": "target/llm-runs/schema/t_013_spacetime_sum_type/rust/server/gpt-5/llm", + "golden_db": null, + "llm_db": null, + "work_dir_golden": null, + "work_dir_llm": null, "scorer_details": { - "schema_parity": { - "pass": false, - "partial": 0.0, - "notes": { - "error": "describe failed: WARNING: This command is UNSTABLE and subject to breaking changes.\n\nError: failed to find database `schema-t-013-spacetime-sum-type-golden`.\n", - "phase": "describe_golden" - } - }, - "sum_type_row_count": { - "pass": false, - "partial": 0.0, - "notes": { - "actual": 0, - "expected": 1, - "sql": "SELECT COUNT(*) AS n FROM result WHERE id=1" - } - }, - "sum_type_row_parity": { + "publish_error": { "pass": false, "partial": 0.0, "notes": { - "error": "spacetime call failed:\nWARNING: This command is UNSTABLE and subject to breaking changes.\n\nError: failed to find database `schema-t-013-spacetime-sum-type-golden`.\n", - "phase": "call_reducer_golden" + "error": "LLM call timed out", + "phase": "build_or_publish" } } }, "vendor": "openai", - "started_at": "2026-01-27T19:51:47.638500741Z", - "finished_at": "2026-01-27T19:53:00.578888253Z" + "started_at": "2026-01-26T19:32:55.980673255Z", + "finished_at": "2026-01-26T19:32:55.980673255Z" }, "t_014_elementary_columns": { - "hash": "d1bf0b033db905c668d016082c762eb4b91edd1299f7b8d4bcc6def5398610f9", + "hash": "a9b7f59b2c00330aa9e00220d45b9d8f7d257f9b10dc9f37b56a1e954c2b5117", "task": "t_014_elementary_columns", "lang": "rust", "golden_published": true, "model_name": "GPT-5", "total_tests": 3, "passed_tests": 0, - "llm_output": "use spacetimedb::{ReducerContext, Table};\n\n#[spacetimedb::table(name = primitive)]\npub struct Primitive {\n #[primary_key]\n id: i32,\n count: i32,\n total: i64,\n price: f32,\n ratio: f64,\n active: bool,\n name: String,\n}\n\n#[spacetimedb::reducer]\npub fn seed(ctx: &ReducerContext) {\n ctx.db.primitive().insert(Primitive {\n id: 1,\n count: 2,\n total: 3_000_000_000i64,\n price: 1.5f32,\n ratio: 2.25f64,\n active: true,\n name: \"Alice\".to_string(),\n });\n}", + "llm_output": "use spacetimedb::{ReducerContext, Table};\n\n#[spacetimedb::table(name = primitive, public)]\npub struct Primitive {\n #[primary_key]\n id: i32,\n count: i32,\n total: i64,\n price: f32,\n ratio: f64,\n active: bool,\n name: String,\n}\n\n#[spacetimedb::reducer]\npub fn seed(ctx: &ReducerContext) {\n ctx.db.primitive().insert(Primitive {\n id: 1,\n count: 2,\n total: 3_000_000_000,\n price: 1.5f32,\n ratio: 2.25,\n active: true,\n name: \"Alice\".to_string(),\n });\n}", "category": "schema", "route_api_model": "gpt-5", "golden_db": "schema-t-014-elementary-columns-golden", @@ -1737,30 +1791,30 @@ "phase": "call_reducer_golden" } }, - "elementary_columns_row_count": { + "schema_parity": { "pass": false, "partial": 0.0, "notes": { - "actual": 0, - "expected": 1, - "sql": "SELECT COUNT(*) AS n FROM primitive WHERE id=1" + "error": "describe failed: WARNING: This command is UNSTABLE and subject to breaking changes.\n\nError: failed to find database `schema-t-014-elementary-columns-golden`.\n", + "phase": "describe_golden" } }, - "schema_parity": { + "elementary_columns_row_count": { "pass": false, "partial": 0.0, "notes": { - "error": "describe failed: WARNING: This command is UNSTABLE and subject to breaking changes.\n\nError: failed to find database `schema-t-014-elementary-columns-golden`.\n", - "phase": "describe_golden" + "actual": 0, + "expected": 1, + "sql": "SELECT COUNT(*) AS n FROM primitive WHERE id=1" } } }, "vendor": "openai", - "started_at": "2026-01-27T19:52:27.568323309Z", - "finished_at": "2026-01-27T19:53:02.605112864Z" + "started_at": "2026-01-26T19:30:30.882003264Z", + "finished_at": "2026-01-26T19:31:23.563975616Z" }, "t_015_product_type_columns": { - "hash": "d1bf0b033db905c668d016082c762eb4b91edd1299f7b8d4bcc6def5398610f9", + "hash": "a9b7f59b2c00330aa9e00220d45b9d8f7d257f9b10dc9f37b56a1e954c2b5117", "task": "t_015_product_type_columns", "lang": "rust", "golden_published": false, @@ -1785,63 +1839,47 @@ } }, "vendor": "openai", - "started_at": "2026-01-27T19:54:31.831326960Z", - "finished_at": "2026-01-27T19:54:31.831326960Z" + "started_at": "2026-01-26T19:32:55.980689378Z", + "finished_at": "2026-01-26T19:32:55.980689378Z" }, "t_016_sum_type_columns": { - "hash": "d1bf0b033db905c668d016082c762eb4b91edd1299f7b8d4bcc6def5398610f9", + "hash": "a9b7f59b2c00330aa9e00220d45b9d8f7d257f9b10dc9f37b56a1e954c2b5117", "task": "t_016_sum_type_columns", "lang": "rust", - "golden_published": true, + "golden_published": false, "model_name": "GPT-5", - "total_tests": 3, + "total_tests": 1, "passed_tests": 0, - "llm_output": "use spacetimedb::{ReducerContext, SpacetimeType, Table};\n\n#[derive(SpacetimeType, Clone, Debug)]\npub struct Rect {\n width: i32,\n height: i32,\n}\n\n#[derive(SpacetimeType, Clone, Debug)]\npub enum Shape {\n Circle(i32),\n Rectangle(Rect),\n}\n\n#[spacetimedb::table(name = drawing)]\npub struct Drawing {\n #[primary_key]\n id: i32,\n a: Shape,\n b: Shape,\n}\n\n#[spacetimedb::reducer]\npub fn seed(ctx: &ReducerContext) {\n if ctx.db.drawing().count() == 0 {\n ctx.db.drawing().insert(Drawing {\n id: 1,\n a: Shape::Circle(10),\n b: Shape::Rectangle(Rect { width: 4, height: 6 }),\n });\n }\n}", + "llm_output": null, "category": "schema", "route_api_model": "gpt-5", - "golden_db": "schema-t-016-sum-type-columns-golden", - "llm_db": "schema-t-016-sum-type-columns-gpt-5-llm", - "work_dir_golden": "target/llm-runs/schema/t_016_sum_type_columns/rust/server/golden", - "work_dir_llm": "target/llm-runs/schema/t_016_sum_type_columns/rust/server/gpt-5/llm", + "golden_db": null, + "llm_db": null, + "work_dir_golden": null, + "work_dir_llm": null, "scorer_details": { - "schema_parity": { - "pass": false, - "partial": 0.0, - "notes": { - "error": "describe failed: WARNING: This command is UNSTABLE and subject to breaking changes.\n\nError: failed to find database `schema-t-016-sum-type-columns-golden`.\n", - "phase": "describe_golden" - } - }, - "sum_type_columns_row_parity": { - "pass": false, - "partial": 0.0, - "notes": { - "error": "spacetime call failed:\nWARNING: This command is UNSTABLE and subject to breaking changes.\n\nError: failed to find database `schema-t-016-sum-type-columns-golden`.\n", - "phase": "call_reducer_golden" - } - }, - "sum_type_columns_row_count": { + "publish_error": { "pass": false, "partial": 0.0, "notes": { - "error": "spacetime sql failed:\nWARNING: This command is UNSTABLE and subject to breaking changes.\n\nError: no such table: `drawings`. If the table exists, it may be marked private.\n\nCaused by:\n HTTP status client error (400 Bad Request) for url (http://127.0.0.1:38927/v1/database/c200596b7e7f2350abeb00119177ef3448e7673481a61aeaa7c22e4dd952cb52/sql)\n", - "phase": "sql" + "error": "LLM call timed out", + "phase": "build_or_publish" } } }, "vendor": "openai", - "started_at": "2026-01-27T19:51:47.634170474Z", - "finished_at": "2026-01-27T19:52:27.568235316Z" + "started_at": "2026-01-26T19:32:55.980668485Z", + "finished_at": "2026-01-26T19:32:55.980668485Z" }, "t_017_scheduled_columns": { - "hash": "d1bf0b033db905c668d016082c762eb4b91edd1299f7b8d4bcc6def5398610f9", + "hash": "a9b7f59b2c00330aa9e00220d45b9d8f7d257f9b10dc9f37b56a1e954c2b5117", "task": "t_017_scheduled_columns", "lang": "rust", "golden_published": true, "model_name": "GPT-5", "total_tests": 2, "passed_tests": 1, - "llm_output": "use std::time::Duration;\nuse spacetimedb::{ReducerContext, ScheduleAt, Table};\n\n#[spacetimedb::table(name = tick_timer, scheduled(tick))]\npub struct TickTimer {\n #[primary_key]\n #[auto_inc]\n scheduled_id: u64,\n scheduled_at: ScheduleAt,\n}\n\n#[spacetimedb::reducer]\npub fn tick(_ctx: &ReducerContext, _tick_timer: TickTimer) -> Result<(), String> {\n Ok(())\n}\n\n#[spacetimedb::reducer(init)]\npub fn init(ctx: &ReducerContext) -> Result<(), String> {\n if ctx.db.tick_timer().count() == 0 {\n ctx.db.tick_timer().try_insert(TickTimer {\n scheduled_id: 0,\n scheduled_at: ScheduleAt::Interval(Duration::from_micros(50_000).into()),\n })?;\n }\n Ok(())\n}", + "llm_output": "use std::time::Duration;\nuse spacetimedb::{ReducerContext, ScheduleAt, Table};\n\n#[spacetimedb::table(name = tick_timer, scheduled(tick))]\npub struct TickTimer {\n #[primary_key]\n #[auto_inc]\n scheduled_id: u64,\n scheduled_at: ScheduleAt,\n}\n\n#[spacetimedb::reducer]\npub fn tick(_ctx: &ReducerContext, _timer: TickTimer) {}\n\n#[spacetimedb::reducer(init)]\npub fn init(ctx: &ReducerContext) -> Result<(), String> {\n ctx.db.tick_timer().try_insert(TickTimer {\n scheduled_id: 0,\n scheduled_at: ScheduleAt::Interval(Duration::from_micros(50_000).into()),\n })?;\n Ok(())\n}", "category": "schema", "route_api_model": "gpt-5", "golden_db": "schema-t-017-scheduled-columns-golden", @@ -1868,190 +1906,105 @@ } }, "vendor": "openai", - "started_at": "2026-01-27T19:51:47.625840249Z", - "finished_at": "2026-01-27T19:52:35.522695487Z" + "started_at": "2026-01-26T19:29:24.576470966Z", + "finished_at": "2026-01-26T19:30:31.399943290Z" }, "t_018_constraints": { - "hash": "d1bf0b033db905c668d016082c762eb4b91edd1299f7b8d4bcc6def5398610f9", + "hash": "a9b7f59b2c00330aa9e00220d45b9d8f7d257f9b10dc9f37b56a1e954c2b5117", "task": "t_018_constraints", "lang": "rust", - "golden_published": true, + "golden_published": false, "model_name": "GPT-5", - "total_tests": 3, + "total_tests": 1, "passed_tests": 0, - "llm_output": "use spacetimedb::{ReducerContext, Table};\n\n#[spacetimedb::table(name = account, index(name = by_name, btree(columns = [name])))]\npub struct Account {\n #[primary_key]\n id: i32,\n #[unique]\n email: String,\n name: String,\n}\n\n#[spacetimedb::reducer]\npub fn seed(ctx: &ReducerContext) {\n let ids: Vec = ctx.db.account().iter().map(|a| a.id).collect();\n for id in ids {\n ctx.db.account().id().delete(id);\n }\n\n ctx.db.account().insert(Account {\n id: 1,\n email: \"a@example.com\".into(),\n name: \"Alice\".into(),\n });\n ctx.db.account().insert(Account {\n id: 2,\n email: \"b@example.com\".into(),\n name: \"Bob\".into(),\n });\n}", + "llm_output": null, "category": "schema", "route_api_model": "gpt-5", - "golden_db": "schema-t-018-constraints-golden", - "llm_db": "schema-t-018-constraints-gpt-5-llm", - "work_dir_golden": "target/llm-runs/schema/t_018_constraints/rust/server/golden", - "work_dir_llm": "target/llm-runs/schema/t_018_constraints/rust/server/gpt-5/llm", + "golden_db": null, + "llm_db": null, + "work_dir_golden": null, + "work_dir_llm": null, "scorer_details": { - "constraints_row_parity_after_seed": { + "publish_error": { "pass": false, "partial": 0.0, "notes": { - "error": "spacetime call failed:\nWARNING: This command is UNSTABLE and subject to breaking changes.\n\nError: failed to find database `schema-t-018-constraints-golden`.\n", - "phase": "call_reducer_golden" - } - }, - "schema_parity": { - "pass": false, - "partial": 0.0, - "notes": { - "error": "describe failed: WARNING: This command is UNSTABLE and subject to breaking changes.\n\nError: failed to find database `schema-t-018-constraints-golden`.\n", - "phase": "describe_golden" - } - }, - "constraints_seed_two_rows": { - "pass": false, - "partial": 0.0, - "notes": { - "actual": 0, - "expected": 1, - "sql": "SELECT COUNT(*) AS n FROM account WHERE id=2" + "error": "LLM call timed out", + "phase": "build_or_publish" } } }, "vendor": "openai", - "started_at": "2026-01-27T19:51:47.622424031Z", - "finished_at": "2026-01-27T19:53:37.773579225Z" + "started_at": "2026-01-26T19:32:55.980661308Z", + "finished_at": "2026-01-26T19:32:55.980661308Z" }, "t_019_many_to_many": { - "hash": "d1bf0b033db905c668d016082c762eb4b91edd1299f7b8d4bcc6def5398610f9", + "hash": "a9b7f59b2c00330aa9e00220d45b9d8f7d257f9b10dc9f37b56a1e954c2b5117", "task": "t_019_many_to_many", "lang": "rust", - "golden_published": true, + "golden_published": false, "model_name": "GPT-5", - "total_tests": 5, - "passed_tests": 4, - "llm_output": "use spacetimedb::Table;\n\n#[spacetimedb::table(name = user, public)]\npub struct User {\n #[primary_key]\n user_id: i32,\n name: String,\n}\n\n#[spacetimedb::table(name = group, public)]\npub struct Group {\n #[primary_key]\n group_id: i32,\n title: String,\n}\n\n#[spacetimedb::table(\n name = membership,\n public,\n index(name = by_user, btree(columns = [user_id])),\n index(name = by_group, btree(columns = [group_id]))\n)]\npub struct Membership {\n #[primary_key]\n id: i32,\n user_id: i32,\n group_id: i32,\n}\n\n#[spacetimedb::reducer]\npub fn seed(ctx: &spacetimedb::ReducerContext) {\n ctx.db.user().insert(User { user_id: 1, name: \"Alice\".into() });\n ctx.db.user().insert(User { user_id: 2, name: \"Bob\".into() });\n\n ctx.db.group().insert(Group { group_id: 10, title: \"Admin\".into() });\n ctx.db.group().insert(Group { group_id: 20, title: \"Dev\".into() });\n\n ctx.db.membership().insert(Membership { id: 1, user_id: 1, group_id: 10 });\n ctx.db.membership().insert(Membership { id: 2, user_id: 1, group_id: 20 });\n ctx.db.membership().insert(Membership { id: 3, user_id: 2, group_id: 20 });\n}", + "total_tests": 1, + "passed_tests": 0, + "llm_output": null, "category": "schema", "route_api_model": "gpt-5", - "golden_db": "schema-t-019-many-to-many-golden", - "llm_db": "schema-t-019-many-to-many-gpt-5-llm", - "work_dir_golden": "target/llm-runs/schema/t_019_many_to_many/rust/server/golden", - "work_dir_llm": "target/llm-runs/schema/t_019_many_to_many/rust/server/gpt-5/llm", + "golden_db": null, + "llm_db": null, + "work_dir_golden": null, + "work_dir_llm": null, "scorer_details": { - "memberships_three_rows": { - "pass": true, - "partial": 1.0, - "notes": { - "actual": 3, - "expected": 3, - "sql": "SELECT COUNT(*) AS n FROM membership" - } - }, - "schema_parity": { + "publish_error": { "pass": false, "partial": 0.0, "notes": { - "error": "describe failed: WARNING: This command is UNSTABLE and subject to breaking changes.\n\nError: failed to find database `schema-t-019-many-to-many-golden`.\n", - "phase": "describe_golden" - } - }, - "m2m_has_1_20": { - "pass": true, - "partial": 1.0, - "notes": { - "actual": 1, - "expected": 1, - "sql": "SELECT COUNT(*) AS n FROM membership WHERE user_id=1 AND group_id=20" - } - }, - "m2m_has_1_10": { - "pass": true, - "partial": 1.0, - "notes": { - "actual": 1, - "expected": 1, - "sql": "SELECT COUNT(*) AS n FROM membership WHERE user_id=1 AND group_id=10" - } - }, - "m2m_has_2_20": { - "pass": true, - "partial": 1.0, - "notes": { - "actual": 1, - "expected": 1, - "sql": "SELECT COUNT(*) AS n FROM membership WHERE user_id=2 AND group_id=20" + "error": "LLM call timed out", + "phase": "build_or_publish" } } }, "vendor": "openai", - "started_at": "2026-01-27T19:51:47.642788029Z", - "finished_at": "2026-01-27T19:52:31.910080797Z" + "started_at": "2026-01-26T19:32:55.980679692Z", + "finished_at": "2026-01-26T19:32:55.980679692Z" }, "t_020_ecs": { - "hash": "d1bf0b033db905c668d016082c762eb4b91edd1299f7b8d4bcc6def5398610f9", + "hash": "a9b7f59b2c00330aa9e00220d45b9d8f7d257f9b10dc9f37b56a1e954c2b5117", "task": "t_020_ecs", "lang": "rust", - "golden_published": true, + "golden_published": false, "model_name": "GPT-5", - "total_tests": 5, + "total_tests": 1, "passed_tests": 0, - "llm_output": "use spacetimedb::{ReducerContext, Table};\n\n#[spacetimedb::table(name = entity)]\npub struct Entity {\n #[primary_key]\n id: i32,\n}\n\n#[spacetimedb::table(name = position)]\npub struct Position {\n #[primary_key]\n entity_id: i32,\n x: i32,\n y: i32,\n}\n\n#[spacetimedb::table(name = velocity)]\npub struct Velocity {\n #[primary_key]\n entity_id: i32,\n vx: i32,\n vy: i32,\n}\n\n#[spacetimedb::table(name = next_position)]\npub struct NextPosition {\n #[primary_key]\n entity_id: i32,\n x: i32,\n y: i32,\n}\n\n#[spacetimedb::reducer]\npub fn seed(ctx: &ReducerContext) {\n // First entity: id=1, pos=(0,0), vel=(1,0)\n ctx.db.entity().id().delete(1);\n ctx.db.position().entity_id().delete(1);\n ctx.db.velocity().entity_id().delete(1);\n ctx.db.entity().insert(Entity { id: 1 });\n ctx.db.position().insert(Position { entity_id: 1, x: 0, y: 0 });\n ctx.db.velocity().insert(Velocity { entity_id: 1, vx: 1, vy: 0 });\n\n // Second entity: id=2, pos=(10,0), vel=(-2,3)\n ctx.db.entity().id().delete(2);\n ctx.db.position().entity_id().delete(2);\n ctx.db.velocity().entity_id().delete(2);\n ctx.db.entity().insert(Entity { id: 2 });\n ctx.db.position().insert(Position { entity_id: 2, x: 10, y: 0 });\n ctx.db.velocity().insert(Velocity { entity_id: 2, vx: -2, vy: 3 });\n}\n\n#[spacetimedb::reducer]\npub fn step(ctx: &ReducerContext) {\n for pos in ctx.db.position().iter() {\n if let Some(vel) = ctx.db.velocity().entity_id().find(pos.entity_id) {\n let nx = pos.x + vel.vx;\n let ny = pos.y + vel.vy;\n if let Some(_existing) = ctx.db.next_position().entity_id().find(pos.entity_id) {\n ctx.db\n .next_position()\n .entity_id()\n .update(NextPosition { entity_id: pos.entity_id, x: nx, y: ny });\n } else {\n ctx.db\n .next_position()\n .insert(NextPosition { entity_id: pos.entity_id, x: nx, y: ny });\n }\n }\n }\n}", + "llm_output": null, "category": "schema", "route_api_model": "gpt-5", - "golden_db": "schema-t-020-ecs-golden", - "llm_db": "schema-t-020-ecs-gpt-5-llm", - "work_dir_golden": "target/llm-runs/schema/t_020_ecs/rust/server/golden", - "work_dir_llm": "target/llm-runs/schema/t_020_ecs/rust/server/gpt-5/llm", + "golden_db": null, + "llm_db": null, + "work_dir_golden": null, + "work_dir_llm": null, "scorer_details": { - "schema_parity": { - "pass": false, - "partial": 0.0, - "notes": { - "error": "describe failed: WARNING: This command is UNSTABLE and subject to breaking changes.\n\nError: failed to find database `schema-t-020-ecs-golden`.\n", - "phase": "describe_golden" - } - }, - "ecs_step_next_positions_count": { - "pass": false, - "partial": 0.0, - "notes": { - "error": "spacetime sql failed:\nWARNING: This command is UNSTABLE and subject to breaking changes.\n\nError: no such table: `next_positions`. If the table exists, it may be marked private.\n\nCaused by:\n HTTP status client error (400 Bad Request) for url (http://127.0.0.1:38927/v1/database/c2000dfb254023618a83b1182de85ff2f9590dae5ce1c9301d7d8cc01c8bff6e/sql)\n", - "phase": "sql" - } - }, - "ecs_next_pos_entity1": { - "pass": false, - "partial": 0.0, - "notes": { - "error": "spacetime sql failed:\nWARNING: This command is UNSTABLE and subject to breaking changes.\n\nError: no such table: `next_positions`. If the table exists, it may be marked private.\n\nCaused by:\n HTTP status client error (400 Bad Request) for url (http://127.0.0.1:38927/v1/database/c2000dfb254023618a83b1182de85ff2f9590dae5ce1c9301d7d8cc01c8bff6e/sql)\n", - "phase": "sql" - } - }, - "ecs_seed_positions_count": { - "pass": false, - "partial": 0.0, - "notes": { - "error": "spacetime sql failed:\nWARNING: This command is UNSTABLE and subject to breaking changes.\n\nError: no such table: `positions`. If the table exists, it may be marked private.\n\nCaused by:\n HTTP status client error (400 Bad Request) for url (http://127.0.0.1:38927/v1/database/c2000dfb254023618a83b1182de85ff2f9590dae5ce1c9301d7d8cc01c8bff6e/sql)\n", - "phase": "sql" - } - }, - "ecs_next_pos_entity2": { + "publish_error": { "pass": false, "partial": 0.0, "notes": { - "error": "spacetime sql failed:\nWARNING: This command is UNSTABLE and subject to breaking changes.\n\nError: no such table: `next_positions`. If the table exists, it may be marked private.\n\nCaused by:\n HTTP status client error (400 Bad Request) for url (http://127.0.0.1:38927/v1/database/c2000dfb254023618a83b1182de85ff2f9590dae5ce1c9301d7d8cc01c8bff6e/sql)\n", - "phase": "sql" + "error": "LLM call timed out", + "phase": "build_or_publish" } } }, "vendor": "openai", - "started_at": "2026-01-27T19:51:47.647113172Z", - "finished_at": "2026-01-27T19:52:42.328754582Z" + "started_at": "2026-01-26T19:32:55.980684633Z", + "finished_at": "2026-01-26T19:32:55.980684633Z" }, "t_021_multi_column_index": { - "hash": "d1bf0b033db905c668d016082c762eb4b91edd1299f7b8d4bcc6def5398610f9", + "hash": "a9b7f59b2c00330aa9e00220d45b9d8f7d257f9b10dc9f37b56a1e954c2b5117", "task": "t_021_multi_column_index", "lang": "rust", "golden_published": true, "model_name": "GPT-5", "total_tests": 4, "passed_tests": 3, - "llm_output": "use spacetimedb::{ReducerContext, Table};\n\n#[spacetimedb::table(name = log, index(name = by_user_day, btree(columns = [user_id, day])))]\npub struct Log {\n #[primary_key]\n id: i32,\n user_id: i32,\n day: i32,\n message: String,\n}\n\n#[spacetimedb::reducer]\npub fn seed(ctx: &ReducerContext) {\n ctx.db.log().insert(Log { id: 1, user_id: 7, day: 1, message: \"a\".into() });\n ctx.db.log().insert(Log { id: 2, user_id: 7, day: 2, message: \"b\".into() });\n ctx.db.log().insert(Log { id: 3, user_id: 9, day: 1, message: \"c\".into() });\n}", + "llm_output": "use spacetimedb::{ReducerContext, Table};\n\n#[spacetimedb::table(\n name = log,\n index(name = by_user_day, btree(columns = [user_id, day]))\n)]\npub struct Log {\n #[primary_key]\n id: i32,\n user_id: i32,\n day: i32,\n message: String,\n}\n\n#[spacetimedb::reducer]\npub fn seed(ctx: &ReducerContext) {\n let _ = ctx.db.log().try_insert(Log { id: 1, user_id: 7, day: 1, message: \"a\".to_string() });\n let _ = ctx.db.log().try_insert(Log { id: 2, user_id: 7, day: 2, message: \"b\".to_string() });\n let _ = ctx.db.log().try_insert(Log { id: 3, user_id: 9, day: 1, message: \"c\".to_string() });\n}", "category": "schema", "route_api_model": "gpt-5", "golden_db": "schema-t-021-multi-column-index-golden", @@ -2059,6 +2012,15 @@ "work_dir_golden": "target/llm-runs/schema/t_021_multi_column_index/rust/server/golden", "work_dir_llm": "target/llm-runs/schema/t_021_multi_column_index/rust/server/gpt-5/llm", "scorer_details": { + "mcindex_lookup_u7_d2": { + "pass": true, + "partial": 1.0, + "notes": { + "actual": 1, + "expected": 1, + "sql": "SELECT COUNT(*) AS n FROM log WHERE user_id=7 AND day=2" + } + }, "schema_parity": { "pass": false, "partial": 0.0, @@ -2067,15 +2029,6 @@ "phase": "describe_golden" } }, - "mcindex_seed_count": { - "pass": true, - "partial": 1.0, - "notes": { - "actual": 3, - "expected": 3, - "sql": "SELECT COUNT(*) AS n FROM log" - } - }, "mcindex_lookup_u7_d1": { "pass": true, "partial": 1.0, @@ -2085,19 +2038,19 @@ "sql": "SELECT COUNT(*) AS n FROM log WHERE user_id=7 AND day=1" } }, - "mcindex_lookup_u7_d2": { + "mcindex_seed_count": { "pass": true, "partial": 1.0, "notes": { - "actual": 1, - "expected": 1, - "sql": "SELECT COUNT(*) AS n FROM log WHERE user_id=7 AND day=2" + "actual": 3, + "expected": 3, + "sql": "SELECT COUNT(*) AS n FROM log" } } }, "vendor": "openai", - "started_at": "2026-01-27T19:51:47.629929093Z", - "finished_at": "2026-01-27T19:52:29.436282461Z" + "started_at": "2026-01-26T19:29:24.579594233Z", + "finished_at": "2026-01-26T19:30:30.881922637Z" } } } @@ -2288,14 +2241,14 @@ "modes": [ { "mode": "docs", - "hash": "e3621eaacfd5238fb514ff8c09c277ccd66170773959e5b391507110bf3ac17b", + "hash": "2f6071a69fd778167c45e20453bc018eebc468cc87681c455f819adfa10148a0", "models": [ { "name": "GPT-5", "route_api_model": "gpt-5", "tasks": { "t_000_empty_reducers": { - "hash": "e3621eaacfd5238fb514ff8c09c277ccd66170773959e5b391507110bf3ac17b", + "hash": "2f6071a69fd778167c45e20453bc018eebc468cc87681c455f819adfa10148a0", "task": "t_000_empty_reducers", "lang": "csharp", "golden_published": true, @@ -2318,25 +2271,25 @@ "llm_db": "basics-t-000-empty-reducers-gpt-5-llm", "reducers_diff": null, "reducers_equal": true, - "server": "http://127.0.0.1:34379", + "server": "http://127.0.0.1:44935", "tables_diff": null, "tables_equal": true } } }, "vendor": "openai", - "started_at": "2026-01-27T19:59:45.341740044Z", - "finished_at": "2026-01-27T20:00:17.110354447Z" + "started_at": "2026-01-26T19:38:54.385915075Z", + "finished_at": "2026-01-26T19:40:03.912043999Z" }, "t_001_basic_tables": { - "hash": "e3621eaacfd5238fb514ff8c09c277ccd66170773959e5b391507110bf3ac17b", + "hash": "2f6071a69fd778167c45e20453bc018eebc468cc87681c455f819adfa10148a0", "task": "t_001_basic_tables", "lang": "csharp", "golden_published": true, "model_name": "GPT-5", "total_tests": 1, "passed_tests": 1, - "llm_output": "using SpacetimeDB;\n\npublic static partial class Module\n{\n [SpacetimeDB.Table(Name = \"User\")]\n public partial struct User\n {\n [SpacetimeDB.PrimaryKey]\n public int Id;\n public string Name;\n public int Age;\n public bool Active;\n }\n\n [SpacetimeDB.Table(Name = \"Product\")]\n public partial struct Product\n {\n [SpacetimeDB.PrimaryKey]\n public int Id;\n public string Title;\n public float Price;\n public bool InStock;\n }\n\n [SpacetimeDB.Table(Name = \"Note\")]\n public partial struct Note\n {\n [SpacetimeDB.PrimaryKey]\n public int Id;\n public string Body;\n public long Rating;\n public bool Pinned;\n }\n}", + "llm_output": "using SpacetimeDB;\n\npublic static partial class Module\n{\n [SpacetimeDB.Table(Name = \"User\", Public = true)]\n public partial struct User\n {\n [SpacetimeDB.PrimaryKey]\n public int Id;\n public string Name;\n public int Age;\n public bool Active;\n }\n\n [SpacetimeDB.Table(Name = \"Product\", Public = true)]\n public partial struct Product\n {\n [SpacetimeDB.PrimaryKey]\n public int Id;\n public string Title;\n public float Price;\n public bool InStock;\n }\n\n [SpacetimeDB.Table(Name = \"Note\", Public = true)]\n public partial struct Note\n {\n [SpacetimeDB.PrimaryKey]\n public int Id;\n public string Body;\n public long Rating;\n public bool Pinned;\n }\n}", "category": "basics", "route_api_model": "gpt-5", "golden_db": "basics-t-001-basic-tables-golden", @@ -2352,25 +2305,25 @@ "llm_db": "basics-t-001-basic-tables-gpt-5-llm", "reducers_diff": null, "reducers_equal": true, - "server": "http://127.0.0.1:34379", + "server": "http://127.0.0.1:44935", "tables_diff": null, "tables_equal": true } } }, "vendor": "openai", - "started_at": "2026-01-27T20:00:10.594319009Z", - "finished_at": "2026-01-27T20:00:39.454473930Z" + "started_at": "2026-01-26T19:39:06.588178775Z", + "finished_at": "2026-01-26T19:40:26.686164444Z" }, "t_002_scheduled_table": { - "hash": "e3621eaacfd5238fb514ff8c09c277ccd66170773959e5b391507110bf3ac17b", + "hash": "2f6071a69fd778167c45e20453bc018eebc468cc87681c455f819adfa10148a0", "task": "t_002_scheduled_table", "lang": "csharp", "golden_published": true, "model_name": "GPT-5", "total_tests": 1, "passed_tests": 1, - "llm_output": "using System;\nusing SpacetimeDB;\n\npublic static partial class Module\n{\n [SpacetimeDB.Table(Name = \"TickTimer\", Scheduled = nameof(Tick), ScheduledAt = nameof(ScheduledAt))]\n public partial struct TickTimer\n {\n [SpacetimeDB.PrimaryKey]\n [SpacetimeDB.AutoInc]\n public ulong ScheduledId;\n public ScheduleAt ScheduledAt;\n }\n\n [SpacetimeDB.Reducer(ReducerKind.Init)]\n public static void Init(ReducerContext ctx)\n {\n foreach (var row in ctx.Db.TickTimer.Iter())\n {\n ctx.Db.TickTimer.ScheduledId.Delete(row.ScheduledId);\n }\n\n ctx.Db.TickTimer.Insert(new TickTimer\n {\n ScheduledId = 0,\n ScheduledAt = new ScheduleAt.Interval(TimeSpan.FromMilliseconds(50))\n });\n }\n\n [SpacetimeDB.Reducer]\n public static void Tick(ReducerContext ctx, TickTimer _timer)\n {\n // Tick scheduled reducer. Intentionally left blank.\n }\n}", + "llm_output": "using System;\nusing SpacetimeDB;\n\npublic static partial class Module\n{\n [Table(Name = \"TickTimer\", Scheduled = nameof(Tick), ScheduledAt = nameof(ScheduledAt))]\n public partial struct TickTimer\n {\n [PrimaryKey, AutoInc]\n public ulong ScheduledId;\n public ScheduleAt ScheduledAt;\n }\n\n [Reducer]\n public static void Tick(ReducerContext ctx, TickTimer _timer)\n {\n }\n\n [Reducer(ReducerKind.Init)]\n public static void Init(ReducerContext ctx)\n {\n ctx.Db.TickTimer.Insert(new TickTimer\n {\n ScheduledId = 0,\n ScheduledAt = new ScheduleAt.Interval(TimeSpan.FromMilliseconds(50))\n });\n }\n}", "category": "basics", "route_api_model": "gpt-5", "golden_db": "basics-t-002-scheduled-table-golden", @@ -2386,25 +2339,25 @@ "llm_db": "basics-t-002-scheduled-table-gpt-5-llm", "reducers_diff": null, "reducers_equal": true, - "server": "http://127.0.0.1:34379", + "server": "http://127.0.0.1:44935", "tables_diff": null, "tables_equal": true } } }, "vendor": "openai", - "started_at": "2026-01-27T20:00:39.454500245Z", - "finished_at": "2026-01-27T20:01:19.695962602Z" + "started_at": "2026-01-26T19:40:26.686215935Z", + "finished_at": "2026-01-26T19:41:35.359471807Z" }, "t_003_struct_in_table": { - "hash": "e3621eaacfd5238fb514ff8c09c277ccd66170773959e5b391507110bf3ac17b", + "hash": "2f6071a69fd778167c45e20453bc018eebc468cc87681c455f819adfa10148a0", "task": "t_003_struct_in_table", "lang": "csharp", "golden_published": true, "model_name": "GPT-5", "total_tests": 1, "passed_tests": 1, - "llm_output": "using SpacetimeDB;\n\npublic static partial class Module\n{\n [SpacetimeDB.Type]\n public partial struct Position\n {\n public int X;\n public int Y;\n }\n\n [SpacetimeDB.Table(Name = \"Entity\")]\n public partial struct Entity\n {\n [SpacetimeDB.PrimaryKey]\n public int Id;\n public Position Pos;\n }\n}", + "llm_output": "using SpacetimeDB;\n\npublic static partial class Module\n{\n [SpacetimeDB.Type]\n public partial struct Position\n {\n public int X;\n public int Y;\n }\n\n [SpacetimeDB.Table(Name = \"Entity\", Public = true)]\n public partial struct Entity\n {\n [SpacetimeDB.PrimaryKey]\n public int Id;\n public Position Pos;\n }\n}", "category": "basics", "route_api_model": "gpt-5", "golden_db": "basics-t-003-struct-in-table-golden", @@ -2420,18 +2373,18 @@ "llm_db": "basics-t-003-struct-in-table-gpt-5-llm", "reducers_diff": null, "reducers_equal": true, - "server": "http://127.0.0.1:34379", + "server": "http://127.0.0.1:44935", "tables_diff": null, "tables_equal": true } } }, "vendor": "openai", - "started_at": "2026-01-27T20:00:06.267861248Z", - "finished_at": "2026-01-27T20:00:37.823969244Z" + "started_at": "2026-01-26T19:39:03.248071954Z", + "finished_at": "2026-01-26T19:40:22.292027026Z" }, "t_004_insert": { - "hash": "e3621eaacfd5238fb514ff8c09c277ccd66170773959e5b391507110bf3ac17b", + "hash": "2f6071a69fd778167c45e20453bc018eebc468cc87681c455f819adfa10148a0", "task": "t_004_insert", "lang": "csharp", "golden_published": true, @@ -2454,7 +2407,7 @@ "llm_db": "basics-t-004-insert-gpt-5-llm", "reducers_diff": null, "reducers_equal": true, - "server": "http://127.0.0.1:34379", + "server": "http://127.0.0.1:44935", "tables_diff": null, "tables_equal": true } @@ -2475,23 +2428,23 @@ "llm_out": "Id | Name | Age | Active ----+---------+-----+-------- 1 | \"Alice\" | 30 | true", "query": "SELECT Id, Name, Age, Active FROM User WHERE Id=1", "reducer": "InsertUser", - "server": "http://127.0.0.1:34379" + "server": "http://127.0.0.1:44935" } } }, "vendor": "openai", - "started_at": "2026-01-27T20:00:17.336276015Z", - "finished_at": "2026-01-27T20:00:48.236577365Z" + "started_at": "2026-01-26T19:40:05.942682308Z", + "finished_at": "2026-01-26T19:41:00.825583459Z" }, "t_005_update": { - "hash": "e3621eaacfd5238fb514ff8c09c277ccd66170773959e5b391507110bf3ac17b", + "hash": "2f6071a69fd778167c45e20453bc018eebc468cc87681c455f819adfa10148a0", "task": "t_005_update", "lang": "csharp", "golden_published": true, "model_name": "GPT-5", "total_tests": 3, "passed_tests": 3, - "llm_output": "using SpacetimeDB;\n\npublic static partial class Module\n{\n [SpacetimeDB.Table(Name = \"User\")]\n public partial struct User\n {\n [SpacetimeDB.PrimaryKey]\n public int Id;\n public string Name;\n public int Age;\n public bool Active;\n }\n\n [SpacetimeDB.Reducer]\n public static void UpdateUser(ReducerContext ctx, int id, string name, int age, bool active)\n {\n var user = ctx.Db.User.Id.Find(id) ?? throw new System.Exception(\"User not found\");\n user.Name = name;\n user.Age = age;\n user.Active = active;\n user.Id = id;\n ctx.Db.User.Id.Update(user);\n }\n}", + "llm_output": "using SpacetimeDB;\n\npublic static partial class Module\n{\n [SpacetimeDB.Table(Name = \"User\")]\n public partial struct User\n {\n [SpacetimeDB.PrimaryKey]\n public int Id;\n public string Name;\n public int Age;\n public bool Active;\n }\n\n [SpacetimeDB.Reducer]\n public static void UpdateUser(ReducerContext ctx, int id, string name, int age, bool active)\n {\n var user = ctx.Db.User.Id.Find(id) ?? throw new System.Exception(\"User not found\");\n user.Name = name;\n user.Age = age;\n user.Active = active;\n ctx.Db.User.Id.Update(user);\n }\n}", "category": "basics", "route_api_model": "gpt-5", "golden_db": "basics-t-005-update-golden", @@ -2499,6 +2452,13 @@ "work_dir_golden": "target/llm-runs/basics/t_005_update/csharp/server/golden", "work_dir_llm": "target/llm-runs/basics/t_005_update/csharp/server/gpt-5/llm", "scorer_details": { + "seed_users_row": { + "pass": true, + "partial": 1.0, + "notes": { + "sql": "INSERT INTO User(Id, Name, Age, Active) VALUES (1, 'Alice', 30, true)" + } + }, "data_parity_update_user": { "pass": true, "partial": 1.0, @@ -2515,14 +2475,7 @@ "llm_out": "Id | Name | Age | Active ----+----------+-----+-------- 1 | \"Alice2\" | 31 | false", "query": "SELECT Id, Name, Age, Active FROM User WHERE Id=1", "reducer": "UpdateUser", - "server": "http://127.0.0.1:34379" - } - }, - "seed_users_row": { - "pass": true, - "partial": 1.0, - "notes": { - "sql": "INSERT INTO User(Id, Name, Age, Active) VALUES (1, 'Alice', 30, true)" + "server": "http://127.0.0.1:44935" } }, "schema_parity": { @@ -2533,18 +2486,18 @@ "llm_db": "basics-t-005-update-gpt-5-llm", "reducers_diff": null, "reducers_equal": true, - "server": "http://127.0.0.1:34379", + "server": "http://127.0.0.1:44935", "tables_diff": null, "tables_equal": true } } }, "vendor": "openai", - "started_at": "2026-01-27T19:59:43.681559749Z", - "finished_at": "2026-01-27T20:00:17.332627669Z" + "started_at": "2026-01-26T19:38:38.720018388Z", + "finished_at": "2026-01-26T19:40:05.937381701Z" }, "t_006_delete": { - "hash": "e3621eaacfd5238fb514ff8c09c277ccd66170773959e5b391507110bf3ac17b", + "hash": "2f6071a69fd778167c45e20453bc018eebc468cc87681c455f819adfa10148a0", "task": "t_006_delete", "lang": "csharp", "golden_published": true, @@ -2559,6 +2512,19 @@ "work_dir_golden": "target/llm-runs/basics/t_006_delete/csharp/server/golden", "work_dir_llm": "target/llm-runs/basics/t_006_delete/csharp/server/gpt-5/llm", "scorer_details": { + "schema_parity": { + "pass": true, + "partial": 1.0, + "notes": { + "golden_db": "basics-t-006-delete-golden", + "llm_db": "basics-t-006-delete-gpt-5-llm", + "reducers_diff": null, + "reducers_equal": true, + "server": "http://127.0.0.1:44935", + "tables_diff": null, + "tables_equal": true + } + }, "seed_users_row": { "pass": true, "partial": 1.0, @@ -2574,34 +2540,21 @@ "expected": 0, "sql": "SELECT COUNT(*) AS n FROM User WHERE Id=1" } - }, - "schema_parity": { - "pass": true, - "partial": 1.0, - "notes": { - "golden_db": "basics-t-006-delete-golden", - "llm_db": "basics-t-006-delete-gpt-5-llm", - "reducers_diff": null, - "reducers_equal": true, - "server": "http://127.0.0.1:34379", - "tables_diff": null, - "tables_equal": true - } } }, "vendor": "openai", - "started_at": "2026-01-27T19:58:58.264033858Z", - "finished_at": "2026-01-27T19:59:39.007925686Z" + "started_at": "2026-01-26T19:37:37.167869929Z", + "finished_at": "2026-01-26T19:38:38.719937430Z" }, "t_007_crud": { - "hash": "e3621eaacfd5238fb514ff8c09c277ccd66170773959e5b391507110bf3ac17b", + "hash": "2f6071a69fd778167c45e20453bc018eebc468cc87681c455f819adfa10148a0", "task": "t_007_crud", "lang": "csharp", "golden_published": true, "model_name": "GPT-5", "total_tests": 4, "passed_tests": 4, - "llm_output": "using SpacetimeDB;\n\npublic static partial class Module\n{\n [SpacetimeDB.Table(Name = \"User\")]\n public partial struct User\n {\n [SpacetimeDB.PrimaryKey]\n public int Id;\n public string Name;\n public int Age;\n public bool Active;\n }\n\n [SpacetimeDB.Reducer]\n public static void Crud(ReducerContext ctx)\n {\n ctx.Db.User.Insert(new User { Id = 1, Name = \"Alice\", Age = 30, Active = true });\n ctx.Db.User.Insert(new User { Id = 2, Name = \"Bob\", Age = 22, Active = false });\n\n var found = ctx.Db.User.Id.Find(1);\n if (found is User user)\n {\n user.Name = \"Alice2\";\n user.Age = 31;\n user.Active = false;\n ctx.Db.User.Id.Update(user);\n }\n\n ctx.Db.User.Id.Delete(2);\n }\n}", + "llm_output": "using SpacetimeDB;\n\npublic static partial class Module\n{\n [SpacetimeDB.Table]\n public partial struct User\n {\n [SpacetimeDB.PrimaryKey]\n public int Id;\n public string Name;\n public int Age;\n public bool Active;\n }\n\n [SpacetimeDB.Reducer]\n public static void Crud(ReducerContext ctx)\n {\n ctx.Db.User.Insert(new User { Id = 1, Name = \"Alice\", Age = 30, Active = true });\n ctx.Db.User.Insert(new User { Id = 2, Name = \"Bob\", Age = 22, Active = false });\n\n if (ctx.Db.User.Id.Find(1) is User user1)\n {\n user1.Name = \"Alice2\";\n user1.Age = 31;\n user1.Active = false;\n ctx.Db.User.Id.Update(user1);\n }\n\n ctx.Db.User.Id.Delete(2);\n }\n}", "category": "basics", "route_api_model": "gpt-5", "golden_db": "basics-t-007-crud-golden", @@ -2609,6 +2562,15 @@ "work_dir_golden": "target/llm-runs/basics/t_007_crud/csharp/server/golden", "work_dir_llm": "target/llm-runs/basics/t_007_crud/csharp/server/gpt-5/llm", "scorer_details": { + "crud_total_count_one": { + "pass": true, + "partial": 1.0, + "notes": { + "actual": 1, + "expected": 1, + "sql": "SELECT COUNT(*) AS n FROM User" + } + }, "schema_parity": { "pass": true, "partial": 1.0, @@ -2617,18 +2579,18 @@ "llm_db": "basics-t-007-crud-gpt-5-llm", "reducers_diff": null, "reducers_equal": true, - "server": "http://127.0.0.1:34379", + "server": "http://127.0.0.1:44935", "tables_diff": null, "tables_equal": true } }, - "crud_total_count_one": { + "crud_row_id2_deleted": { "pass": true, "partial": 1.0, "notes": { - "actual": 1, - "expected": 1, - "sql": "SELECT COUNT(*) AS n FROM User" + "actual": 0, + "expected": 0, + "sql": "SELECT COUNT(*) AS n FROM User WHERE Id=2" } }, "crud_row_id2_deleted": { @@ -2651,23 +2613,23 @@ "llm_out": "Id | Name | Age | Active ----+----------+-----+-------- 1 | \"Alice2\" | 31 | false", "query": "SELECT Id, Name, Age, Active FROM User WHERE Id=1", "reducer": "Crud", - "server": "http://127.0.0.1:34379" + "server": "http://127.0.0.1:44935" } } }, "vendor": "openai", - "started_at": "2026-01-27T19:59:29.414134061Z", - "finished_at": "2026-01-27T20:00:06.267814536Z" + "started_at": "2026-01-26T19:37:59.027103288Z", + "finished_at": "2026-01-26T19:38:54.385590993Z" }, "t_008_index_lookup": { - "hash": "e3621eaacfd5238fb514ff8c09c277ccd66170773959e5b391507110bf3ac17b", + "hash": "2f6071a69fd778167c45e20453bc018eebc468cc87681c455f819adfa10148a0", "task": "t_008_index_lookup", "lang": "csharp", "golden_published": true, "model_name": "GPT-5", "total_tests": 3, "passed_tests": 3, - "llm_output": "using SpacetimeDB;\n\npublic static partial class Module\n{\n [SpacetimeDB.Table(Name = \"User\")]\n public partial class User\n {\n [SpacetimeDB.PrimaryKey]\n public int Id;\n public string Name;\n public int Age;\n public bool Active;\n }\n\n [SpacetimeDB.Table(Name = \"Result\")]\n public partial class Result\n {\n [SpacetimeDB.PrimaryKey]\n public int Id;\n public string Name;\n }\n\n [SpacetimeDB.Reducer]\n public static void LookupUserName(ReducerContext ctx, int id)\n {\n var user = ctx.Db.User.Id.Find(id);\n if (user != null)\n {\n ctx.Db.Result.Insert(new Result { Id = user.Id, Name = user.Name });\n }\n }\n}", + "llm_output": "using SpacetimeDB;\n\npublic static partial class Module\n{\n [SpacetimeDB.Table(Name = \"User\")]\n public partial struct User\n {\n [SpacetimeDB.PrimaryKey]\n public int Id;\n public string Name;\n public int Age;\n public bool Active;\n }\n\n [SpacetimeDB.Table(Name = \"Result\")]\n public partial struct Result\n {\n [SpacetimeDB.PrimaryKey]\n public int Id;\n public string Name;\n }\n\n [SpacetimeDB.Reducer]\n public static void LookupUserName(ReducerContext ctx, int id)\n {\n if (ctx.Db.User.Id.Find(id) is User user)\n {\n ctx.Db.Result.Insert(new Result\n {\n Id = user.Id,\n Name = user.Name\n });\n }\n }\n}", "category": "basics", "route_api_model": "gpt-5", "golden_db": "basics-t-008-index-lookup-golden", @@ -2675,22 +2637,6 @@ "work_dir_golden": "target/llm-runs/basics/t_008_index_lookup/csharp/server/golden", "work_dir_llm": "target/llm-runs/basics/t_008_index_lookup/csharp/server/gpt-5/llm", "scorer_details": { - "index_lookup_projection_parity": { - "pass": true, - "partial": 1.0, - "notes": { - "args": [ - 1 - ], - "golden_db": "basics-t-008-index-lookup-golden", - "golden_out": "Id | Name ----+--------- 1 | \"Alice\"", - "llm_db": "basics-t-008-index-lookup-gpt-5-llm", - "llm_out": "Id | Name ----+--------- 1 | \"Alice\"", - "query": "SELECT Id, Name FROM Result WHERE Id=1", - "reducer": "LookupUserName", - "server": "http://127.0.0.1:34379" - } - }, "schema_parity": { "pass": true, "partial": 1.0, @@ -2699,7 +2645,7 @@ "llm_db": "basics-t-008-index-lookup-gpt-5-llm", "reducers_diff": null, "reducers_equal": true, - "server": "http://127.0.0.1:34379", + "server": "http://127.0.0.1:44935", "tables_diff": null, "tables_equal": true } @@ -2710,14 +2656,30 @@ "notes": { "sql": "INSERT INTO User(Id, Name, Age, Active) VALUES (1, 'Alice', 30, true)" } + }, + "index_lookup_projection_parity": { + "pass": true, + "partial": 1.0, + "notes": { + "args": [ + 1 + ], + "golden_db": "basics-t-008-index-lookup-golden", + "golden_out": "Id | Name ----+--------- 1 | \"Alice\"", + "llm_db": "basics-t-008-index-lookup-gpt-5-llm", + "llm_out": "Id | Name ----+--------- 1 | \"Alice\"", + "query": "SELECT Id, Name FROM Result WHERE Id=1", + "reducer": "LookupUserName", + "server": "http://127.0.0.1:44935" + } } }, "vendor": "openai", - "started_at": "2026-01-27T20:00:17.332669093Z", - "finished_at": "2026-01-27T20:00:55.597420674Z" + "started_at": "2026-01-26T19:40:05.937447735Z", + "finished_at": "2026-01-26T19:41:10.697769188Z" }, "t_009_init": { - "hash": "e3621eaacfd5238fb514ff8c09c277ccd66170773959e5b391507110bf3ac17b", + "hash": "2f6071a69fd778167c45e20453bc018eebc468cc87681c455f819adfa10148a0", "task": "t_009_init", "lang": "csharp", "golden_published": true, @@ -2740,27 +2702,27 @@ "llm_db": "basics-t-009-init-gpt-5-llm", "reducers_diff": null, "reducers_equal": true, - "server": "http://127.0.0.1:34379", + "server": "http://127.0.0.1:44935", "tables_diff": null, "tables_equal": true } }, - "init_seed_bob": { + "init_seed_alice": { "pass": true, "partial": 1.0, "notes": { "actual": 1, "expected": 1, - "sql": "SELECT COUNT(*) AS n FROM User WHERE Id=2 AND Name='Bob' AND Age=22 AND Active=false" + "sql": "SELECT COUNT(*) AS n FROM User WHERE Id=1 AND Name='Alice' AND Age=30 AND Active=true" } }, - "init_seed_alice": { + "init_seed_bob": { "pass": true, "partial": 1.0, "notes": { "actual": 1, "expected": 1, - "sql": "SELECT COUNT(*) AS n FROM User WHERE Id=1 AND Name='Alice' AND Age=30 AND Active=true" + "sql": "SELECT COUNT(*) AS n FROM User WHERE Id=2 AND Name='Bob' AND Age=22 AND Active=false" } }, "init_total_two": { @@ -2774,18 +2736,18 @@ } }, "vendor": "openai", - "started_at": "2026-01-27T19:59:39.007990909Z", - "finished_at": "2026-01-27T20:00:10.594272918Z" + "started_at": "2026-01-26T19:38:16.753424300Z", + "finished_at": "2026-01-26T19:39:06.588120002Z" }, "t_010_connect": { - "hash": "e3621eaacfd5238fb514ff8c09c277ccd66170773959e5b391507110bf3ac17b", + "hash": "2f6071a69fd778167c45e20453bc018eebc468cc87681c455f819adfa10148a0", "task": "t_010_connect", "lang": "csharp", "golden_published": true, "model_name": "GPT-5", "total_tests": 1, "passed_tests": 1, - "llm_output": "using SpacetimeDB;\n\npublic static partial class Module\n{\n [SpacetimeDB.Table(Name = \"Event\")]\n public partial struct Event\n {\n [SpacetimeDB.PrimaryKey]\n [SpacetimeDB.AutoInc]\n public int Id;\n public string Kind;\n }\n\n [SpacetimeDB.Reducer(ReducerKind.ClientConnected)]\n public static void ClientConnected(ReducerContext ctx)\n {\n ctx.Db.Event.Insert(new Event { Id = 0, Kind = \"connected\" });\n }\n\n [SpacetimeDB.Reducer(ReducerKind.ClientDisconnected)]\n public static void ClientDisconnected(ReducerContext ctx)\n {\n ctx.Db.Event.Insert(new Event { Id = 0, Kind = \"disconnected\" });\n }\n}", + "llm_output": "using SpacetimeDB;\n\npublic static partial class Module\n{\n [SpacetimeDB.Table(Name = \"Event\", Public = true)]\n public partial struct Event\n {\n [SpacetimeDB.PrimaryKey]\n [SpacetimeDB.AutoInc]\n public int Id;\n public string Kind;\n }\n\n [SpacetimeDB.Reducer(ReducerKind.ClientConnected)]\n public static void ClientConnected(ReducerContext ctx)\n {\n ctx.Db.Event.Insert(new Event { Id = 0, Kind = \"connected\" });\n }\n\n [SpacetimeDB.Reducer(ReducerKind.ClientDisconnected)]\n public static void ClientDisconnected(ReducerContext ctx)\n {\n ctx.Db.Event.Insert(new Event { Id = 0, Kind = \"disconnected\" });\n }\n}", "category": "basics", "route_api_model": "gpt-5", "golden_db": "basics-t-010-connect-golden", @@ -2801,25 +2763,25 @@ "llm_db": "basics-t-010-connect-gpt-5-llm", "reducers_diff": null, "reducers_equal": true, - "server": "http://127.0.0.1:34379", + "server": "http://127.0.0.1:44935", "tables_diff": null, "tables_equal": true } } }, "vendor": "openai", - "started_at": "2026-01-27T19:59:08.068058110Z", - "finished_at": "2026-01-27T19:59:45.341706421Z" + "started_at": "2026-01-26T19:37:47.380111761Z", + "finished_at": "2026-01-26T19:39:03.248030401Z" }, "t_011_helper_function": { - "hash": "e3621eaacfd5238fb514ff8c09c277ccd66170773959e5b391507110bf3ac17b", + "hash": "2f6071a69fd778167c45e20453bc018eebc468cc87681c455f819adfa10148a0", "task": "t_011_helper_function", "lang": "csharp", "golden_published": true, "model_name": "GPT-5", "total_tests": 3, "passed_tests": 3, - "llm_output": "using SpacetimeDB;\n\npublic static partial class Module\n{\n [SpacetimeDB.Table(Name = \"Result\")]\n public partial struct Result\n {\n [SpacetimeDB.PrimaryKey]\n public int Id;\n public int Sum;\n }\n\n public static int Add(int a, int b)\n {\n return a + b;\n }\n\n [SpacetimeDB.Reducer]\n public static void ComputeSum(ReducerContext ctx, int id, int a, int b)\n {\n ctx.Db.Result.Insert(new Result\n {\n Id = id,\n Sum = Add(a, b),\n });\n }\n}", + "llm_output": "using SpacetimeDB;\n\npublic static partial class Module\n{\n [SpacetimeDB.Table(Name = \"Result\")]\n public partial struct Result\n {\n [SpacetimeDB.PrimaryKey]\n public int Id;\n public int Sum;\n }\n\n private static int Add(int a, int b)\n {\n return a + b;\n }\n\n [SpacetimeDB.Reducer]\n public static void ComputeSum(ReducerContext ctx, int id, int a, int b)\n {\n ctx.Db.Result.Insert(new Result\n {\n Id = id,\n Sum = Add(a, b)\n });\n }\n}", "category": "basics", "route_api_model": "gpt-5", "golden_db": "basics-t-011-helper-function-golden", @@ -2836,6 +2798,19 @@ "sql": "SELECT COUNT(*) AS n FROM Result WHERE Id=1 AND Sum=5" } }, + "schema_parity": { + "pass": true, + "partial": 1.0, + "notes": { + "golden_db": "basics-t-011-helper-function-golden", + "llm_db": "basics-t-011-helper-function-gpt-5-llm", + "reducers_diff": null, + "reducers_equal": true, + "server": "http://127.0.0.1:44935", + "tables_diff": null, + "tables_equal": true + } + }, "helper_func_sum_parity": { "pass": true, "partial": 1.0, @@ -2851,36 +2826,23 @@ "llm_out": "Id | Sum ----+----- 1 | 5", "query": "SELECT Id, Sum FROM Result WHERE Id=1", "reducer": "ComputeSum", - "server": "http://127.0.0.1:34379" - } - }, - "schema_parity": { - "pass": true, - "partial": 1.0, - "notes": { - "golden_db": "basics-t-011-helper-function-golden", - "llm_db": "basics-t-011-helper-function-gpt-5-llm", - "reducers_diff": null, - "reducers_equal": true, - "server": "http://127.0.0.1:34379", - "tables_diff": null, - "tables_equal": true + "server": "http://127.0.0.1:44935" } } }, "vendor": "openai", - "started_at": "2026-01-27T20:00:37.824007777Z", - "finished_at": "2026-01-27T20:01:12.698364118Z" + "started_at": "2026-01-26T19:40:22.292081947Z", + "finished_at": "2026-01-26T19:41:08.915943296Z" }, "t_012_spacetime_product_type": { - "hash": "e3621eaacfd5238fb514ff8c09c277ccd66170773959e5b391507110bf3ac17b", + "hash": "2f6071a69fd778167c45e20453bc018eebc468cc87681c455f819adfa10148a0", "task": "t_012_spacetime_product_type", "lang": "csharp", "golden_published": true, "model_name": "GPT-5", "total_tests": 3, "passed_tests": 3, - "llm_output": "using SpacetimeDB;\n\npublic static partial class Module\n{\n [SpacetimeDB.Type]\n public partial struct Score\n {\n public int Left;\n public int Right;\n }\n\n [SpacetimeDB.Table(Name = \"Result\", Public = true)]\n public partial struct Result\n {\n [SpacetimeDB.PrimaryKey]\n public int Id;\n public Score Value;\n }\n\n [SpacetimeDB.Reducer]\n public static void SetScore(ReducerContext ctx, int id, int left, int right)\n {\n ctx.Db.Result.Insert(new Result\n {\n Id = id,\n Value = new Score { Left = left, Right = right }\n });\n }\n}", + "llm_output": "using SpacetimeDB;\n\npublic static partial class Module\n{\n [SpacetimeDB.Type]\n public partial struct Score\n {\n public int Left;\n public int Right;\n }\n\n [SpacetimeDB.Table(Name = \"Result\", Public = true)]\n public partial struct Result\n {\n [SpacetimeDB.PrimaryKey]\n public int Id;\n public Score Value;\n }\n\n [SpacetimeDB.Reducer]\n public static void SetScore(ReducerContext ctx, int id, int left, int right)\n {\n ctx.Db.Result.Insert(new Result\n {\n Id = id,\n Value = new Score\n {\n Left = left,\n Right = right\n }\n });\n }\n}", "category": "schema", "route_api_model": "gpt-5", "golden_db": "schema-t-012-spacetime-product-type-golden", @@ -2903,7 +2865,16 @@ "llm_out": "Id | Value ----+----------------------- 1 | (Left = 2, Right = 3)", "query": "SELECT Id, Value FROM Result WHERE Id=1", "reducer": "SetScore", - "server": "http://127.0.0.1:34379" + "server": "http://127.0.0.1:44935" + } + }, + "product_type_row_count": { + "pass": true, + "partial": 1.0, + "notes": { + "actual": 1, + "expected": 1, + "sql": "SELECT COUNT(*) AS n FROM Result WHERE Id=1" } }, "schema_parity": { @@ -2914,34 +2885,25 @@ "llm_db": "schema-t-012-spacetime-product-type-gpt-5-llm", "reducers_diff": null, "reducers_equal": true, - "server": "http://127.0.0.1:34379", + "server": "http://127.0.0.1:44935", "tables_diff": null, "tables_equal": true } - }, - "product_type_row_count": { - "pass": true, - "partial": 1.0, - "notes": { - "actual": 1, - "expected": 1, - "sql": "SELECT COUNT(*) AS n FROM Result WHERE Id=1" - } } }, "vendor": "openai", - "started_at": "2026-01-27T19:58:50.225754898Z", - "finished_at": "2026-01-27T19:59:29.413988946Z" + "started_at": "2026-01-26T19:37:30.236090594Z", + "finished_at": "2026-01-26T19:38:16.753346626Z" }, "t_013_spacetime_sum_type": { - "hash": "e3621eaacfd5238fb514ff8c09c277ccd66170773959e5b391507110bf3ac17b", + "hash": "2f6071a69fd778167c45e20453bc018eebc468cc87681c455f819adfa10148a0", "task": "t_013_spacetime_sum_type", "lang": "csharp", "golden_published": true, "model_name": "GPT-5", "total_tests": 3, "passed_tests": 3, - "llm_output": "using SpacetimeDB;\n\npublic static partial class Module\n{\n [SpacetimeDB.Type]\n public partial struct Circle\n {\n public int Radius;\n }\n\n [SpacetimeDB.Type]\n public partial struct Rectangle\n {\n public int Width;\n public int Height;\n }\n\n [SpacetimeDB.Type]\n public partial record Shape : TaggedEnum<(Circle Circle, Rectangle Rectangle)> { }\n\n [SpacetimeDB.Table(Name = \"Result\")]\n public partial struct Result\n {\n [SpacetimeDB.PrimaryKey]\n public int Id;\n public Shape Value;\n }\n\n [SpacetimeDB.Reducer]\n public static void SetCircle(ReducerContext ctx, int id, int radius)\n {\n ctx.Db.Result.Insert(new Result\n {\n Id = id,\n Value = new Shape.Circle(new Circle { Radius = radius })\n });\n }\n}", + "llm_output": "using SpacetimeDB;\n\npublic static partial class Module\n{\n [SpacetimeDB.Type]\n public partial struct Circle\n {\n public int Radius;\n }\n\n [SpacetimeDB.Type]\n public partial struct Rectangle\n {\n public int Width;\n public int Height;\n }\n\n [SpacetimeDB.Type]\n public partial record Shape : TaggedEnum<(Circle Circle, Rectangle Rectangle)> { }\n\n [SpacetimeDB.Table(Name = \"Result\", Public = true)]\n public partial struct Result\n {\n [SpacetimeDB.PrimaryKey]\n public int Id;\n public Shape Value;\n }\n\n [SpacetimeDB.Reducer]\n public static void SetCircle(ReducerContext ctx, int id, int radius)\n {\n var shape = new Shape.Circle(new Circle { Radius = radius });\n ctx.Db.Result.Insert(new Result\n {\n Id = id,\n Value = shape\n });\n }\n}", "category": "schema", "route_api_model": "gpt-5", "golden_db": "schema-t-013-spacetime-sum-type-golden", @@ -2949,17 +2911,21 @@ "work_dir_golden": "target/llm-runs/schema/t_013_spacetime_sum_type/csharp/server/golden", "work_dir_llm": "target/llm-runs/schema/t_013_spacetime_sum_type/csharp/server/gpt-5/llm", "scorer_details": { - "schema_parity": { + "sum_type_row_parity": { "pass": true, "partial": 1.0, "notes": { + "args": [ + 1, + 10 + ], "golden_db": "schema-t-013-spacetime-sum-type-golden", + "golden_out": "Id | Value ----+-------------------------- 1 | (Circle = (Radius = 10))", "llm_db": "schema-t-013-spacetime-sum-type-gpt-5-llm", - "reducers_diff": null, - "reducers_equal": true, - "server": "http://127.0.0.1:34379", - "tables_diff": null, - "tables_equal": true + "llm_out": "Id | Value ----+-------------------------- 1 | (Circle = (Radius = 10))", + "query": "SELECT Id, Value FROM Result WHERE Id=1", + "reducer": "SetCircle", + "server": "http://127.0.0.1:44935" } }, "sum_type_row_count": { @@ -2971,30 +2937,26 @@ "sql": "SELECT COUNT(*) AS n FROM Result WHERE Id=1" } }, - "sum_type_row_parity": { + "schema_parity": { "pass": true, "partial": 1.0, "notes": { - "args": [ - 1, - 10 - ], "golden_db": "schema-t-013-spacetime-sum-type-golden", - "golden_out": "Id | Value ----+-------------------------- 1 | (Circle = (Radius = 10))", "llm_db": "schema-t-013-spacetime-sum-type-gpt-5-llm", - "llm_out": "Id | Value ----+-------------------------- 1 | (Circle = (Radius = 10))", - "query": "SELECT Id, Value FROM Result WHERE Id=1", - "reducer": "SetCircle", - "server": "http://127.0.0.1:34379" + "reducers_diff": null, + "reducers_equal": true, + "server": "http://127.0.0.1:44935", + "tables_diff": null, + "tables_equal": true } } }, "vendor": "openai", - "started_at": "2026-01-27T19:57:55.737450825Z", - "finished_at": "2026-01-27T19:58:46.370198569Z" + "started_at": "2026-01-26T19:35:59.196578278Z", + "finished_at": "2026-01-26T19:37:03.535790946Z" }, "t_014_elementary_columns": { - "hash": "e3621eaacfd5238fb514ff8c09c277ccd66170773959e5b391507110bf3ac17b", + "hash": "2f6071a69fd778167c45e20453bc018eebc468cc87681c455f819adfa10148a0", "task": "t_014_elementary_columns", "lang": "csharp", "golden_published": true, @@ -3009,6 +2971,14 @@ "work_dir_golden": "target/llm-runs/schema/t_014_elementary_columns/csharp/server/golden", "work_dir_llm": "target/llm-runs/schema/t_014_elementary_columns/csharp/server/gpt-5/llm", "scorer_details": { + "elementary_columns_row_parity": { + "pass": false, + "partial": 0.0, + "notes": { + "error": "spacetime sql failed:\nWARNING: This command is UNSTABLE and subject to breaking changes.\n\nError: no such table: `primitive`. If the table exists, it may be marked private.\n\nCaused by:\n HTTP status client error (400 Bad Request) for url (http://127.0.0.1:44935/v1/database/c2000e37e733499f47b57d9f488477b94fccf2e4c5c6c32182171721cbaba64a/sql)\n", + "phase": "sql_golden" + } + }, "schema_parity": { "pass": true, "partial": 1.0, @@ -3017,7 +2987,7 @@ "llm_db": "schema-t-014-elementary-columns-gpt-5-llm", "reducers_diff": null, "reducers_equal": true, - "server": "http://127.0.0.1:34379", + "server": "http://127.0.0.1:44935", "tables_diff": null, "tables_equal": true } @@ -3026,32 +2996,24 @@ "pass": false, "partial": 0.0, "notes": { - "error": "spacetime sql failed:\nWARNING: This command is UNSTABLE and subject to breaking changes.\n\nError: no such table: `primitive`. If the table exists, it may be marked private.\n\nCaused by:\n HTTP status client error (400 Bad Request) for url (http://127.0.0.1:34379/v1/database/c2006db3efe118f9e2be4d0996245799216709f62c09af27307321501d4ca96f/sql)\n", + "error": "spacetime sql failed:\nWARNING: This command is UNSTABLE and subject to breaking changes.\n\nError: no such table: `primitive`. If the table exists, it may be marked private.\n\nCaused by:\n HTTP status client error (400 Bad Request) for url (http://127.0.0.1:44935/v1/database/c200e70d6c47b9f5b97a9584014efb7008b4c312687bfdbfe1b0ee1891420453/sql)\n", "phase": "sql" } - }, - "elementary_columns_row_parity": { - "pass": false, - "partial": 0.0, - "notes": { - "error": "spacetime sql failed:\nWARNING: This command is UNSTABLE and subject to breaking changes.\n\nError: no such table: `primitive`. If the table exists, it may be marked private.\n\nCaused by:\n HTTP status client error (400 Bad Request) for url (http://127.0.0.1:34379/v1/database/c2008bda321ec5b24f06db6690e57eaa2c1b3a9bada2318accf99feb7910837d/sql)\n", - "phase": "sql_golden" - } } }, "vendor": "openai", - "started_at": "2026-01-27T19:58:46.370277696Z", - "finished_at": "2026-01-27T19:59:43.681502253Z" + "started_at": "2026-01-26T19:37:03.535862900Z", + "finished_at": "2026-01-26T19:37:59.026960569Z" }, "t_015_product_type_columns": { - "hash": "e3621eaacfd5238fb514ff8c09c277ccd66170773959e5b391507110bf3ac17b", + "hash": "2f6071a69fd778167c45e20453bc018eebc468cc87681c455f819adfa10148a0", "task": "t_015_product_type_columns", "lang": "csharp", "golden_published": true, "model_name": "GPT-5", "total_tests": 3, "passed_tests": 3, - "llm_output": "using SpacetimeDB;\n\npublic static partial class Module\n{\n [SpacetimeDB.Type]\n public partial struct Address\n {\n public string Street;\n public int Zip;\n }\n\n [SpacetimeDB.Type]\n public partial struct Position\n {\n public int X;\n public int Y;\n }\n\n [SpacetimeDB.Table(Name = \"Profile\", Public = true)]\n public partial struct Profile\n {\n [SpacetimeDB.PrimaryKey]\n public int Id;\n public Address Home;\n public Address Work;\n public Position Pos;\n }\n\n [SpacetimeDB.Reducer]\n public static void Seed(ReducerContext ctx)\n {\n if (ctx.Db.Profile.Id.Find(1) == null)\n {\n ctx.Db.Profile.Insert(new Profile\n {\n Id = 1,\n Home = new Address { Street = \"1 Main\", Zip = 11111 },\n Work = new Address { Street = \"2 Broad\", Zip = 22222 },\n Pos = new Position { X = 7, Y = 9 },\n });\n }\n }\n}", + "llm_output": "using SpacetimeDB;\n\npublic static partial class Module\n{\n [SpacetimeDB.Type]\n public partial struct Address\n {\n public string Street;\n public int Zip;\n }\n\n [SpacetimeDB.Type]\n public partial struct Position\n {\n public int X;\n public int Y;\n }\n\n [SpacetimeDB.Table(Name = \"Profile\", Public = true)]\n public partial struct Profile\n {\n [SpacetimeDB.PrimaryKey]\n public int Id;\n public Address Home;\n public Address Work;\n public Position Pos;\n }\n\n [SpacetimeDB.Reducer]\n public static void Seed(ReducerContext ctx)\n {\n ctx.Db.Profile.Insert(new Profile\n {\n Id = 1,\n Home = new Address { Street = \"1 Main\", Zip = 11111 },\n Work = new Address { Street = \"2 Broad\", Zip = 22222 },\n Pos = new Position { X = 7, Y = 9 }\n });\n }\n}", "category": "schema", "route_api_model": "gpt-5", "golden_db": "schema-t-015-product-type-columns-golden", @@ -3067,11 +3029,20 @@ "llm_db": "schema-t-015-product-type-columns-gpt-5-llm", "reducers_diff": null, "reducers_equal": true, - "server": "http://127.0.0.1:34379", + "server": "http://127.0.0.1:44935", "tables_diff": null, "tables_equal": true } }, + "product_type_columns_row_count": { + "pass": true, + "partial": 1.0, + "notes": { + "actual": 1, + "expected": 1, + "sql": "SELECT COUNT(*) AS n FROM Profile WHERE Id=1" + } + }, "product_type_columns_row_parity": { "pass": true, "partial": 1.0, @@ -3083,82 +3054,52 @@ "llm_out": "Id | Home | Work | Pos ----+----------------------------------+-----------------------------------+---------------- 1 | (Street = \"1 Main\", Zip = 11111) | (Street = \"2 Broad\", Zip = 22222) | (X = 7, Y = 9)", "query": "SELECT Id, Home, Work, Pos FROM Profile WHERE Id=1", "reducer": "Seed", - "server": "http://127.0.0.1:34379" - } - }, - "product_type_columns_row_count": { - "pass": true, - "partial": 1.0, - "notes": { - "actual": 1, - "expected": 1, - "sql": "SELECT COUNT(*) AS n FROM Profile WHERE Id=1" + "server": "http://127.0.0.1:44935" } } }, "vendor": "openai", - "started_at": "2026-01-27T19:58:04.285909374Z", - "finished_at": "2026-01-27T19:58:50.225511855Z" + "started_at": "2026-01-26T19:36:38.953458698Z", + "finished_at": "2026-01-26T19:37:30.236009816Z" }, "t_016_sum_type_columns": { - "hash": "e3621eaacfd5238fb514ff8c09c277ccd66170773959e5b391507110bf3ac17b", + "hash": "2f6071a69fd778167c45e20453bc018eebc468cc87681c455f819adfa10148a0", "task": "t_016_sum_type_columns", "lang": "csharp", - "golden_published": true, + "golden_published": false, "model_name": "GPT-5", - "total_tests": 3, - "passed_tests": 1, - "llm_output": "using SpacetimeDB;\n\npublic static partial class Module\n{\n [SpacetimeDB.Type]\n public partial struct Circle\n {\n public int Radius;\n }\n\n [SpacetimeDB.Type]\n public partial struct Rectangle\n {\n public int Width;\n public int Height;\n }\n\n [SpacetimeDB.Type]\n public partial record Shape : TaggedEnum<(Circle Circle, Rectangle Rectangle)> { }\n\n [SpacetimeDB.Table(Name = \"Drawing\")]\n public partial struct Drawing\n {\n [SpacetimeDB.PrimaryKey]\n public int Id;\n public Shape A;\n public Shape B;\n }\n\n [SpacetimeDB.Reducer]\n public static void Seed(ReducerContext ctx)\n {\n ctx.Db.Drawing.Insert(new Drawing\n {\n Id = 1,\n A = new Shape.Circle(new Circle { Radius = 10 }),\n B = new Shape.Rectangle(new Rectangle { Width = 4, Height = 6 })\n });\n }\n}", + "total_tests": 1, + "passed_tests": 0, + "llm_output": null, "category": "schema", "route_api_model": "gpt-5", - "golden_db": "schema-t-016-sum-type-columns-golden", - "llm_db": "schema-t-016-sum-type-columns-gpt-5-llm", - "work_dir_golden": "target/llm-runs/schema/t_016_sum_type_columns/csharp/server/golden", - "work_dir_llm": "target/llm-runs/schema/t_016_sum_type_columns/csharp/server/gpt-5/llm", + "golden_db": null, + "llm_db": null, + "work_dir_golden": null, + "work_dir_llm": null, "scorer_details": { - "sum_type_columns_row_count": { - "pass": false, - "partial": 0.0, - "notes": { - "error": "spacetime sql failed:\nWARNING: This command is UNSTABLE and subject to breaking changes.\n\nError: no such table: `drawings`. If the table exists, it may be marked private.\n\nCaused by:\n HTTP status client error (400 Bad Request) for url (http://127.0.0.1:34379/v1/database/c200a38bd5eaec739ca1bb5f49423cf455fb484e997f330a37dbe10a2f09faac/sql)\n", - "phase": "sql" - } - }, - "schema_parity": { - "pass": true, - "partial": 1.0, - "notes": { - "golden_db": "schema-t-016-sum-type-columns-golden", - "llm_db": "schema-t-016-sum-type-columns-gpt-5-llm", - "reducers_diff": null, - "reducers_equal": true, - "server": "http://127.0.0.1:34379", - "tables_diff": null, - "tables_equal": true - } - }, - "sum_type_columns_row_parity": { + "publish_error": { "pass": false, "partial": 0.0, "notes": { - "error": "spacetime sql failed:\nWARNING: This command is UNSTABLE and subject to breaking changes.\n\nError: no such table: `drawings`. If the table exists, it may be marked private.\n\nCaused by:\n HTTP status client error (400 Bad Request) for url (http://127.0.0.1:34379/v1/database/c20028da21a53491f84d8895dbcf4906c6c844846426c39ae32b5fd1689a2641/sql)\n", - "phase": "sql_golden" + "error": "LLM call timed out", + "phase": "build_or_publish" } } }, "vendor": "openai", - "started_at": "2026-01-27T19:57:09.422528630Z", - "finished_at": "2026-01-27T19:58:04.281919840Z" + "started_at": "2026-01-26T19:41:35.359543125Z", + "finished_at": "2026-01-26T19:41:35.359543125Z" }, "t_017_scheduled_columns": { - "hash": "e3621eaacfd5238fb514ff8c09c277ccd66170773959e5b391507110bf3ac17b", + "hash": "2f6071a69fd778167c45e20453bc018eebc468cc87681c455f819adfa10148a0", "task": "t_017_scheduled_columns", "lang": "csharp", "golden_published": true, "model_name": "GPT-5", "total_tests": 2, "passed_tests": 1, - "llm_output": "using System;\nusing SpacetimeDB;\n\npublic static partial class Module\n{\n [SpacetimeDB.Table(Name = \"TickTimer\", Scheduled = nameof(Tick), ScheduledAt = nameof(ScheduledAt))]\n public partial struct TickTimer\n {\n [SpacetimeDB.PrimaryKey]\n [SpacetimeDB.AutoInc]\n public ulong ScheduledId;\n public ScheduleAt ScheduledAt;\n }\n\n [SpacetimeDB.Reducer]\n public static void Tick(ReducerContext ctx, TickTimer _timer)\n {\n }\n\n [SpacetimeDB.Reducer(ReducerKind.Init)]\n public static void Init(ReducerContext ctx)\n {\n ctx.Db.TickTimer.Insert(new TickTimer\n {\n ScheduledAt = new ScheduleAt.Interval(TimeSpan.FromMilliseconds(50))\n });\n }\n}", + "llm_output": "using SpacetimeDB;\n\npublic static partial class Module\n{\n [SpacetimeDB.Table(Name = \"TickTimer\", Scheduled = nameof(Tick), ScheduledAt = nameof(ScheduledAt))]\n public partial struct TickTimer\n {\n [SpacetimeDB.PrimaryKey]\n [SpacetimeDB.AutoInc]\n public ulong ScheduledId;\n public ScheduleAt ScheduledAt;\n }\n\n [SpacetimeDB.Reducer]\n public static void Tick(ReducerContext ctx, TickTimer _timer)\n {\n }\n\n [SpacetimeDB.Reducer(ReducerKind.Init)]\n public static void Init(ReducerContext ctx)\n {\n ctx.Db.TickTimer.Insert(new TickTimer\n {\n ScheduledAt = new ScheduleAt.Interval(TimeSpan.FromMicroseconds(50_000))\n });\n }\n}", "category": "schema", "route_api_model": "gpt-5", "golden_db": "schema-t-017-scheduled-columns-golden", @@ -3166,14 +3107,6 @@ "work_dir_golden": "target/llm-runs/schema/t_017_scheduled_columns/csharp/server/golden", "work_dir_llm": "target/llm-runs/schema/t_017_scheduled_columns/csharp/server/gpt-5/llm", "scorer_details": { - "scheduled_seeded_one_row": { - "pass": false, - "partial": 0.0, - "notes": { - "error": "spacetime sql failed:\nWARNING: This command is UNSTABLE and subject to breaking changes.\n\nError: no such table: `tick_timer`. If the table exists, it may be marked private.\n\nCaused by:\n HTTP status client error (400 Bad Request) for url (http://127.0.0.1:34379/v1/database/c200bf2221f01a62dfa1acb5a397b4271a57cfc2f171562204bb3bcee2259214/sql)\n", - "phase": "sql" - } - }, "schema_parity": { "pass": true, "partial": 1.0, @@ -3182,25 +3115,33 @@ "llm_db": "schema-t-017-scheduled-columns-gpt-5-llm", "reducers_diff": null, "reducers_equal": true, - "server": "http://127.0.0.1:34379", + "server": "http://127.0.0.1:44935", "tables_diff": null, "tables_equal": true } + }, + "scheduled_seeded_one_row": { + "pass": false, + "partial": 0.0, + "notes": { + "error": "spacetime sql failed:\nWARNING: This command is UNSTABLE and subject to breaking changes.\n\nError: no such table: `tick_timer`. If the table exists, it may be marked private.\n\nCaused by:\n HTTP status client error (400 Bad Request) for url (http://127.0.0.1:44935/v1/database/c2004563b2a3af718eb5a6d78c0e16523a6ad57949ac9dd820dbc2c2e11c8842/sql)\n", + "phase": "sql" + } } }, "vendor": "openai", - "started_at": "2026-01-27T19:57:09.413847953Z", - "finished_at": "2026-01-27T19:57:55.737395054Z" + "started_at": "2026-01-26T19:35:08.495907944Z", + "finished_at": "2026-01-26T19:36:38.949408263Z" }, "t_018_constraints": { - "hash": "e3621eaacfd5238fb514ff8c09c277ccd66170773959e5b391507110bf3ac17b", + "hash": "2f6071a69fd778167c45e20453bc018eebc468cc87681c455f819adfa10148a0", "task": "t_018_constraints", "lang": "csharp", "golden_published": true, "model_name": "GPT-5", "total_tests": 3, "passed_tests": 3, - "llm_output": "using SpacetimeDB;\n\npublic static partial class Module\n{\n [SpacetimeDB.Table(Name = \"Account\", Public = true)]\n public partial struct Account\n {\n [SpacetimeDB.PrimaryKey]\n public int Id;\n\n [SpacetimeDB.Unique]\n public string Email;\n\n [SpacetimeDB.Index.BTree(Name = \"by_name\")]\n public string Name;\n }\n\n [SpacetimeDB.Reducer]\n public static void Seed(ReducerContext ctx)\n {\n ctx.Db.Account.Insert(new Account { Id = 1, Email = \"a@example.com\", Name = \"Alice\" });\n ctx.Db.Account.Insert(new Account { Id = 2, Email = \"b@example.com\", Name = \"Bob\" });\n }\n}", + "llm_output": "using SpacetimeDB;\n\npublic static partial class Module\n{\n [SpacetimeDB.Table(Name = \"Account\", Public = true)]\n [SpacetimeDB.Index.BTree(Name = \"by_name\", Columns = new[] { \"Name\" })]\n public partial struct Account\n {\n [SpacetimeDB.PrimaryKey]\n public int Id;\n [SpacetimeDB.Unique]\n public string Email;\n public string Name;\n }\n\n [SpacetimeDB.Reducer]\n public static void Seed(ReducerContext ctx)\n {\n ctx.Db.Account.Insert(new Account { Id = 1, Email = \"a@example.com\", Name = \"Alice\" });\n ctx.Db.Account.Insert(new Account { Id = 2, Email = \"b@example.com\", Name = \"Bob\" });\n }\n}", "category": "schema", "route_api_model": "gpt-5", "golden_db": "schema-t-018-constraints-golden", @@ -3208,20 +3149,6 @@ "work_dir_golden": "target/llm-runs/schema/t_018_constraints/csharp/server/golden", "work_dir_llm": "target/llm-runs/schema/t_018_constraints/csharp/server/gpt-5/llm", "scorer_details": { - "constraints_row_parity_after_seed": { - "pass": true, - "partial": 1.0, - "notes": { - "args": [], - "golden_db": "schema-t-018-constraints-golden", - "golden_out": "Id | Email | Name ----+-----------------+--------- 1 | \"a@example.com\" | \"Alice\"", - "llm_db": "schema-t-018-constraints-gpt-5-llm", - "llm_out": "Id | Email | Name ----+-----------------+--------- 1 | \"a@example.com\" | \"Alice\"", - "query": "SELECT Id, Email, Name FROM Account WHERE Id=1", - "reducer": "Seed", - "server": "http://127.0.0.1:34379" - } - }, "constraints_seed_two_rows": { "pass": true, "partial": 1.0, @@ -3239,25 +3166,39 @@ "llm_db": "schema-t-018-constraints-gpt-5-llm", "reducers_diff": null, "reducers_equal": true, - "server": "http://127.0.0.1:34379", + "server": "http://127.0.0.1:44935", "tables_diff": null, "tables_equal": true } + }, + "constraints_row_parity_after_seed": { + "pass": true, + "partial": 1.0, + "notes": { + "args": [], + "golden_db": "schema-t-018-constraints-golden", + "golden_out": "Id | Email | Name ----+-----------------+--------- 1 | \"a@example.com\" | \"Alice\"", + "llm_db": "schema-t-018-constraints-gpt-5-llm", + "llm_out": "Id | Email | Name ----+-----------------+--------- 1 | \"a@example.com\" | \"Alice\"", + "query": "SELECT Id, Email, Name FROM Account WHERE Id=1", + "reducer": "Seed", + "server": "http://127.0.0.1:44935" + } } }, "vendor": "openai", - "started_at": "2026-01-27T19:57:09.410769526Z", - "finished_at": "2026-01-27T19:58:03.584746288Z" + "started_at": "2026-01-26T19:35:08.491947971Z", + "finished_at": "2026-01-26T19:35:59.196533076Z" }, "t_019_many_to_many": { - "hash": "e3621eaacfd5238fb514ff8c09c277ccd66170773959e5b391507110bf3ac17b", + "hash": "2f6071a69fd778167c45e20453bc018eebc468cc87681c455f819adfa10148a0", "task": "t_019_many_to_many", "lang": "csharp", "golden_published": true, "model_name": "GPT-5", "total_tests": 5, "passed_tests": 5, - "llm_output": "using SpacetimeDB;\n\npublic static partial class Module\n{\n [SpacetimeDB.Table(Name = \"User\")]\n public partial struct User\n {\n [SpacetimeDB.PrimaryKey]\n public int UserId;\n public string Name;\n }\n\n [SpacetimeDB.Table(Name = \"Group\")]\n public partial struct Group\n {\n [SpacetimeDB.PrimaryKey]\n public int GroupId;\n public string Title;\n }\n\n [SpacetimeDB.Table(Name = \"Membership\")]\n [SpacetimeDB.Index.BTree(Name = \"by_user\", Columns = new[] { \"UserId\" })]\n [SpacetimeDB.Index.BTree(Name = \"by_group\", Columns = new[] { \"GroupId\" })]\n public partial struct Membership\n {\n [SpacetimeDB.PrimaryKey]\n public int Id;\n public int UserId;\n public int GroupId;\n }\n\n [SpacetimeDB.Reducer]\n public static void Seed(ReducerContext ctx)\n {\n foreach (var m in ctx.Db.Membership.Iter())\n {\n ctx.Db.Membership.Id.Delete(m.Id);\n }\n\n foreach (var g in ctx.Db.Group.Iter())\n {\n ctx.Db.Group.GroupId.Delete(g.GroupId);\n }\n\n foreach (var u in ctx.Db.User.Iter())\n {\n ctx.Db.User.UserId.Delete(u.UserId);\n }\n\n ctx.Db.User.Insert(new User { UserId = 1, Name = \"Alice\" });\n ctx.Db.User.Insert(new User { UserId = 2, Name = \"Bob\" });\n\n ctx.Db.Group.Insert(new Group { GroupId = 10, Title = \"Admin\" });\n ctx.Db.Group.Insert(new Group { GroupId = 20, Title = \"Dev\" });\n\n ctx.Db.Membership.Insert(new Membership { Id = 1, UserId = 1, GroupId = 10 });\n ctx.Db.Membership.Insert(new Membership { Id = 2, UserId = 1, GroupId = 20 });\n ctx.Db.Membership.Insert(new Membership { Id = 3, UserId = 2, GroupId = 20 });\n }\n}", + "llm_output": "using SpacetimeDB;\n\npublic static partial class Module\n{\n [SpacetimeDB.Table(Name = \"User\", Public = true)]\n public partial struct User\n {\n [SpacetimeDB.PrimaryKey]\n public int UserId;\n public string Name;\n }\n\n [SpacetimeDB.Table(Name = \"Group\", Public = true)]\n public partial struct Group\n {\n [SpacetimeDB.PrimaryKey]\n public int GroupId;\n public string Title;\n }\n\n [SpacetimeDB.Table(Name = \"Membership\", Public = true)]\n [SpacetimeDB.Index.BTree(Name = \"by_user\", Columns = new[] { \"UserId\" })]\n [SpacetimeDB.Index.BTree(Name = \"by_group\", Columns = new[] { \"GroupId\" })]\n public partial struct Membership\n {\n [SpacetimeDB.PrimaryKey]\n public int Id;\n public int UserId;\n public int GroupId;\n }\n\n [SpacetimeDB.Reducer]\n public static void Seed(ReducerContext ctx)\n {\n // Ensure exactly these rows by clearing existing data first\n foreach (var m in ctx.Db.Membership.Iter())\n {\n ctx.Db.Membership.Id.Delete(m.Id);\n }\n foreach (var u in ctx.Db.User.Iter())\n {\n ctx.Db.User.UserId.Delete(u.UserId);\n }\n foreach (var g in ctx.Db.Group.Iter())\n {\n ctx.Db.Group.GroupId.Delete(g.GroupId);\n }\n\n // Users\n ctx.Db.User.Insert(new User { UserId = 1, Name = \"Alice\" });\n ctx.Db.User.Insert(new User { UserId = 2, Name = \"Bob\" });\n\n // Groups\n ctx.Db.Group.Insert(new Group { GroupId = 10, Title = \"Admin\" });\n ctx.Db.Group.Insert(new Group { GroupId = 20, Title = \"Dev\" });\n\n // Memberships\n ctx.Db.Membership.Insert(new Membership { Id = 1, UserId = 1, GroupId = 10 });\n ctx.Db.Membership.Insert(new Membership { Id = 2, UserId = 1, GroupId = 20 });\n ctx.Db.Membership.Insert(new Membership { Id = 3, UserId = 2, GroupId = 20 });\n }\n}", "category": "schema", "route_api_model": "gpt-5", "golden_db": "schema-t-019-many-to-many-golden", @@ -3265,15 +3206,6 @@ "work_dir_golden": "target/llm-runs/schema/t_019_many_to_many/csharp/server/golden", "work_dir_llm": "target/llm-runs/schema/t_019_many_to_many/csharp/server/gpt-5/llm", "scorer_details": { - "m2m_has_2_20": { - "pass": true, - "partial": 1.0, - "notes": { - "actual": 1, - "expected": 1, - "sql": "SELECT COUNT(*) AS n FROM Membership WHERE UserId=2 AND GroupId=20" - } - }, "memberships_three_rows": { "pass": true, "partial": 1.0, @@ -3291,18 +3223,27 @@ "llm_db": "schema-t-019-many-to-many-gpt-5-llm", "reducers_diff": null, "reducers_equal": true, - "server": "http://127.0.0.1:34379", + "server": "http://127.0.0.1:44935", "tables_diff": null, "tables_equal": true } }, + "m2m_has_2_20": { + "pass": true, + "partial": 1.0, + "notes": { + "actual": 1, + "expected": 1, + "sql": "SELECT COUNT(*) AS n FROM Membership WHERE UserId=2 AND GroupId=20" + } + }, "m2m_has_1_20": { "pass": true, "partial": 1.0, "notes": { "actual": 1, "expected": 1, - "sql": "SELECT COUNT(*) AS n FROM Membership WHERE UserId=1 AND GroupId=20" + "sql": "SELECT COUNT(*) AS n FROM Membership WHERE UserId=2 AND GroupId=20" } }, "m2m_has_1_10": { @@ -3316,18 +3257,18 @@ } }, "vendor": "openai", - "started_at": "2026-01-27T19:58:04.046511986Z", - "finished_at": "2026-01-27T19:58:58.263921552Z" + "started_at": "2026-01-26T19:36:32.689581659Z", + "finished_at": "2026-01-26T19:37:37.167783708Z" }, "t_020_ecs": { - "hash": "e3621eaacfd5238fb514ff8c09c277ccd66170773959e5b391507110bf3ac17b", + "hash": "2f6071a69fd778167c45e20453bc018eebc468cc87681c455f819adfa10148a0", "task": "t_020_ecs", "lang": "csharp", "golden_published": true, "model_name": "GPT-5", "total_tests": 5, "passed_tests": 1, - "llm_output": "using SpacetimeDB;\n\npublic static partial class Module\n{\n [SpacetimeDB.Table(Name = \"Entity\")]\n public partial struct Entity\n {\n [SpacetimeDB.PrimaryKey]\n public int Id;\n }\n\n [SpacetimeDB.Table(Name = \"Position\")]\n public partial struct Position\n {\n [SpacetimeDB.PrimaryKey]\n public int EntityId;\n public int X;\n public int Y;\n }\n\n [SpacetimeDB.Table(Name = \"Velocity\")]\n public partial struct Velocity\n {\n [SpacetimeDB.PrimaryKey]\n public int EntityId;\n public int VX;\n public int VY;\n }\n\n [SpacetimeDB.Table(Name = \"NextPosition\")]\n public partial struct NextPosition\n {\n [SpacetimeDB.PrimaryKey]\n public int EntityId;\n public int X;\n public int Y;\n }\n\n [SpacetimeDB.Reducer]\n public static void Seed(ReducerContext ctx)\n {\n // Entities\n ctx.Db.Entity.Insert(new Entity { Id = 1 });\n ctx.Db.Entity.Insert(new Entity { Id = 2 });\n\n // Positions\n ctx.Db.Position.Insert(new Position { EntityId = 1, X = 0, Y = 0 });\n ctx.Db.Position.Insert(new Position { EntityId = 2, X = 10, Y = 0 });\n\n // Velocities\n ctx.Db.Velocity.Insert(new Velocity { EntityId = 1, VX = 1, VY = 0 });\n ctx.Db.Velocity.Insert(new Velocity { EntityId = 2, VX = -2, VY = 3 });\n }\n\n [SpacetimeDB.Reducer]\n public static void Step(ReducerContext ctx)\n {\n foreach (var pos in ctx.Db.Position.Iter())\n {\n var vel = ctx.Db.Velocity.EntityId.Find(pos.EntityId);\n int vx = 0, vy = 0;\n if (vel != null)\n {\n vx = vel.Value.VX;\n vy = vel.Value.VY;\n }\n\n var next = new NextPosition\n {\n EntityId = pos.EntityId,\n X = pos.X + vx,\n Y = pos.Y + vy\n };\n\n var existing = ctx.Db.NextPosition.EntityId.Find(pos.EntityId);\n if (existing != null)\n {\n ctx.Db.NextPosition.EntityId.Update(next);\n }\n else\n {\n ctx.Db.NextPosition.Insert(next);\n }\n }\n }\n}", + "llm_output": "using SpacetimeDB;\n\npublic static partial class Module\n{\n [SpacetimeDB.Table(Name = \"Entity\", Public = true)]\n public partial struct Entity\n {\n [SpacetimeDB.PrimaryKey]\n public int Id;\n }\n\n [SpacetimeDB.Table(Name = \"Position\", Public = true)]\n public partial struct Position\n {\n [SpacetimeDB.PrimaryKey]\n public int EntityId;\n public int X;\n public int Y;\n }\n\n [SpacetimeDB.Table(Name = \"Velocity\", Public = true)]\n public partial struct Velocity\n {\n [SpacetimeDB.PrimaryKey]\n public int EntityId;\n public int VX;\n public int VY;\n }\n\n [SpacetimeDB.Table(Name = \"NextPosition\", Public = true)]\n public partial struct NextPosition\n {\n [SpacetimeDB.PrimaryKey]\n public int EntityId;\n public int X;\n public int Y;\n }\n\n [SpacetimeDB.Reducer]\n public static void Seed(ReducerContext ctx)\n {\n ctx.Db.Entity.Insert(new Entity { Id = 1 });\n ctx.Db.Position.Insert(new Position { EntityId = 1, X = 0, Y = 0 });\n ctx.Db.Velocity.Insert(new Velocity { EntityId = 1, VX = 1, VY = 0 });\n\n ctx.Db.Entity.Insert(new Entity { Id = 2 });\n ctx.Db.Position.Insert(new Position { EntityId = 2, X = 10, Y = 0 });\n ctx.Db.Velocity.Insert(new Velocity { EntityId = 2, VX = -2, VY = 3 });\n }\n\n [SpacetimeDB.Reducer]\n public static void Step(ReducerContext ctx)\n {\n foreach (var pos in ctx.Db.Position.Iter())\n {\n if (ctx.Db.Velocity.EntityId.Find(pos.EntityId) is Velocity vel)\n {\n int nx = pos.X + vel.VX;\n int ny = pos.Y + vel.VY;\n\n if (ctx.Db.NextPosition.EntityId.Find(pos.EntityId) is NextPosition np)\n {\n np.X = nx;\n np.Y = ny;\n ctx.Db.NextPosition.EntityId.Update(np);\n }\n else\n {\n ctx.Db.NextPosition.Insert(new NextPosition { EntityId = pos.EntityId, X = nx, Y = ny });\n }\n }\n }\n }\n}", "category": "schema", "route_api_model": "gpt-5", "golden_db": "schema-t-020-ecs-golden", @@ -3335,19 +3276,32 @@ "work_dir_golden": "target/llm-runs/schema/t_020_ecs/csharp/server/golden", "work_dir_llm": "target/llm-runs/schema/t_020_ecs/csharp/server/gpt-5/llm", "scorer_details": { - "ecs_step_next_positions_count": { + "schema_parity": { + "pass": true, + "partial": 1.0, + "notes": { + "golden_db": "schema-t-020-ecs-golden", + "llm_db": "schema-t-020-ecs-gpt-5-llm", + "reducers_diff": null, + "reducers_equal": true, + "server": "http://127.0.0.1:44935", + "tables_diff": null, + "tables_equal": true + } + }, + "ecs_seed_positions_count": { "pass": false, "partial": 0.0, "notes": { - "error": "spacetime sql failed:\nWARNING: This command is UNSTABLE and subject to breaking changes.\n\nError: no such table: `next_positions`. If the table exists, it may be marked private.\n\nCaused by:\n HTTP status client error (400 Bad Request) for url (http://127.0.0.1:34379/v1/database/c20015874a697116ed39e7f80d0fb9c484518ec19d2cf28ab6bbc9a525d697e0/sql)\n", + "error": "spacetime sql failed:\nWARNING: This command is UNSTABLE and subject to breaking changes.\n\nError: no such table: `positions`. If the table exists, it may be marked private.\n\nCaused by:\n HTTP status client error (400 Bad Request) for url (http://127.0.0.1:44935/v1/database/c2003766705eb1f0e9f55468e9bf8d13f967d7125178a2028f2dd6ca5f43756d/sql)\n", "phase": "sql" } }, - "ecs_next_pos_entity1": { + "ecs_step_next_positions_count": { "pass": false, "partial": 0.0, "notes": { - "error": "spacetime sql failed:\nWARNING: This command is UNSTABLE and subject to breaking changes.\n\nError: no such table: `next_positions`. If the table exists, it may be marked private.\n\nCaused by:\n HTTP status client error (400 Bad Request) for url (http://127.0.0.1:34379/v1/database/c20015874a697116ed39e7f80d0fb9c484518ec19d2cf28ab6bbc9a525d697e0/sql)\n", + "error": "spacetime sql failed:\nWARNING: This command is UNSTABLE and subject to breaking changes.\n\nError: no such table: `next_positions`. If the table exists, it may be marked private.\n\nCaused by:\n HTTP status client error (400 Bad Request) for url (http://127.0.0.1:44935/v1/database/c2003766705eb1f0e9f55468e9bf8d13f967d7125178a2028f2dd6ca5f43756d/sql)\n", "phase": "sql" } }, @@ -3355,45 +3309,32 @@ "pass": false, "partial": 0.0, "notes": { - "error": "spacetime sql failed:\nWARNING: This command is UNSTABLE and subject to breaking changes.\n\nError: no such table: `next_positions`. If the table exists, it may be marked private.\n\nCaused by:\n HTTP status client error (400 Bad Request) for url (http://127.0.0.1:34379/v1/database/c20015874a697116ed39e7f80d0fb9c484518ec19d2cf28ab6bbc9a525d697e0/sql)\n", + "error": "spacetime sql failed:\nWARNING: This command is UNSTABLE and subject to breaking changes.\n\nError: no such table: `next_positions`. If the table exists, it may be marked private.\n\nCaused by:\n HTTP status client error (400 Bad Request) for url (http://127.0.0.1:44935/v1/database/c2003766705eb1f0e9f55468e9bf8d13f967d7125178a2028f2dd6ca5f43756d/sql)\n", "phase": "sql" } }, - "schema_parity": { - "pass": true, - "partial": 1.0, - "notes": { - "golden_db": "schema-t-020-ecs-golden", - "llm_db": "schema-t-020-ecs-gpt-5-llm", - "reducers_diff": null, - "reducers_equal": true, - "server": "http://127.0.0.1:34379", - "tables_diff": null, - "tables_equal": true - } - }, - "ecs_seed_positions_count": { + "ecs_next_pos_entity1": { "pass": false, "partial": 0.0, "notes": { - "error": "spacetime sql failed:\nWARNING: This command is UNSTABLE and subject to breaking changes.\n\nError: no such table: `positions`. If the table exists, it may be marked private.\n\nCaused by:\n HTTP status client error (400 Bad Request) for url (http://127.0.0.1:34379/v1/database/c20015874a697116ed39e7f80d0fb9c484518ec19d2cf28ab6bbc9a525d697e0/sql)\n", + "error": "spacetime sql failed:\nWARNING: This command is UNSTABLE and subject to breaking changes.\n\nError: no such table: `next_positions`. If the table exists, it may be marked private.\n\nCaused by:\n HTTP status client error (400 Bad Request) for url (http://127.0.0.1:44935/v1/database/c2003766705eb1f0e9f55468e9bf8d13f967d7125178a2028f2dd6ca5f43756d/sql)\n", "phase": "sql" } } }, "vendor": "openai", - "started_at": "2026-01-27T19:58:04.281975972Z", - "finished_at": "2026-01-27T19:59:08.067949434Z" + "started_at": "2026-01-26T19:36:38.949546269Z", + "finished_at": "2026-01-26T19:37:47.379943704Z" }, "t_021_multi_column_index": { - "hash": "e3621eaacfd5238fb514ff8c09c277ccd66170773959e5b391507110bf3ac17b", + "hash": "2f6071a69fd778167c45e20453bc018eebc468cc87681c455f819adfa10148a0", "task": "t_021_multi_column_index", "lang": "csharp", "golden_published": true, "model_name": "GPT-5", "total_tests": 4, "passed_tests": 4, - "llm_output": "using SpacetimeDB;\n\npublic static partial class Module\n{\n [SpacetimeDB.Table(Name = \"Log\")]\n [SpacetimeDB.Index.BTree(Name = \"by_user_day\", Columns = new[] { \"UserId\", \"Day\" })]\n public partial struct Log\n {\n [SpacetimeDB.PrimaryKey]\n public int Id;\n public int UserId;\n public int Day;\n public string Message;\n }\n\n [SpacetimeDB.Reducer]\n public static void Seed(ReducerContext ctx)\n {\n ctx.Db.Log.Insert(new Log { Id = 1, UserId = 7, Day = 1, Message = \"a\" });\n ctx.Db.Log.Insert(new Log { Id = 2, UserId = 7, Day = 2, Message = \"b\" });\n ctx.Db.Log.Insert(new Log { Id = 3, UserId = 9, Day = 1, Message = \"c\" });\n }\n}", + "llm_output": "using SpacetimeDB;\n\npublic static partial class Module\n{\n [SpacetimeDB.Table(Name = \"Log\", Public = true)]\n [SpacetimeDB.Index.BTree(Name = \"by_user_day\", Columns = new[] { \"UserId\", \"Day\" })]\n public partial struct Log\n {\n [SpacetimeDB.PrimaryKey]\n public int Id;\n public int UserId;\n public int Day;\n public string Message;\n }\n\n [SpacetimeDB.Reducer]\n public static void Seed(ReducerContext ctx)\n {\n ctx.Db.Log.Insert(new Log { Id = 1, UserId = 7, Day = 1, Message = \"a\" });\n ctx.Db.Log.Insert(new Log { Id = 2, UserId = 7, Day = 2, Message = \"b\" });\n ctx.Db.Log.Insert(new Log { Id = 3, UserId = 9, Day = 1, Message = \"c\" });\n }\n}", "category": "schema", "route_api_model": "gpt-5", "golden_db": "schema-t-021-multi-column-index-golden", @@ -3401,22 +3342,26 @@ "work_dir_golden": "target/llm-runs/schema/t_021_multi_column_index/csharp/server/golden", "work_dir_llm": "target/llm-runs/schema/t_021_multi_column_index/csharp/server/gpt-5/llm", "scorer_details": { - "mcindex_lookup_u7_d2": { + "mcindex_seed_count": { "pass": true, "partial": 1.0, "notes": { - "actual": 1, - "expected": 1, - "sql": "SELECT COUNT(*) AS n FROM Log WHERE UserId=7 AND Day=2" + "actual": 3, + "expected": 3, + "sql": "SELECT COUNT(*) AS n FROM Log" } }, - "mcindex_seed_count": { + "schema_parity": { "pass": true, "partial": 1.0, "notes": { - "actual": 3, - "expected": 3, - "sql": "SELECT COUNT(*) AS n FROM Log" + "golden_db": "schema-t-021-multi-column-index-golden", + "llm_db": "schema-t-021-multi-column-index-gpt-5-llm", + "reducers_diff": null, + "reducers_equal": true, + "server": "http://127.0.0.1:44935", + "tables_diff": null, + "tables_equal": true } }, "mcindex_lookup_u7_d1": { @@ -3428,23 +3373,19 @@ "sql": "SELECT COUNT(*) AS n FROM Log WHERE UserId=7 AND Day=1" } }, - "schema_parity": { + "mcindex_lookup_u7_d2": { "pass": true, "partial": 1.0, "notes": { - "golden_db": "schema-t-021-multi-column-index-golden", - "llm_db": "schema-t-021-multi-column-index-gpt-5-llm", - "reducers_diff": null, - "reducers_equal": true, - "server": "http://127.0.0.1:34379", - "tables_diff": null, - "tables_equal": true + "actual": 1, + "expected": 1, + "sql": "SELECT COUNT(*) AS n FROM Log WHERE UserId=7 AND Day=2" } } }, "vendor": "openai", - "started_at": "2026-01-27T19:57:09.418092225Z", - "finished_at": "2026-01-27T19:58:04.046455117Z" + "started_at": "2026-01-26T19:35:08.500770472Z", + "finished_at": "2026-01-26T19:36:32.689520614Z" } } } diff --git a/docs/llms/docs-benchmark-summary.json b/docs/llms/docs-benchmark-summary.json index bf684185512..fa057f8e85f 100644 --- a/docs/llms/docs-benchmark-summary.json +++ b/docs/llms/docs-benchmark-summary.json @@ -1,11 +1,11 @@ { "version": 1, - "generated_at": "2026-01-27T20:01:19.767Z", + "generated_at": "2026-01-26T19:41:35.586Z", "by_language": { "csharp": { "modes": { "docs": { - "hash": "e3621eaacfd5238fb514ff8c09c277ccd66170773959e5b391507110bf3ac17b", + "hash": "2f6071a69fd778167c45e20453bc018eebc468cc87681c455f819adfa10148a0", "models": { "GPT-5": { "categories": { @@ -19,20 +19,20 @@ }, "schema": { "tasks": 10, - "total_tests": 34, - "passed_tests": 25, - "pass_pct": 73.52941, - "task_pass_equiv": 7.3666663, - "task_pass_pct": 73.666664 + "total_tests": 32, + "passed_tests": 24, + "pass_pct": 75.0, + "task_pass_equiv": 7.033333, + "task_pass_pct": 70.33333 } }, "totals": { "tasks": 22, - "total_tests": 61, - "passed_tests": 52, - "pass_pct": 85.2459, - "task_pass_equiv": 19.366667, - "task_pass_pct": 88.030304 + "total_tests": 59, + "passed_tests": 51, + "pass_pct": 86.44068, + "task_pass_equiv": 19.033333, + "task_pass_pct": 86.515144 } } } @@ -42,7 +42,7 @@ "rust": { "modes": { "docs": { - "hash": "d1bf0b033db905c668d016082c762eb4b91edd1299f7b8d4bcc6def5398610f9", + "hash": "a9b7f59b2c00330aa9e00220d45b9d8f7d257f9b10dc9f37b56a1e954c2b5117", "models": { "GPT-5": { "categories": { @@ -56,44 +56,44 @@ }, "schema": { "tasks": 10, - "total_tests": 32, - "passed_tests": 8, - "pass_pct": 25.0, - "task_pass_equiv": 2.05, - "task_pass_pct": 20.5 + "total_tests": 18, + "passed_tests": 4, + "pass_pct": 22.222221, + "task_pass_equiv": 1.25, + "task_pass_pct": 12.5 } }, "totals": { "tasks": 22, - "total_tests": 59, - "passed_tests": 13, - "pass_pct": 22.033897, - "task_pass_equiv": 3.3833334, - "task_pass_pct": 15.378788 + "total_tests": 45, + "passed_tests": 9, + "pass_pct": 20.0, + "task_pass_equiv": 2.5833335, + "task_pass_pct": 11.742425 } } } }, "rustdoc_json": { - "hash": "2a0f4ec42cac03fb3da542793b311e4b399845c688bb0660a6c231c82e96c56a", + "hash": "da32ac1e4a22e29f27c1c75b3ce526f5ba909c184b9057d83384313a5e7b881a", "models": { "GPT-5": { "categories": { "basics": { "tasks": 12, "total_tests": 27, - "passed_tests": 26, - "pass_pct": 96.296295, - "task_pass_equiv": 11.0, - "task_pass_pct": 91.66667 + "passed_tests": 25, + "pass_pct": 92.59259, + "task_pass_equiv": 10.0, + "task_pass_pct": 83.33333 }, "schema": { "tasks": 10, "total_tests": 34, - "passed_tests": 23, - "pass_pct": 67.64706, - "task_pass_equiv": 6.5333333, - "task_pass_pct": 65.33333 + "passed_tests": 24, + "pass_pct": 70.588234, + "task_pass_equiv": 6.8666663, + "task_pass_pct": 68.666664 } }, "totals": { @@ -101,8 +101,8 @@ "total_tests": 61, "passed_tests": 49, "pass_pct": 80.327866, - "task_pass_equiv": 17.533335, - "task_pass_pct": 79.696976 + "task_pass_equiv": 16.866667, + "task_pass_pct": 76.666664 } } } diff --git a/docs/static/llms.md b/docs/static/llms.md index a4fa11306fd..c7144f9f20f 100644 --- a/docs/static/llms.md +++ b/docs/static/llms.md @@ -1449,7 +1449,7 @@ Reducers are the functions within your server module responsible for atomically - **Return Type:** Reducers should typically return `void`. Errors are signaled by throwing exceptions. - **Reducer Context:** The `ReducerContext` (`ctx`) provides access to: - `ctx.Db`: Handles for interacting with database tables. - - `ctx.Sender`: The `Identity` of the caller. + - `ctx.Sender()`: The `Identity` of the caller. - `ctx.Identity`: The `Identity` of the module itself. - `ctx.Timestamp`: The `Timestamp` of the invocation. - `ctx.ConnectionId`: The nullable `ConnectionId` of the caller. @@ -1478,7 +1478,7 @@ public static partial class Module [Reducer] public static void UpdatePlayerData(ReducerContext ctx, string? newName) { - var playerId = ctx.Sender; + var playerId = ctx.Sender(); // Find player by primary key var player = ctx.Db.player_state.PlayerId.Find(playerId); @@ -1521,10 +1521,10 @@ public static partial class Module if (string.IsNullOrWhiteSpace(name)) { throw new ArgumentException("Name cannot be empty."); } - Log.Info($"Attempting to register player: {name} ({ctx.Sender})"); + Log.Info($"Attempting to register player: {name} ({ctx.Sender()})"); // Check if player identity or name already exists - if (ctx.Db.player_state.PlayerId.Find(ctx.Sender) != null || ctx.Db.player_state.Name.Find(name) != null) + if (ctx.Db.player_state.PlayerId.Find(ctx.Sender()) != null || ctx.Db.player_state.Name.Find(name) != null) { throw new Exception("Player already registered or name taken."); } @@ -1532,7 +1532,7 @@ public static partial class Module // Create new player instance var newPlayer = new PlayerState { - PlayerId = ctx.Sender, + PlayerId = ctx.Sender(), Name = name, Health = 100, Level = 1, @@ -1541,14 +1541,14 @@ public static partial class Module // Insert the new player. This will throw on constraint violation. ctx.Db.player_state.Insert(newPlayer); - Log.Info($"Player registered successfully: {ctx.Sender}"); + Log.Info($"Player registered successfully: {ctx.Sender()}"); } // Example: Basic reducer showing deletion [Reducer] public static void DeleteMyItems(ReducerContext ctx) { - var ownerId = ctx.Sender; + var ownerId = ctx.Sender(); int deletedCount = 0; // Find items by owner (Requires an index on OwnerId for efficiency) @@ -1632,13 +1632,13 @@ These reducers cannot take arguments beyond `&ReducerContext`. // Example init reducer is shown in Scheduled Reducers section [Reducer(ReducerKind.ClientConnected)] public static void HandleConnect(ReducerContext ctx) { - Log.Info($"Client connected: {ctx.Sender}"); + Log.Info($"Client connected: {ctx.Sender()}"); // ... setup initial state for ctx.sender ... } [Reducer(ReducerKind.ClientDisconnected)] public static void HandleDisconnect(ReducerContext ctx) { - Log.Info($"Client disconnected: {ctx.Sender}"); + Log.Info($"Client disconnected: {ctx.Sender()}"); // ... cleanup state for ctx.sender ... } ``` @@ -1692,7 +1692,7 @@ public static partial class Module public static void SendMessage(ReducerContext ctx, SendMessageSchedule scheduleArgs) { // Security check is important! - if (!ctx.Sender.Equals(ctx.Identity)) + if (!ctx.Sender().Equals(ctx.Identity)) { throw new Exception("Reducer SendMessage may not be invoked by clients, only via scheduling."); } @@ -1740,12 +1740,12 @@ public static partial class Module - **Best-Effort Scheduling:** Scheduled reducers are called on a best-effort basis and may be slightly delayed in their execution when a database is under heavy load. -- **Restricting Access (Security):** Scheduled reducers are normal reducers and _can_ still be called directly by clients. If a scheduled reducer should _only_ be called by the scheduler, it is crucial to begin the reducer with a check comparing the caller's identity (`ctx.Sender`) to the module's own identity (`ctx.Identity`). +- **Restricting Access (Security):** Scheduled reducers are normal reducers and _can_ still be called directly by clients. If a scheduled reducer should _only_ be called by the scheduler, it is crucial to begin the reducer with a check comparing the caller's identity (`ctx.Sender()`) to the module's own identity (`ctx.Identity`). ```csharp [Reducer] // Assuming linked via [Table(Scheduled=...)] public static void MyScheduledTask(ReducerContext ctx, MyScheduleArgs args) { - if (!ctx.Sender.Equals(ctx.Identity)) + if (!ctx.Sender().Equals(ctx.Identity)) { throw new Exception("Reducer MyScheduledTask may not be invoked by clients, only via scheduling."); } @@ -1757,7 +1757,7 @@ public static partial class Module ``` :::info Scheduled Reducers and Connections -Scheduled reducer calls originate from the SpacetimeDB scheduler itself, not from an external client connection. Therefore, within a scheduled reducer, `ctx.Sender` will be the module's own identity, and `ctx.ConnectionId` will be `null`. +Scheduled reducer calls originate from the SpacetimeDB scheduler itself, not from an external client connection. Therefore, within a scheduled reducer, `ctx.Sender()` will be the module's own identity, and `ctx.ConnectionId` will be `null`. ::: ##### Error Handling: Exceptions @@ -1827,7 +1827,7 @@ public static partial class Module [SpacetimeDB.View(Name = "MyPlayer", Public = true)] public static Player? MyPlayer(ViewContext ctx) { - return ctx.Db.Player.Identity.Find(ctx.Sender); + return ctx.Db.Player.Identity.Find(ctx.Sender()); } // View that returns all players at a specific level (same for all callers) @@ -1858,7 +1858,7 @@ public static partial class Module Views use one of two context types: -- **`ViewContext`**: Provides access to the caller's `Identity` through `ctx.Sender`. Use this when the view depends on who is querying it (e.g., "get my player"). +- **`ViewContext`**: Provides access to the caller's `Identity` through `ctx.Sender()`. Use this when the view depends on who is querying it (e.g., "get my player"). - **`AnonymousViewContext`**: Does not provide caller information. Use this when the view produces the same results regardless of who queries it (e.g., "get top 10 players"). Both contexts provide read-only access to tables and indexes through `ctx.Db`. @@ -1887,7 +1887,7 @@ The query builder provides a fluent API for constructing type-safe SQL queries: public static Query MyMessages(ViewContext ctx) { return ctx.Db.Message - .Filter(msg => msg.Sender == ctx.Sender) + .Filter(msg => msg.Sender == ctx.Sender()) .Build(); } diff --git a/modules/module-test-cs/Lib.cs b/modules/module-test-cs/Lib.cs index a8d7d7a05ba..72b69649960 100644 --- a/modules/module-test-cs/Lib.cs +++ b/modules/module-test-cs/Lib.cs @@ -219,7 +219,7 @@ static partial class Module [View(Name = "my_player", Public = true)] public static Player? my_player(ViewContext ctx) { - return (Player?)ctx.Db.player.identity.Find(ctx.Sender); + return (Player?)ctx.Db.player.identity.Find(ctx.Sender()); } // This reducer is run at module initialization. @@ -278,7 +278,7 @@ public static void log_module_identity(ReducerContext ctx) public static void test(ReducerContext ctx, TestAlias arg, TestB arg2, TestC arg3, TestF arg4) { Log.Info("BEGIN"); - Log.Info($"sender: {ctx.Sender}"); + Log.Info($"sender: {ctx.Sender()}"); Log.Info($"timestamp: {ctx.Timestamp}"); Log.Info($"bar: {arg2.foo}"); @@ -462,7 +462,7 @@ public static void test_btree_index_args(ReducerContext ctx) [Reducer] public static void assert_caller_identity_is_module_identity(ReducerContext ctx) { - var caller = ctx.Sender; + var caller = ctx.Sender(); var owner = ctx.Identity; if (!caller.Equals(owner)) { diff --git a/modules/sdk-test-connect-disconnect-cs/Lib.cs b/modules/sdk-test-connect-disconnect-cs/Lib.cs index 79af81d8cc4..200457fa616 100644 --- a/modules/sdk-test-connect-disconnect-cs/Lib.cs +++ b/modules/sdk-test-connect-disconnect-cs/Lib.cs @@ -19,12 +19,12 @@ static partial class Module [SpacetimeDB.Reducer(ReducerKind.ClientConnected)] public static void identity_connected(ReducerContext ctx) { - ctx.Db.connected.Insert(new Connected { identity = ctx.Sender}); + ctx.Db.connected.Insert(new Connected { identity = ctx.Sender()}); } [SpacetimeDB.Reducer(ReducerKind.ClientDisconnected)] public static void identity_disconnected(ReducerContext ctx) { - ctx.Db.disconnected.Insert(new Disconnected { identity = ctx.Sender}); + ctx.Db.disconnected.Insert(new Disconnected { identity = ctx.Sender()}); } } diff --git a/modules/sdk-test-cs/Lib.cs b/modules/sdk-test-cs/Lib.cs index 06ddacbb631..0387d77abae 100644 --- a/modules/sdk-test-cs/Lib.cs +++ b/modules/sdk-test-cs/Lib.cs @@ -1887,25 +1887,25 @@ public static void update_pk_simple_enum(ReducerContext ctx, SimpleEnum a, int d [SpacetimeDB.Reducer] public static void insert_caller_one_identity(ReducerContext ctx) { - ctx.Db.one_identity.Insert(new OneIdentity { i = ctx.Sender }); + ctx.Db.one_identity.Insert(new OneIdentity { i = ctx.Sender() }); } [SpacetimeDB.Reducer] public static void insert_caller_vec_identity(ReducerContext ctx) { - ctx.Db.vec_identity.Insert(new VecIdentity { i = new List { ctx.Sender } }); + ctx.Db.vec_identity.Insert(new VecIdentity { i = new List { ctx.Sender() } }); } [SpacetimeDB.Reducer] public static void insert_caller_unique_identity(ReducerContext ctx, int data) { - ctx.Db.unique_identity.Insert(new UniqueIdentity { i = ctx.Sender, data = data }); + ctx.Db.unique_identity.Insert(new UniqueIdentity { i = ctx.Sender(), data = data }); } [SpacetimeDB.Reducer] public static void insert_caller_pk_identity(ReducerContext ctx, int data) { - ctx.Db.pk_identity.Insert(new PkIdentity { i = ctx.Sender, data = data }); + ctx.Db.pk_identity.Insert(new PkIdentity { i = ctx.Sender(), data = data }); } [SpacetimeDB.Reducer] diff --git a/sdks/csharp/examples~/regression-tests/client/module_bindings/SpacetimeDBClient.g.cs b/sdks/csharp/examples~/regression-tests/client/module_bindings/SpacetimeDBClient.g.cs index b8c7b3a9224..40d76ad4f84 100644 --- a/sdks/csharp/examples~/regression-tests/client/module_bindings/SpacetimeDBClient.g.cs +++ b/sdks/csharp/examples~/regression-tests/client/module_bindings/SpacetimeDBClient.g.cs @@ -1,7 +1,7 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.11.3 (commit 7cd565f410fd6ad504b4397c4a970300b92a1c1c). +// This was generated using spacetimedb cli version 1.12.0 (commit 819069447d9034135872ce2bdc28722c4e5e46b6). #nullable enable diff --git a/sdks/csharp/examples~/regression-tests/procedure-client/module_bindings/SpacetimeDBClient.g.cs b/sdks/csharp/examples~/regression-tests/procedure-client/module_bindings/SpacetimeDBClient.g.cs index 8eab9eb3391..79c87218fb4 100644 --- a/sdks/csharp/examples~/regression-tests/procedure-client/module_bindings/SpacetimeDBClient.g.cs +++ b/sdks/csharp/examples~/regression-tests/procedure-client/module_bindings/SpacetimeDBClient.g.cs @@ -1,7 +1,7 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.11.3 (commit 214a46c8fac0d98c96d03017993ba757b7962124). +// This was generated using spacetimedb cli version 1.12.0 (commit 819069447d9034135872ce2bdc28722c4e5e46b6). #nullable enable @@ -31,7 +31,6 @@ public RemoteTables(DbConnection conn) AddTable(MyTable = new(conn)); AddTable(PkUuid = new(conn)); AddTable(ProcInsertsInto = new(conn)); - AddTable(ScheduledProcTable = new(conn)); } } @@ -587,7 +586,6 @@ public sealed class From public global::SpacetimeDB.Table MyTable() => new("my_table", new MyTableCols("my_table"), new MyTableIxCols("my_table")); public global::SpacetimeDB.Table PkUuid() => new("pk_uuid", new PkUuidCols("pk_uuid"), new PkUuidIxCols("pk_uuid")); public global::SpacetimeDB.Table ProcInsertsInto() => new("proc_inserts_into", new ProcInsertsIntoCols("proc_inserts_into"), new ProcInsertsIntoIxCols("proc_inserts_into")); - public global::SpacetimeDB.Table ScheduledProcTable() => new("scheduled_proc_table", new ScheduledProcTableCols("scheduled_proc_table"), new ScheduledProcTableIxCols("scheduled_proc_table")); } public sealed class TypedSubscriptionBuilder diff --git a/sdks/csharp/examples~/regression-tests/procedure-client/module_bindings/Tables/ScheduledProcTable.g.cs b/sdks/csharp/examples~/regression-tests/procedure-client/module_bindings/Tables/ScheduledProcTable.g.cs deleted file mode 100644 index 67f120a2902..00000000000 --- a/sdks/csharp/examples~/regression-tests/procedure-client/module_bindings/Tables/ScheduledProcTable.g.cs +++ /dev/null @@ -1,67 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE -// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. - -#nullable enable - -using System; -using SpacetimeDB.BSATN; -using SpacetimeDB.ClientApi; -using System.Collections.Generic; -using System.Runtime.Serialization; - -namespace SpacetimeDB.Types -{ - public sealed partial class RemoteTables - { - public sealed class ScheduledProcTableHandle : RemoteTableHandle - { - protected override string RemoteTableName => "scheduled_proc_table"; - - public sealed class ScheduledIdUniqueIndex : UniqueIndexBase - { - protected override ulong GetKey(ScheduledProcTable row) => row.ScheduledId; - - public ScheduledIdUniqueIndex(ScheduledProcTableHandle table) : base(table) { } - } - - public readonly ScheduledIdUniqueIndex ScheduledId; - - internal ScheduledProcTableHandle(DbConnection conn) : base(conn) - { - ScheduledId = new(this); - } - - protected override object GetPrimaryKey(ScheduledProcTable row) => row.ScheduledId; - } - - public readonly ScheduledProcTableHandle ScheduledProcTable; - } - - public sealed class ScheduledProcTableCols - { - public global::SpacetimeDB.Col ScheduledId { get; } - public global::SpacetimeDB.Col ScheduledAt { get; } - public global::SpacetimeDB.Col ReducerTs { get; } - public global::SpacetimeDB.Col X { get; } - public global::SpacetimeDB.Col Y { get; } - - public ScheduledProcTableCols(string tableName) - { - ScheduledId = new global::SpacetimeDB.Col(tableName, "scheduled_id"); - ScheduledAt = new global::SpacetimeDB.Col(tableName, "scheduled_at"); - ReducerTs = new global::SpacetimeDB.Col(tableName, "reducer_ts"); - X = new global::SpacetimeDB.Col(tableName, "x"); - Y = new global::SpacetimeDB.Col(tableName, "y"); - } - } - - public sealed class ScheduledProcTableIxCols - { - public global::SpacetimeDB.IxCol ScheduledId { get; } - - public ScheduledProcTableIxCols(string tableName) - { - ScheduledId = new global::SpacetimeDB.IxCol(tableName, "scheduled_id"); - } - } -} diff --git a/sdks/csharp/examples~/regression-tests/republishing/client/module_bindings/SpacetimeDBClient.g.cs b/sdks/csharp/examples~/regression-tests/republishing/client/module_bindings/SpacetimeDBClient.g.cs index d5eb058bf81..e8015a356d0 100644 --- a/sdks/csharp/examples~/regression-tests/republishing/client/module_bindings/SpacetimeDBClient.g.cs +++ b/sdks/csharp/examples~/regression-tests/republishing/client/module_bindings/SpacetimeDBClient.g.cs @@ -1,7 +1,7 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.11.3 (commit 214a46c8fac0d98c96d03017993ba757b7962124). +// This was generated using spacetimedb cli version 1.12.0 (commit 819069447d9034135872ce2bdc28722c4e5e46b6). #nullable enable diff --git a/sdks/csharp/examples~/regression-tests/server/Lib.cs b/sdks/csharp/examples~/regression-tests/server/Lib.cs index a0d5600d39b..7a41a8312ac 100644 --- a/sdks/csharp/examples~/regression-tests/server/Lib.cs +++ b/sdks/csharp/examples~/regression-tests/server/Lib.cs @@ -173,13 +173,13 @@ public partial struct NullStringNullable [SpacetimeDB.View(Name = "my_player", Public = true)] public static Player? MyPlayer(ViewContext ctx) { - return ctx.Db.player.Identity.Find(ctx.Sender); + return ctx.Db.player.Identity.Find(ctx.Sender()); } [SpacetimeDB.View(Name = "my_account", Public = true)] public static Account? MyAccount(ViewContext ctx) { - return ctx.Db.account.Identity.Find(ctx.Sender) as Account; + return ctx.Db.account.Identity.Find(ctx.Sender()) as Account; } [SpacetimeDB.View(Name = "my_account_missing", Public = true)] @@ -391,23 +391,23 @@ public static void InsertWhereTest(ReducerContext ctx, uint id, uint value, stri [Reducer(ReducerKind.ClientConnected)] public static void ClientConnected(ReducerContext ctx) { - Log.Info($"Connect {ctx.Sender}"); + Log.Info($"Connect {ctx.Sender()}"); - if (ctx.Db.player.Identity.Find(ctx.Sender) is Player player) + if (ctx.Db.player.Identity.Find(ctx.Sender()) is Player player) { // We are not logging player login status, so do nothing } else { // Lets setup a new player with a level of 1 - ctx.Db.player.Insert(new Player { Identity = ctx.Sender, Name = "NewPlayer" }); - var playerId = (ctx.Db.player.Identity.Find(ctx.Sender)!).Value.Id; + ctx.Db.player.Insert(new Player { Identity = ctx.Sender(), Name = "NewPlayer" }); + var playerId = (ctx.Db.player.Identity.Find(ctx.Sender())!).Value.Id; ctx.Db.player_level.Insert(new PlayerLevel { PlayerId = playerId, Level = 1 }); } - if (ctx.Db.account.Identity.Find(ctx.Sender) is null) + if (ctx.Db.account.Identity.Find(ctx.Sender()) is null) { - ctx.Db.account.Insert(new Account { Identity = ctx.Sender, Name = "Account" }); + ctx.Db.account.Insert(new Account { Identity = ctx.Sender(), Name = "Account" }); } if (ctx.Db.nullable_vec.Id.Find(1) is null) @@ -781,10 +781,10 @@ public static ReturnStruct TxContextCapabilities(ProcedureContext ctx) } // Test 3: Verify transaction context properties are accessible - var txSender = tx.Sender; + var txSender = tx.Sender(); var txTimestamp = tx.Timestamp; - if (txSender.Equals(ctx.Sender) == false) + if (txSender.Equals(ctx.Sender()) == false) { throw new InvalidOperationException( "Transaction sender should match procedure sender" @@ -825,14 +825,14 @@ public static ReturnStruct AuthenticationCapabilities(ProcedureContext ctx) { // Test 1: Verify authentication context is accessible from procedure context var procAuth = ctx.SenderAuth; - var procSender = ctx.Sender; + var procSender = ctx.Sender(); var procConnectionId = ctx.ConnectionId; var result = ctx.WithTx(tx => { // Test 2: Verify authentication context is accessible from transaction context var txAuth = tx.SenderAuth; - var txSender = tx.Sender; + var txSender = tx.Sender(); var txConnectionId = tx.ConnectionId; // Test 3: Authentication contexts should be consistent diff --git a/sdks/rust/tests/connect_disconnect_client/src/module_bindings/mod.rs b/sdks/rust/tests/connect_disconnect_client/src/module_bindings/mod.rs index 5a54035abec..9fd4e75ac17 100644 --- a/sdks/rust/tests/connect_disconnect_client/src/module_bindings/mod.rs +++ b/sdks/rust/tests/connect_disconnect_client/src/module_bindings/mod.rs @@ -1,7 +1,7 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.11.2 (commit 13a0172567170d9b8c87d2aa71de3246c21acb8c). +// This was generated using spacetimedb cli version 1.12.0 (commit 819069447d9034135872ce2bdc28722c4e5e46b6). #![allow(unused, clippy::all)] use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws}; diff --git a/sdks/rust/tests/procedure-client/src/module_bindings/mod.rs b/sdks/rust/tests/procedure-client/src/module_bindings/mod.rs index 892f78d2899..59454ef8ed1 100644 --- a/sdks/rust/tests/procedure-client/src/module_bindings/mod.rs +++ b/sdks/rust/tests/procedure-client/src/module_bindings/mod.rs @@ -1,7 +1,7 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.11.2 (commit 13a0172567170d9b8c87d2aa71de3246c21acb8c). +// This was generated using spacetimedb cli version 1.12.0 (commit 27fc5ac8802947bdafba1c58cd5b6406159dedd2). #![allow(unused, clippy::all)] use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws}; @@ -23,8 +23,6 @@ pub mod return_primitive_procedure; pub mod return_struct_procedure; pub mod return_struct_type; pub mod schedule_proc_reducer; -pub mod scheduled_proc_procedure; -pub mod scheduled_proc_table_table; pub mod scheduled_proc_table_type; pub mod sorted_uuids_insert_procedure; pub mod will_panic_procedure; @@ -46,8 +44,6 @@ pub use return_primitive_procedure::return_primitive; pub use return_struct_procedure::return_struct; pub use return_struct_type::ReturnStruct; pub use schedule_proc_reducer::{schedule_proc, set_flags_for_schedule_proc, ScheduleProcCallbackId}; -pub use scheduled_proc_procedure::scheduled_proc; -pub use scheduled_proc_table_table::*; pub use scheduled_proc_table_type::ScheduledProcTable; pub use sorted_uuids_insert_procedure::sorted_uuids_insert; pub use will_panic_procedure::will_panic; @@ -96,7 +92,6 @@ pub struct DbUpdate { my_table: __sdk::TableUpdate, pk_uuid: __sdk::TableUpdate, proc_inserts_into: __sdk::TableUpdate, - scheduled_proc_table: __sdk::TableUpdate, } impl TryFrom<__ws::DatabaseUpdate<__ws::BsatnFormat>> for DbUpdate { @@ -114,9 +109,6 @@ impl TryFrom<__ws::DatabaseUpdate<__ws::BsatnFormat>> for DbUpdate { "proc_inserts_into" => db_update .proc_inserts_into .append(proc_inserts_into_table::parse_table_update(table_update)?), - "scheduled_proc_table" => db_update - .scheduled_proc_table - .append(scheduled_proc_table_table::parse_table_update(table_update)?), unknown => { return Err(__sdk::InternalError::unknown_name("table", unknown, "DatabaseUpdate").into()); @@ -139,9 +131,6 @@ impl __sdk::DbUpdate for DbUpdate { diff.pk_uuid = cache.apply_diff_to_table::("pk_uuid", &self.pk_uuid); diff.proc_inserts_into = cache.apply_diff_to_table::("proc_inserts_into", &self.proc_inserts_into); - diff.scheduled_proc_table = cache - .apply_diff_to_table::("scheduled_proc_table", &self.scheduled_proc_table) - .with_updates_by_pk(|row| &row.scheduled_id); diff } @@ -154,7 +143,6 @@ pub struct AppliedDiff<'r> { my_table: __sdk::TableAppliedDiff<'r, MyTable>, pk_uuid: __sdk::TableAppliedDiff<'r, PkUuid>, proc_inserts_into: __sdk::TableAppliedDiff<'r, ProcInsertsInto>, - scheduled_proc_table: __sdk::TableAppliedDiff<'r, ScheduledProcTable>, __unused: std::marker::PhantomData<&'r ()>, } @@ -167,11 +155,6 @@ impl<'r> __sdk::AppliedDiff<'r> for AppliedDiff<'r> { callbacks.invoke_table_row_callbacks::("my_table", &self.my_table, event); callbacks.invoke_table_row_callbacks::("pk_uuid", &self.pk_uuid, event); callbacks.invoke_table_row_callbacks::("proc_inserts_into", &self.proc_inserts_into, event); - callbacks.invoke_table_row_callbacks::( - "scheduled_proc_table", - &self.scheduled_proc_table, - event, - ); } } @@ -895,6 +878,5 @@ impl __sdk::SpacetimeModule for RemoteModule { my_table_table::register_table(client_cache); pk_uuid_table::register_table(client_cache); proc_inserts_into_table::register_table(client_cache); - scheduled_proc_table_table::register_table(client_cache); } } diff --git a/sdks/rust/tests/procedure-client/src/module_bindings/scheduled_proc_procedure.rs b/sdks/rust/tests/procedure-client/src/module_bindings/scheduled_proc_procedure.rs deleted file mode 100644 index 124f51162f0..00000000000 --- a/sdks/rust/tests/procedure-client/src/module_bindings/scheduled_proc_procedure.rs +++ /dev/null @@ -1,46 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE -// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. - -#![allow(unused, clippy::all)] -use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws}; - -use super::scheduled_proc_table_type::ScheduledProcTable; - -#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)] -#[sats(crate = __lib)] -struct ScheduledProcArgs { - pub data: ScheduledProcTable, -} - -impl __sdk::InModule for ScheduledProcArgs { - type Module = super::RemoteModule; -} - -#[allow(non_camel_case_types)] -/// Extension trait for access to the procedure `scheduled_proc`. -/// -/// Implemented for [`super::RemoteProcedures`]. -pub trait scheduled_proc { - fn scheduled_proc(&self, data: ScheduledProcTable) { - self.scheduled_proc_then(data, |_, _| {}); - } - - fn scheduled_proc_then( - &self, - data: ScheduledProcTable, - - __callback: impl FnOnce(&super::ProcedureEventContext, Result<(), __sdk::InternalError>) + Send + 'static, - ); -} - -impl scheduled_proc for super::RemoteProcedures { - fn scheduled_proc_then( - &self, - data: ScheduledProcTable, - - __callback: impl FnOnce(&super::ProcedureEventContext, Result<(), __sdk::InternalError>) + Send + 'static, - ) { - self.imp - .invoke_procedure_with_callback::<_, ()>("scheduled_proc", ScheduledProcArgs { data }, __callback); - } -} diff --git a/sdks/rust/tests/procedure-client/src/module_bindings/scheduled_proc_table_table.rs b/sdks/rust/tests/procedure-client/src/module_bindings/scheduled_proc_table_table.rs deleted file mode 100644 index afea2c721a1..00000000000 --- a/sdks/rust/tests/procedure-client/src/module_bindings/scheduled_proc_table_table.rs +++ /dev/null @@ -1,158 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE -// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. - -#![allow(unused, clippy::all)] -use super::scheduled_proc_table_type::ScheduledProcTable; -use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws}; - -/// Table handle for the table `scheduled_proc_table`. -/// -/// Obtain a handle from the [`ScheduledProcTableTableAccess::scheduled_proc_table`] method on [`super::RemoteTables`], -/// like `ctx.db.scheduled_proc_table()`. -/// -/// Users are encouraged not to explicitly reference this type, -/// but to directly chain method calls, -/// like `ctx.db.scheduled_proc_table().on_insert(...)`. -pub struct ScheduledProcTableTableHandle<'ctx> { - imp: __sdk::TableHandle, - ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, -} - -#[allow(non_camel_case_types)] -/// Extension trait for access to the table `scheduled_proc_table`. -/// -/// Implemented for [`super::RemoteTables`]. -pub trait ScheduledProcTableTableAccess { - #[allow(non_snake_case)] - /// Obtain a [`ScheduledProcTableTableHandle`], which mediates access to the table `scheduled_proc_table`. - fn scheduled_proc_table(&self) -> ScheduledProcTableTableHandle<'_>; -} - -impl ScheduledProcTableTableAccess for super::RemoteTables { - fn scheduled_proc_table(&self) -> ScheduledProcTableTableHandle<'_> { - ScheduledProcTableTableHandle { - imp: self.imp.get_table::("scheduled_proc_table"), - ctx: std::marker::PhantomData, - } - } -} - -pub struct ScheduledProcTableInsertCallbackId(__sdk::CallbackId); -pub struct ScheduledProcTableDeleteCallbackId(__sdk::CallbackId); - -impl<'ctx> __sdk::Table for ScheduledProcTableTableHandle<'ctx> { - type Row = ScheduledProcTable; - type EventContext = super::EventContext; - - fn count(&self) -> u64 { - self.imp.count() - } - fn iter(&self) -> impl Iterator + '_ { - self.imp.iter() - } - - type InsertCallbackId = ScheduledProcTableInsertCallbackId; - - fn on_insert( - &self, - callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, - ) -> ScheduledProcTableInsertCallbackId { - ScheduledProcTableInsertCallbackId(self.imp.on_insert(Box::new(callback))) - } - - fn remove_on_insert(&self, callback: ScheduledProcTableInsertCallbackId) { - self.imp.remove_on_insert(callback.0) - } - - type DeleteCallbackId = ScheduledProcTableDeleteCallbackId; - - fn on_delete( - &self, - callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, - ) -> ScheduledProcTableDeleteCallbackId { - ScheduledProcTableDeleteCallbackId(self.imp.on_delete(Box::new(callback))) - } - - fn remove_on_delete(&self, callback: ScheduledProcTableDeleteCallbackId) { - self.imp.remove_on_delete(callback.0) - } -} - -#[doc(hidden)] -pub(super) fn register_table(client_cache: &mut __sdk::ClientCache) { - let _table = client_cache.get_or_make_table::("scheduled_proc_table"); - _table.add_unique_constraint::("scheduled_id", |row| &row.scheduled_id); -} -pub struct ScheduledProcTableUpdateCallbackId(__sdk::CallbackId); - -impl<'ctx> __sdk::TableWithPrimaryKey for ScheduledProcTableTableHandle<'ctx> { - type UpdateCallbackId = ScheduledProcTableUpdateCallbackId; - - fn on_update( - &self, - callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static, - ) -> ScheduledProcTableUpdateCallbackId { - ScheduledProcTableUpdateCallbackId(self.imp.on_update(Box::new(callback))) - } - - fn remove_on_update(&self, callback: ScheduledProcTableUpdateCallbackId) { - self.imp.remove_on_update(callback.0) - } -} - -#[doc(hidden)] -pub(super) fn parse_table_update( - raw_updates: __ws::TableUpdate<__ws::BsatnFormat>, -) -> __sdk::Result<__sdk::TableUpdate> { - __sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| { - __sdk::InternalError::failed_parse("TableUpdate", "TableUpdate") - .with_cause(e) - .into() - }) -} - -/// Access to the `scheduled_id` unique index on the table `scheduled_proc_table`, -/// which allows point queries on the field of the same name -/// via the [`ScheduledProcTableScheduledIdUnique::find`] method. -/// -/// Users are encouraged not to explicitly reference this type, -/// but to directly chain method calls, -/// like `ctx.db.scheduled_proc_table().scheduled_id().find(...)`. -pub struct ScheduledProcTableScheduledIdUnique<'ctx> { - imp: __sdk::UniqueConstraintHandle, - phantom: std::marker::PhantomData<&'ctx super::RemoteTables>, -} - -impl<'ctx> ScheduledProcTableTableHandle<'ctx> { - /// Get a handle on the `scheduled_id` unique index on the table `scheduled_proc_table`. - pub fn scheduled_id(&self) -> ScheduledProcTableScheduledIdUnique<'ctx> { - ScheduledProcTableScheduledIdUnique { - imp: self.imp.get_unique_constraint::("scheduled_id"), - phantom: std::marker::PhantomData, - } - } -} - -impl<'ctx> ScheduledProcTableScheduledIdUnique<'ctx> { - /// Find the subscribed row whose `scheduled_id` column value is equal to `col_val`, - /// if such a row is present in the client cache. - pub fn find(&self, col_val: &u64) -> Option { - self.imp.find(col_val) - } -} - -#[allow(non_camel_case_types)] -/// Extension trait for query builder access to the table `ScheduledProcTable`. -/// -/// Implemented for [`__sdk::QueryTableAccessor`]. -pub trait scheduled_proc_tableQueryTableAccess { - #[allow(non_snake_case)] - /// Get a query builder for the table `ScheduledProcTable`. - fn scheduled_proc_table(&self) -> __sdk::__query_builder::Table; -} - -impl scheduled_proc_tableQueryTableAccess for __sdk::QueryTableAccessor { - fn scheduled_proc_table(&self) -> __sdk::__query_builder::Table { - __sdk::__query_builder::Table::new("scheduled_proc_table") - } -} diff --git a/sdks/rust/tests/test-client/src/module_bindings/indexed_table_2_table.rs b/sdks/rust/tests/test-client/src/module_bindings/indexed_table_2_table.rs deleted file mode 100644 index 727d167e592..00000000000 --- a/sdks/rust/tests/test-client/src/module_bindings/indexed_table_2_table.rs +++ /dev/null @@ -1,111 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE -// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. - -#![allow(unused, clippy::all)] -use super::indexed_table_2_type::IndexedTable2; -use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws}; - -/// Table handle for the table `indexed_table_2`. -/// -/// Obtain a handle from the [`IndexedTable2TableAccess::indexed_table_2`] method on [`super::RemoteTables`], -/// like `ctx.db.indexed_table_2()`. -/// -/// Users are encouraged not to explicitly reference this type, -/// but to directly chain method calls, -/// like `ctx.db.indexed_table_2().on_insert(...)`. -pub struct IndexedTable2TableHandle<'ctx> { - imp: __sdk::TableHandle, - ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, -} - -#[allow(non_camel_case_types)] -/// Extension trait for access to the table `indexed_table_2`. -/// -/// Implemented for [`super::RemoteTables`]. -pub trait IndexedTable2TableAccess { - #[allow(non_snake_case)] - /// Obtain a [`IndexedTable2TableHandle`], which mediates access to the table `indexed_table_2`. - fn indexed_table_2(&self) -> IndexedTable2TableHandle<'_>; -} - -impl IndexedTable2TableAccess for super::RemoteTables { - fn indexed_table_2(&self) -> IndexedTable2TableHandle<'_> { - IndexedTable2TableHandle { - imp: self.imp.get_table::("indexed_table_2"), - ctx: std::marker::PhantomData, - } - } -} - -pub struct IndexedTable2InsertCallbackId(__sdk::CallbackId); -pub struct IndexedTable2DeleteCallbackId(__sdk::CallbackId); - -impl<'ctx> __sdk::Table for IndexedTable2TableHandle<'ctx> { - type Row = IndexedTable2; - type EventContext = super::EventContext; - - fn count(&self) -> u64 { - self.imp.count() - } - fn iter(&self) -> impl Iterator + '_ { - self.imp.iter() - } - - type InsertCallbackId = IndexedTable2InsertCallbackId; - - fn on_insert( - &self, - callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, - ) -> IndexedTable2InsertCallbackId { - IndexedTable2InsertCallbackId(self.imp.on_insert(Box::new(callback))) - } - - fn remove_on_insert(&self, callback: IndexedTable2InsertCallbackId) { - self.imp.remove_on_insert(callback.0) - } - - type DeleteCallbackId = IndexedTable2DeleteCallbackId; - - fn on_delete( - &self, - callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, - ) -> IndexedTable2DeleteCallbackId { - IndexedTable2DeleteCallbackId(self.imp.on_delete(Box::new(callback))) - } - - fn remove_on_delete(&self, callback: IndexedTable2DeleteCallbackId) { - self.imp.remove_on_delete(callback.0) - } -} - -#[doc(hidden)] -pub(super) fn register_table(client_cache: &mut __sdk::ClientCache) { - let _table = client_cache.get_or_make_table::("indexed_table_2"); -} - -#[doc(hidden)] -pub(super) fn parse_table_update( - raw_updates: __ws::TableUpdate<__ws::BsatnFormat>, -) -> __sdk::Result<__sdk::TableUpdate> { - __sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| { - __sdk::InternalError::failed_parse("TableUpdate", "TableUpdate") - .with_cause(e) - .into() - }) -} - -#[allow(non_camel_case_types)] -/// Extension trait for query builder access to the table `IndexedTable2`. -/// -/// Implemented for [`__sdk::QueryTableAccessor`]. -pub trait indexed_table_2QueryTableAccess { - #[allow(non_snake_case)] - /// Get a query builder for the table `IndexedTable2`. - fn indexed_table_2(&self) -> __sdk::__query_builder::Table; -} - -impl indexed_table_2QueryTableAccess for __sdk::QueryTableAccessor { - fn indexed_table_2(&self) -> __sdk::__query_builder::Table { - __sdk::__query_builder::Table::new("indexed_table_2") - } -} diff --git a/sdks/rust/tests/test-client/src/module_bindings/indexed_table_table.rs b/sdks/rust/tests/test-client/src/module_bindings/indexed_table_table.rs deleted file mode 100644 index ab01d94a663..00000000000 --- a/sdks/rust/tests/test-client/src/module_bindings/indexed_table_table.rs +++ /dev/null @@ -1,111 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE -// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. - -#![allow(unused, clippy::all)] -use super::indexed_table_type::IndexedTable; -use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws}; - -/// Table handle for the table `indexed_table`. -/// -/// Obtain a handle from the [`IndexedTableTableAccess::indexed_table`] method on [`super::RemoteTables`], -/// like `ctx.db.indexed_table()`. -/// -/// Users are encouraged not to explicitly reference this type, -/// but to directly chain method calls, -/// like `ctx.db.indexed_table().on_insert(...)`. -pub struct IndexedTableTableHandle<'ctx> { - imp: __sdk::TableHandle, - ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, -} - -#[allow(non_camel_case_types)] -/// Extension trait for access to the table `indexed_table`. -/// -/// Implemented for [`super::RemoteTables`]. -pub trait IndexedTableTableAccess { - #[allow(non_snake_case)] - /// Obtain a [`IndexedTableTableHandle`], which mediates access to the table `indexed_table`. - fn indexed_table(&self) -> IndexedTableTableHandle<'_>; -} - -impl IndexedTableTableAccess for super::RemoteTables { - fn indexed_table(&self) -> IndexedTableTableHandle<'_> { - IndexedTableTableHandle { - imp: self.imp.get_table::("indexed_table"), - ctx: std::marker::PhantomData, - } - } -} - -pub struct IndexedTableInsertCallbackId(__sdk::CallbackId); -pub struct IndexedTableDeleteCallbackId(__sdk::CallbackId); - -impl<'ctx> __sdk::Table for IndexedTableTableHandle<'ctx> { - type Row = IndexedTable; - type EventContext = super::EventContext; - - fn count(&self) -> u64 { - self.imp.count() - } - fn iter(&self) -> impl Iterator + '_ { - self.imp.iter() - } - - type InsertCallbackId = IndexedTableInsertCallbackId; - - fn on_insert( - &self, - callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, - ) -> IndexedTableInsertCallbackId { - IndexedTableInsertCallbackId(self.imp.on_insert(Box::new(callback))) - } - - fn remove_on_insert(&self, callback: IndexedTableInsertCallbackId) { - self.imp.remove_on_insert(callback.0) - } - - type DeleteCallbackId = IndexedTableDeleteCallbackId; - - fn on_delete( - &self, - callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, - ) -> IndexedTableDeleteCallbackId { - IndexedTableDeleteCallbackId(self.imp.on_delete(Box::new(callback))) - } - - fn remove_on_delete(&self, callback: IndexedTableDeleteCallbackId) { - self.imp.remove_on_delete(callback.0) - } -} - -#[doc(hidden)] -pub(super) fn register_table(client_cache: &mut __sdk::ClientCache) { - let _table = client_cache.get_or_make_table::("indexed_table"); -} - -#[doc(hidden)] -pub(super) fn parse_table_update( - raw_updates: __ws::TableUpdate<__ws::BsatnFormat>, -) -> __sdk::Result<__sdk::TableUpdate> { - __sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| { - __sdk::InternalError::failed_parse("TableUpdate", "TableUpdate") - .with_cause(e) - .into() - }) -} - -#[allow(non_camel_case_types)] -/// Extension trait for query builder access to the table `IndexedTable`. -/// -/// Implemented for [`__sdk::QueryTableAccessor`]. -pub trait indexed_tableQueryTableAccess { - #[allow(non_snake_case)] - /// Get a query builder for the table `IndexedTable`. - fn indexed_table(&self) -> __sdk::__query_builder::Table; -} - -impl indexed_tableQueryTableAccess for __sdk::QueryTableAccessor { - fn indexed_table(&self) -> __sdk::__query_builder::Table { - __sdk::__query_builder::Table::new("indexed_table") - } -} diff --git a/sdks/rust/tests/test-client/src/module_bindings/mod.rs b/sdks/rust/tests/test-client/src/module_bindings/mod.rs index 88c57803d23..9f081f441fe 100644 --- a/sdks/rust/tests/test-client/src/module_bindings/mod.rs +++ b/sdks/rust/tests/test-client/src/module_bindings/mod.rs @@ -1,7 +1,7 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.11.2 (commit 13a0172567170d9b8c87d2aa71de3246c21acb8c). +// This was generated using spacetimedb cli version 1.12.0 (commit 819069447d9034135872ce2bdc28722c4e5e46b6). #![allow(unused, clippy::all)] use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws}; @@ -52,9 +52,7 @@ pub mod every_primitive_struct_type; pub mod every_vec_struct_type; pub mod indexed_simple_enum_table; pub mod indexed_simple_enum_type; -pub mod indexed_table_2_table; pub mod indexed_table_2_type; -pub mod indexed_table_table; pub mod indexed_table_type; pub mod insert_call_timestamp_reducer; pub mod insert_call_uuid_v_4_reducer; @@ -504,9 +502,7 @@ pub use every_primitive_struct_type::EveryPrimitiveStruct; pub use every_vec_struct_type::EveryVecStruct; pub use indexed_simple_enum_table::*; pub use indexed_simple_enum_type::IndexedSimpleEnum; -pub use indexed_table_2_table::*; pub use indexed_table_2_type::IndexedTable2; -pub use indexed_table_table::*; pub use indexed_table_type::IndexedTable; pub use insert_call_timestamp_reducer::{ insert_call_timestamp, set_flags_for_insert_call_timestamp, InsertCallTimestampCallbackId, @@ -3047,8 +3043,6 @@ impl TryFrom<__ws::ReducerCallInfo<__ws::BsatnFormat>> for Reducer { pub struct DbUpdate { btree_u_32: __sdk::TableUpdate, indexed_simple_enum: __sdk::TableUpdate, - indexed_table: __sdk::TableUpdate, - indexed_table_2: __sdk::TableUpdate, large_table: __sdk::TableUpdate, one_bool: __sdk::TableUpdate, one_byte_struct: __sdk::TableUpdate, @@ -3168,12 +3162,6 @@ impl TryFrom<__ws::DatabaseUpdate<__ws::BsatnFormat>> for DbUpdate { "indexed_simple_enum" => db_update .indexed_simple_enum .append(indexed_simple_enum_table::parse_table_update(table_update)?), - "indexed_table" => db_update - .indexed_table - .append(indexed_table_table::parse_table_update(table_update)?), - "indexed_table_2" => db_update - .indexed_table_2 - .append(indexed_table_2_table::parse_table_update(table_update)?), "large_table" => db_update .large_table .append(large_table_table::parse_table_update(table_update)?), @@ -3504,8 +3492,6 @@ impl __sdk::DbUpdate for DbUpdate { diff.btree_u_32 = cache.apply_diff_to_table::("btree_u32", &self.btree_u_32); diff.indexed_simple_enum = cache.apply_diff_to_table::("indexed_simple_enum", &self.indexed_simple_enum); - diff.indexed_table = cache.apply_diff_to_table::("indexed_table", &self.indexed_table); - diff.indexed_table_2 = cache.apply_diff_to_table::("indexed_table_2", &self.indexed_table_2); diff.large_table = cache.apply_diff_to_table::("large_table", &self.large_table); diff.one_bool = cache.apply_diff_to_table::("one_bool", &self.one_bool); diff.one_byte_struct = cache.apply_diff_to_table::("one_byte_struct", &self.one_byte_struct); @@ -3691,8 +3677,6 @@ impl __sdk::DbUpdate for DbUpdate { pub struct AppliedDiff<'r> { btree_u_32: __sdk::TableAppliedDiff<'r, BTreeU32>, indexed_simple_enum: __sdk::TableAppliedDiff<'r, IndexedSimpleEnum>, - indexed_table: __sdk::TableAppliedDiff<'r, IndexedTable>, - indexed_table_2: __sdk::TableAppliedDiff<'r, IndexedTable2>, large_table: __sdk::TableAppliedDiff<'r, LargeTable>, one_bool: __sdk::TableAppliedDiff<'r, OneBool>, one_byte_struct: __sdk::TableAppliedDiff<'r, OneByteStruct>, @@ -3813,8 +3797,6 @@ impl<'r> __sdk::AppliedDiff<'r> for AppliedDiff<'r> { &self.indexed_simple_enum, event, ); - callbacks.invoke_table_row_callbacks::("indexed_table", &self.indexed_table, event); - callbacks.invoke_table_row_callbacks::("indexed_table_2", &self.indexed_table_2, event); callbacks.invoke_table_row_callbacks::("large_table", &self.large_table, event); callbacks.invoke_table_row_callbacks::("one_bool", &self.one_bool, event); callbacks.invoke_table_row_callbacks::("one_byte_struct", &self.one_byte_struct, event); @@ -4694,8 +4676,6 @@ impl __sdk::SpacetimeModule for RemoteModule { fn register_tables(client_cache: &mut __sdk::ClientCache) { btree_u_32_table::register_table(client_cache); indexed_simple_enum_table::register_table(client_cache); - indexed_table_table::register_table(client_cache); - indexed_table_2_table::register_table(client_cache); large_table_table::register_table(client_cache); one_bool_table::register_table(client_cache); one_byte_struct_table::register_table(client_cache); diff --git a/sdks/rust/tests/view-client/src/module_bindings/mod.rs b/sdks/rust/tests/view-client/src/module_bindings/mod.rs index 40ff3f092bf..a5bb61a598c 100644 --- a/sdks/rust/tests/view-client/src/module_bindings/mod.rs +++ b/sdks/rust/tests/view-client/src/module_bindings/mod.rs @@ -1,7 +1,7 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.11.2 (commit 13a0172567170d9b8c87d2aa71de3246c21acb8c). +// This was generated using spacetimedb cli version 1.12.0 (commit 819069447d9034135872ce2bdc28722c4e5e46b6). #![allow(unused, clippy::all)] use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws}; @@ -15,7 +15,6 @@ pub mod nearby_players_table; pub mod player_and_level_type; pub mod player_level_table; pub mod player_level_type; -pub mod player_location_table; pub mod player_location_type; pub mod player_table; pub mod player_type; @@ -30,7 +29,6 @@ pub use nearby_players_table::*; pub use player_and_level_type::PlayerAndLevel; pub use player_level_table::*; pub use player_level_type::PlayerLevel; -pub use player_location_table::*; pub use player_location_type::PlayerLocation; pub use player_table::*; pub use player_type::Player; @@ -96,7 +94,6 @@ pub struct DbUpdate { nearby_players: __sdk::TableUpdate, player: __sdk::TableUpdate, player_level: __sdk::TableUpdate, - player_location: __sdk::TableUpdate, players_at_level_0: __sdk::TableUpdate, } @@ -119,9 +116,6 @@ impl TryFrom<__ws::DatabaseUpdate<__ws::BsatnFormat>> for DbUpdate { "player_level" => db_update .player_level .append(player_level_table::parse_table_update(table_update)?), - "player_location" => db_update - .player_location - .append(player_location_table::parse_table_update(table_update)?), "players_at_level_0" => db_update .players_at_level_0 .append(players_at_level_0_table::parse_table_update(table_update)?), @@ -147,7 +141,6 @@ impl __sdk::DbUpdate for DbUpdate { .apply_diff_to_table::("player", &self.player) .with_updates_by_pk(|row| &row.entity_id); diff.player_level = cache.apply_diff_to_table::("player_level", &self.player_level); - diff.player_location = cache.apply_diff_to_table::("player_location", &self.player_location); diff.my_player = cache.apply_diff_to_table::("my_player", &self.my_player); diff.my_player_and_level = cache.apply_diff_to_table::("my_player_and_level", &self.my_player_and_level); @@ -167,7 +160,6 @@ pub struct AppliedDiff<'r> { nearby_players: __sdk::TableAppliedDiff<'r, PlayerLocation>, player: __sdk::TableAppliedDiff<'r, Player>, player_level: __sdk::TableAppliedDiff<'r, PlayerLevel>, - player_location: __sdk::TableAppliedDiff<'r, PlayerLocation>, players_at_level_0: __sdk::TableAppliedDiff<'r, Player>, __unused: std::marker::PhantomData<&'r ()>, } @@ -183,7 +175,6 @@ impl<'r> __sdk::AppliedDiff<'r> for AppliedDiff<'r> { callbacks.invoke_table_row_callbacks::("nearby_players", &self.nearby_players, event); callbacks.invoke_table_row_callbacks::("player", &self.player, event); callbacks.invoke_table_row_callbacks::("player_level", &self.player_level, event); - callbacks.invoke_table_row_callbacks::("player_location", &self.player_location, event); callbacks.invoke_table_row_callbacks::("players_at_level_0", &self.players_at_level_0, event); } } @@ -910,7 +901,6 @@ impl __sdk::SpacetimeModule for RemoteModule { nearby_players_table::register_table(client_cache); player_table::register_table(client_cache); player_level_table::register_table(client_cache); - player_location_table::register_table(client_cache); players_at_level_0_table::register_table(client_cache); } } diff --git a/sdks/rust/tests/view-client/src/module_bindings/player_location_table.rs b/sdks/rust/tests/view-client/src/module_bindings/player_location_table.rs deleted file mode 100644 index 97034b47576..00000000000 --- a/sdks/rust/tests/view-client/src/module_bindings/player_location_table.rs +++ /dev/null @@ -1,142 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE -// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. - -#![allow(unused, clippy::all)] -use super::player_location_type::PlayerLocation; -use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws}; - -/// Table handle for the table `player_location`. -/// -/// Obtain a handle from the [`PlayerLocationTableAccess::player_location`] method on [`super::RemoteTables`], -/// like `ctx.db.player_location()`. -/// -/// Users are encouraged not to explicitly reference this type, -/// but to directly chain method calls, -/// like `ctx.db.player_location().on_insert(...)`. -pub struct PlayerLocationTableHandle<'ctx> { - imp: __sdk::TableHandle, - ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, -} - -#[allow(non_camel_case_types)] -/// Extension trait for access to the table `player_location`. -/// -/// Implemented for [`super::RemoteTables`]. -pub trait PlayerLocationTableAccess { - #[allow(non_snake_case)] - /// Obtain a [`PlayerLocationTableHandle`], which mediates access to the table `player_location`. - fn player_location(&self) -> PlayerLocationTableHandle<'_>; -} - -impl PlayerLocationTableAccess for super::RemoteTables { - fn player_location(&self) -> PlayerLocationTableHandle<'_> { - PlayerLocationTableHandle { - imp: self.imp.get_table::("player_location"), - ctx: std::marker::PhantomData, - } - } -} - -pub struct PlayerLocationInsertCallbackId(__sdk::CallbackId); -pub struct PlayerLocationDeleteCallbackId(__sdk::CallbackId); - -impl<'ctx> __sdk::Table for PlayerLocationTableHandle<'ctx> { - type Row = PlayerLocation; - type EventContext = super::EventContext; - - fn count(&self) -> u64 { - self.imp.count() - } - fn iter(&self) -> impl Iterator + '_ { - self.imp.iter() - } - - type InsertCallbackId = PlayerLocationInsertCallbackId; - - fn on_insert( - &self, - callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, - ) -> PlayerLocationInsertCallbackId { - PlayerLocationInsertCallbackId(self.imp.on_insert(Box::new(callback))) - } - - fn remove_on_insert(&self, callback: PlayerLocationInsertCallbackId) { - self.imp.remove_on_insert(callback.0) - } - - type DeleteCallbackId = PlayerLocationDeleteCallbackId; - - fn on_delete( - &self, - callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, - ) -> PlayerLocationDeleteCallbackId { - PlayerLocationDeleteCallbackId(self.imp.on_delete(Box::new(callback))) - } - - fn remove_on_delete(&self, callback: PlayerLocationDeleteCallbackId) { - self.imp.remove_on_delete(callback.0) - } -} - -#[doc(hidden)] -pub(super) fn register_table(client_cache: &mut __sdk::ClientCache) { - let _table = client_cache.get_or_make_table::("player_location"); - _table.add_unique_constraint::("entity_id", |row| &row.entity_id); -} - -#[doc(hidden)] -pub(super) fn parse_table_update( - raw_updates: __ws::TableUpdate<__ws::BsatnFormat>, -) -> __sdk::Result<__sdk::TableUpdate> { - __sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| { - __sdk::InternalError::failed_parse("TableUpdate", "TableUpdate") - .with_cause(e) - .into() - }) -} - -/// Access to the `entity_id` unique index on the table `player_location`, -/// which allows point queries on the field of the same name -/// via the [`PlayerLocationEntityIdUnique::find`] method. -/// -/// Users are encouraged not to explicitly reference this type, -/// but to directly chain method calls, -/// like `ctx.db.player_location().entity_id().find(...)`. -pub struct PlayerLocationEntityIdUnique<'ctx> { - imp: __sdk::UniqueConstraintHandle, - phantom: std::marker::PhantomData<&'ctx super::RemoteTables>, -} - -impl<'ctx> PlayerLocationTableHandle<'ctx> { - /// Get a handle on the `entity_id` unique index on the table `player_location`. - pub fn entity_id(&self) -> PlayerLocationEntityIdUnique<'ctx> { - PlayerLocationEntityIdUnique { - imp: self.imp.get_unique_constraint::("entity_id"), - phantom: std::marker::PhantomData, - } - } -} - -impl<'ctx> PlayerLocationEntityIdUnique<'ctx> { - /// Find the subscribed row whose `entity_id` column value is equal to `col_val`, - /// if such a row is present in the client cache. - pub fn find(&self, col_val: &u64) -> Option { - self.imp.find(col_val) - } -} - -#[allow(non_camel_case_types)] -/// Extension trait for query builder access to the table `PlayerLocation`. -/// -/// Implemented for [`__sdk::QueryTableAccessor`]. -pub trait player_locationQueryTableAccess { - #[allow(non_snake_case)] - /// Get a query builder for the table `PlayerLocation`. - fn player_location(&self) -> __sdk::__query_builder::Table; -} - -impl player_locationQueryTableAccess for __sdk::QueryTableAccessor { - fn player_location(&self) -> __sdk::__query_builder::Table { - __sdk::__query_builder::Table::new("player_location") - } -} diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/SpacetimeDBClient.g.cpp b/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/SpacetimeDBClient.g.cpp index 7a640870a2f..119e8f76194 100644 --- a/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/SpacetimeDBClient.g.cpp +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/SpacetimeDBClient.g.cpp @@ -6,8 +6,6 @@ #include "BSATN/UEBSATNHelpers.h" #include "ModuleBindings/Tables/BtreeU32Table.g.h" #include "ModuleBindings/Tables/IndexedSimpleEnumTable.g.h" -#include "ModuleBindings/Tables/IndexedTableTable.g.h" -#include "ModuleBindings/Tables/IndexedTable2Table.g.h" #include "ModuleBindings/Tables/LargeTableTable.g.h" #include "ModuleBindings/Tables/OneBoolTable.g.h" #include "ModuleBindings/Tables/OneByteStructTable.g.h" @@ -1325,8 +1323,6 @@ UDbConnection::UDbConnection(const FObjectInitializer& ObjectInitializer) : Supe RegisterTable(TEXT("btree_u32"), Db->BtreeU32); RegisterTable(TEXT("indexed_simple_enum"), Db->IndexedSimpleEnum); - RegisterTable(TEXT("indexed_table"), Db->IndexedTable); - RegisterTable(TEXT("indexed_table_2"), Db->IndexedTable2); RegisterTable(TEXT("large_table"), Db->LargeTable); RegisterTable(TEXT("one_bool"), Db->OneBool); RegisterTable(TEXT("one_byte_struct"), Db->OneByteStruct); @@ -1469,8 +1465,6 @@ void URemoteTables::Initialize() /** Creating tables */ BtreeU32 = NewObject(this); IndexedSimpleEnum = NewObject(this); - IndexedTable = NewObject(this); - IndexedTable2 = NewObject(this); LargeTable = NewObject(this); OneBool = NewObject(this); OneByteStruct = NewObject(this); @@ -1581,8 +1575,6 @@ void URemoteTables::Initialize() /** Initialization */ BtreeU32->PostInitialize(); IndexedSimpleEnum->PostInitialize(); - IndexedTable->PostInitialize(); - IndexedTable2->PostInitialize(); LargeTable->PostInitialize(); OneBool->PostInitialize(); OneByteStruct->PostInitialize(); diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/IndexedTable2Table.g.cpp b/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/IndexedTable2Table.g.cpp deleted file mode 100644 index 2f850e9a500..00000000000 --- a/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/IndexedTable2Table.g.cpp +++ /dev/null @@ -1,48 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE -// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. - -#include "ModuleBindings/Tables/IndexedTable2Table.g.h" -#include "DBCache/UniqueIndex.h" -#include "DBCache/BTreeUniqueIndex.h" -#include "DBCache/ClientCache.h" -#include "DBCache/TableCache.h" - -void UIndexedTable2Table::PostInitialize() -{ - /** Client cache init and setting up indexes*/ - Data = MakeShared>(); - - TSharedPtr> IndexedTable2Table = Data->GetOrAdd(TableName); - - // Register a new multi-key B-Tree index named "player_id_snazz_index" on the IndexedTable2Table. - IndexedTable2Table->AddMultiKeyBTreeIndex>( - TEXT("player_id_snazz_index"), - [](const FIndexedTable2Type& Row) - { - // This tuple is stored in the B-Tree index for fast composite key lookups. - return MakeTuple(Row.PlayerId, Row.PlayerSnazz); - } - ); - - PlayerIdSnazzIndex = NewObject(this); - PlayerIdSnazzIndex->SetCache(IndexedTable2Table); - - /***/ -} - -FTableAppliedDiff UIndexedTable2Table::Update(TArray> InsertsRef, TArray> DeletesRef) -{ - FTableAppliedDiff Diff = BaseUpdate(InsertsRef, DeletesRef, Data, TableName); - - return Diff; -} - -int32 UIndexedTable2Table::Count() const -{ - return GetRowCountFromTable(Data, TableName); -} - -TArray UIndexedTable2Table::Iter() const -{ - return GetAllRowsFromTable(Data, TableName); -} diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/IndexedTableTable.g.cpp b/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/IndexedTableTable.g.cpp deleted file mode 100644 index 5f4755f7b1b..00000000000 --- a/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/IndexedTableTable.g.cpp +++ /dev/null @@ -1,48 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE -// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. - -#include "ModuleBindings/Tables/IndexedTableTable.g.h" -#include "DBCache/UniqueIndex.h" -#include "DBCache/BTreeUniqueIndex.h" -#include "DBCache/ClientCache.h" -#include "DBCache/TableCache.h" - -void UIndexedTableTable::PostInitialize() -{ - /** Client cache init and setting up indexes*/ - Data = MakeShared>(); - - TSharedPtr> IndexedTableTable = Data->GetOrAdd(TableName); - - // Register a new multi-key B-Tree index named "player_id" on the IndexedTableTable. - IndexedTableTable->AddMultiKeyBTreeIndex>( - TEXT("player_id"), - [](const FIndexedTableType& Row) - { - // This tuple is stored in the B-Tree index for fast composite key lookups. - return MakeTuple(Row.PlayerId); - } - ); - - PlayerId = NewObject(this); - PlayerId->SetCache(IndexedTableTable); - - /***/ -} - -FTableAppliedDiff UIndexedTableTable::Update(TArray> InsertsRef, TArray> DeletesRef) -{ - FTableAppliedDiff Diff = BaseUpdate(InsertsRef, DeletesRef, Data, TableName); - - return Diff; -} - -int32 UIndexedTableTable::Count() const -{ - return GetRowCountFromTable(Data, TableName); -} - -TArray UIndexedTableTable::Iter() const -{ - return GetAllRowsFromTable(Data, TableName); -} diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/SpacetimeDBClient.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/SpacetimeDBClient.g.h index d87a51e16d1..ef4c228a95b 100644 --- a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/SpacetimeDBClient.g.h +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/SpacetimeDBClient.g.h @@ -1,7 +1,7 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.11.2 (commit e090367c50e718fe19fbf827206a7516502288a9). +// This was generated using spacetimedb cli version 1.12.0 (commit 819069447d9034135872ce2bdc28722c4e5e46b6). #pragma once #include "CoreMinimal.h" @@ -249,8 +249,6 @@ class USubscriptionHandle; /** Forward declaration for tables */ class UBtreeU32Table; class UIndexedSimpleEnumTable; -class UIndexedTableTable; -class UIndexedTable2Table; class ULargeTableTable; class UOneBoolTable; class UOneByteStructTable; @@ -7597,12 +7595,6 @@ class TESTCLIENT_API URemoteTables : public UObject UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") UIndexedSimpleEnumTable* IndexedSimpleEnum; - UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") - UIndexedTableTable* IndexedTable; - - UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") - UIndexedTable2Table* IndexedTable2; - UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") ULargeTableTable* LargeTable; diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/IndexedTable2Table.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/IndexedTable2Table.g.h deleted file mode 100644 index c943ba5e3bd..00000000000 --- a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/IndexedTable2Table.g.h +++ /dev/null @@ -1,101 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE -// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. - -#pragma once -#include "CoreMinimal.h" -#include "BSATN/UESpacetimeDB.h" -#include "Types/Builtins.h" -#include "ModuleBindings/Types/IndexedTable2Type.g.h" -#include "Tables/RemoteTable.h" -#include "DBCache/WithBsatn.h" -#include "DBCache/TableHandle.h" -#include "DBCache/TableCache.h" -#include "IndexedTable2Table.g.generated.h" - -UCLASS(Blueprintable) -class UIndexedTable2PlayerIdSnazzIndexIndex : public UObject -{ - GENERATED_BODY() - -public: - TArray Filter(const uint32& PlayerId, const float& PlayerSnazz) const - { - TArray OutResults; - - LocalCache->FindByMultiKeyBTreeIndex>( - OutResults, - TEXT("player_id_snazz_index"), - MakeTuple(PlayerId, PlayerSnazz) - ); - - return OutResults; - } - - void SetCache(TSharedPtr> InCache) - { - LocalCache = InCache; - } - -private: - // NOTE: Not exposed to Blueprint because some parameter types are not Blueprint-compatible - void FilterPlayerIdPlayerSnazz(TArray& OutResults, const uint32& PlayerId, const float& PlayerSnazz) - { - OutResults = Filter(PlayerId, PlayerSnazz); - } - - TSharedPtr> LocalCache; -}; - -UCLASS(BlueprintType) -class TESTCLIENT_API UIndexedTable2Table : public URemoteTable -{ - GENERATED_BODY() - -public: - UPROPERTY(BlueprintReadOnly) - UIndexedTable2PlayerIdSnazzIndexIndex* PlayerIdSnazzIndex; - - void PostInitialize(); - - /** Update function for indexed_table_2 table*/ - FTableAppliedDiff Update(TArray> InsertsRef, TArray> DeletesRef); - - /** Number of subscribed rows currently in the cache */ - UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") - int32 Count() const; - - /** Return all subscribed rows in the cache */ - UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") - TArray Iter() const; - - // Table Events - DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( - FOnIndexedTable2Insert, - const FEventContext&, Context, - const FIndexedTable2Type&, NewRow); - - DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams( - FOnIndexedTable2Update, - const FEventContext&, Context, - const FIndexedTable2Type&, OldRow, - const FIndexedTable2Type&, NewRow); - - DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( - FOnIndexedTable2Delete, - const FEventContext&, Context, - const FIndexedTable2Type&, DeletedRow); - - UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") - FOnIndexedTable2Insert OnInsert; - - UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") - FOnIndexedTable2Update OnUpdate; - - UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") - FOnIndexedTable2Delete OnDelete; - -private: - const FString TableName = TEXT("indexed_table_2"); - - TSharedPtr> Data; -}; diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/IndexedTableTable.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/IndexedTableTable.g.h deleted file mode 100644 index 0280e19a2c1..00000000000 --- a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/IndexedTableTable.g.h +++ /dev/null @@ -1,101 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE -// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. - -#pragma once -#include "CoreMinimal.h" -#include "BSATN/UESpacetimeDB.h" -#include "Types/Builtins.h" -#include "ModuleBindings/Types/IndexedTableType.g.h" -#include "Tables/RemoteTable.h" -#include "DBCache/WithBsatn.h" -#include "DBCache/TableHandle.h" -#include "DBCache/TableCache.h" -#include "IndexedTableTable.g.generated.h" - -UCLASS(Blueprintable) -class UIndexedTablePlayerIdIndex : public UObject -{ - GENERATED_BODY() - -public: - TArray Filter(const uint32& PlayerId) const - { - TArray OutResults; - - LocalCache->FindByMultiKeyBTreeIndex>( - OutResults, - TEXT("player_id"), - MakeTuple(PlayerId) - ); - - return OutResults; - } - - void SetCache(TSharedPtr> InCache) - { - LocalCache = InCache; - } - -private: - // NOTE: Not exposed to Blueprint because some parameter types are not Blueprint-compatible - void FilterPlayerId(TArray& OutResults, const uint32& PlayerId) - { - OutResults = Filter(PlayerId); - } - - TSharedPtr> LocalCache; -}; - -UCLASS(BlueprintType) -class TESTCLIENT_API UIndexedTableTable : public URemoteTable -{ - GENERATED_BODY() - -public: - UPROPERTY(BlueprintReadOnly) - UIndexedTablePlayerIdIndex* PlayerId; - - void PostInitialize(); - - /** Update function for indexed_table table*/ - FTableAppliedDiff Update(TArray> InsertsRef, TArray> DeletesRef); - - /** Number of subscribed rows currently in the cache */ - UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") - int32 Count() const; - - /** Return all subscribed rows in the cache */ - UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") - TArray Iter() const; - - // Table Events - DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( - FOnIndexedTableInsert, - const FEventContext&, Context, - const FIndexedTableType&, NewRow); - - DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams( - FOnIndexedTableUpdate, - const FEventContext&, Context, - const FIndexedTableType&, OldRow, - const FIndexedTableType&, NewRow); - - DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( - FOnIndexedTableDelete, - const FEventContext&, Context, - const FIndexedTableType&, DeletedRow); - - UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") - FOnIndexedTableInsert OnInsert; - - UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") - FOnIndexedTableUpdate OnUpdate; - - UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") - FOnIndexedTableDelete OnDelete; - -private: - const FString TableName = TEXT("indexed_table"); - - TSharedPtr> Data; -}; diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/EnumWithPayloadType.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/EnumWithPayloadType.g.h index 4557262a45c..ecd68f0d197 100644 --- a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/EnumWithPayloadType.g.h +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/EnumWithPayloadType.g.h @@ -4,9 +4,9 @@ #pragma once #include "CoreMinimal.h" #include "BSATN/UESpacetimeDB.h" -#include "Kismet/BlueprintFunctionLibrary.h" #include "Types/Builtins.h" #include "ModuleBindings/Types/SimpleEnumType.g.h" +#include "Kismet/BlueprintFunctionLibrary.h" #include "EnumWithPayloadType.g.generated.h" UENUM(BlueprintType) @@ -46,7 +46,7 @@ struct TESTCLIENT_API FEnumWithPayloadType public: FEnumWithPayloadType() = default; - TVariant, FSpacetimeDBTimestamp, FSpacetimeDBUInt256, TArray, uint8, int64, int16, uint32, uint64, FSpacetimeDBInt256, int32, uint16, FSpacetimeDBIdentity, TArray, int8, float, FSpacetimeDBConnectionId, TArray, FSpacetimeDBInt128, bool> MessageData; + TVariant, FSpacetimeDBUuid, FSpacetimeDBInt128, FString, int32, TArray, TArray, uint16, uint64, int64, float, bool, FSpacetimeDBUInt256, FSpacetimeDBUInt128, FSpacetimeDBConnectionId, uint8, FSpacetimeDBIdentity, uint32, double, FSpacetimeDBTimestamp, int8, FSpacetimeDBInt256, int16, TArray> MessageData; UPROPERTY(BlueprintReadOnly) EEnumWithPayloadTag Tag = static_cast(0); diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/Tests/UmbreallaHeaderaTables.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/Tests/UmbreallaHeaderaTables.h index f79650429f5..331e301a2da 100644 --- a/sdks/unreal/tests/TestClient/Source/TestClient/Public/Tests/UmbreallaHeaderaTables.h +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/Tests/UmbreallaHeaderaTables.h @@ -1,8 +1,6 @@ //Include Tables #include "ModuleBindings/Tables/BtreeU32Table.g.h" #include "ModuleBindings/Tables/IndexedSimpleEnumTable.g.h" -#include "ModuleBindings/Tables/IndexedTable2Table.g.h" -#include "ModuleBindings/Tables/IndexedTableTable.g.h" #include "ModuleBindings/Tables/LargeTableTable.g.h" #include "ModuleBindings/Tables/OneBoolTable.g.h" #include "ModuleBindings/Tables/OneByteStructTable.g.h" diff --git a/sdks/unreal/tests/TestProcClient/Source/TestProcClient/Private/ModuleBindings/SpacetimeDBClient.g.cpp b/sdks/unreal/tests/TestProcClient/Source/TestProcClient/Private/ModuleBindings/SpacetimeDBClient.g.cpp index 10d056bf5da..ee361b58397 100644 --- a/sdks/unreal/tests/TestProcClient/Source/TestProcClient/Private/ModuleBindings/SpacetimeDBClient.g.cpp +++ b/sdks/unreal/tests/TestProcClient/Source/TestProcClient/Private/ModuleBindings/SpacetimeDBClient.g.cpp @@ -7,7 +7,6 @@ #include "ModuleBindings/Tables/MyTableTable.g.h" #include "ModuleBindings/Tables/PkUuidTable.g.h" #include "ModuleBindings/Tables/ProcInsertsIntoTable.g.h" -#include "ModuleBindings/Tables/ScheduledProcTableTable.g.h" static FReducer DecodeReducer(const FReducerEvent& Event) { @@ -39,7 +38,6 @@ UDbConnection::UDbConnection(const FObjectInitializer& ObjectInitializer) : Supe RegisterTable(TEXT("my_table"), Db->MyTable); RegisterTable(TEXT("pk_uuid"), Db->PkUuid); RegisterTable(TEXT("proc_inserts_into"), Db->ProcInsertsInto); - RegisterTable(TEXT("scheduled_proc_table"), Db->ScheduledProcTable); } FContextBase::FContextBase(UDbConnection* InConn) @@ -78,14 +76,12 @@ void URemoteTables::Initialize() MyTable = NewObject(this); PkUuid = NewObject(this); ProcInsertsInto = NewObject(this); - ScheduledProcTable = NewObject(this); /**/ /** Initialization */ MyTable->PostInitialize(); PkUuid->PostInitialize(); ProcInsertsInto->PostInitialize(); - ScheduledProcTable->PostInitialize(); /**/ } diff --git a/sdks/unreal/tests/TestProcClient/Source/TestProcClient/Private/ModuleBindings/Tables/ScheduledProcTableTable.g.cpp b/sdks/unreal/tests/TestProcClient/Source/TestProcClient/Private/ModuleBindings/Tables/ScheduledProcTableTable.g.cpp deleted file mode 100644 index e6f6502d7a7..00000000000 --- a/sdks/unreal/tests/TestProcClient/Source/TestProcClient/Private/ModuleBindings/Tables/ScheduledProcTableTable.g.cpp +++ /dev/null @@ -1,47 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE -// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. - -#include "ModuleBindings/Tables/ScheduledProcTableTable.g.h" -#include "DBCache/UniqueIndex.h" -#include "DBCache/BTreeUniqueIndex.h" -#include "DBCache/ClientCache.h" -#include "DBCache/TableCache.h" - -void UScheduledProcTableTable::PostInitialize() -{ - /** Client cache init and setting up indexes*/ - Data = MakeShared>(); - - TSharedPtr> ScheduledProcTableTable = Data->GetOrAdd(TableName); - ScheduledProcTableTable->AddUniqueConstraint("scheduled_id", [](const FScheduledProcTableType& Row) -> const uint64& { - return Row.ScheduledId; }); - - ScheduledId = NewObject(this); - ScheduledId->SetCache(ScheduledProcTableTable); - - /***/ -} - -FTableAppliedDiff UScheduledProcTableTable::Update(TArray> InsertsRef, TArray> DeletesRef) -{ - FTableAppliedDiff Diff = BaseUpdate(InsertsRef, DeletesRef, Data, TableName); - - Diff.DeriveUpdatesByPrimaryKey( - [](const FScheduledProcTableType& Row) - { - return Row.ScheduledId; - } - ); - - return Diff; -} - -int32 UScheduledProcTableTable::Count() const -{ - return GetRowCountFromTable(Data, TableName); -} - -TArray UScheduledProcTableTable::Iter() const -{ - return GetAllRowsFromTable(Data, TableName); -} diff --git a/sdks/unreal/tests/TestProcClient/Source/TestProcClient/Public/ModuleBindings/SpacetimeDBClient.g.h b/sdks/unreal/tests/TestProcClient/Source/TestProcClient/Public/ModuleBindings/SpacetimeDBClient.g.h index c37059835d5..700fdb983f8 100644 --- a/sdks/unreal/tests/TestProcClient/Source/TestProcClient/Public/ModuleBindings/SpacetimeDBClient.g.h +++ b/sdks/unreal/tests/TestProcClient/Source/TestProcClient/Public/ModuleBindings/SpacetimeDBClient.g.h @@ -1,7 +1,7 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.11.2 (commit e090367c50e718fe19fbf827206a7516502288a9). +// This was generated using spacetimedb cli version 1.12.0 (commit 819069447d9034135872ce2bdc28722c4e5e46b6). #pragma once #include "CoreMinimal.h" @@ -44,7 +44,6 @@ class USubscriptionHandle; class UMyTableTable; class UPkUuidTable; class UProcInsertsIntoTable; -class UScheduledProcTableTable; /***/ // Delegates using the generated connection type. These wrap the base @@ -983,9 +982,6 @@ class TESTPROCCLIENT_API URemoteTables : public UObject UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") UProcInsertsIntoTable* ProcInsertsInto; - UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") - UScheduledProcTableTable* ScheduledProcTable; - }; // RemoteReducers class diff --git a/sdks/unreal/tests/TestProcClient/Source/TestProcClient/Public/ModuleBindings/Tables/ScheduledProcTableTable.g.h b/sdks/unreal/tests/TestProcClient/Source/TestProcClient/Public/ModuleBindings/Tables/ScheduledProcTableTable.g.h deleted file mode 100644 index b3838b0c979..00000000000 --- a/sdks/unreal/tests/TestProcClient/Source/TestProcClient/Public/ModuleBindings/Tables/ScheduledProcTableTable.g.h +++ /dev/null @@ -1,104 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE -// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. - -#pragma once -#include "CoreMinimal.h" -#include "BSATN/UESpacetimeDB.h" -#include "Types/Builtins.h" -#include "ModuleBindings/Types/ScheduledProcTableType.g.h" -#include "Tables/RemoteTable.h" -#include "DBCache/WithBsatn.h" -#include "DBCache/TableHandle.h" -#include "DBCache/TableCache.h" -#include "ScheduledProcTableTable.g.generated.h" - -UCLASS(Blueprintable) -class TESTPROCCLIENT_API UScheduledProcTableScheduledIdUniqueIndex : public UObject -{ - GENERATED_BODY() - -private: - // Declare an instance of your templated helper. - // It's private because the UObject wrapper will expose its functionality. - FUniqueIndexHelper> ScheduledIdIndexHelper; - -public: - UScheduledProcTableScheduledIdUniqueIndex() - // Initialize the helper with the specific unique index name - : ScheduledIdIndexHelper("scheduled_id") { - } - - /** - * Finds a ScheduledProcTable by their unique scheduledid. - * @param Key The scheduledid to search for. - * @return The found FScheduledProcTableType, or a default-constructed FScheduledProcTableType if not found. - */ - // NOTE: Not exposed to Blueprint because uint64 types are not Blueprint-compatible - FScheduledProcTableType Find(uint64 Key) - { - // Simply delegate the call to the internal helper - return ScheduledIdIndexHelper.FindUniqueIndex(Key); - } - - // A public setter to provide the cache to the helper after construction - // This is a common pattern when the cache might be created or provided by another system. - void SetCache(TSharedPtr> InScheduledProcTableCache) - { - ScheduledIdIndexHelper.Cache = InScheduledProcTableCache; - } -}; -/***/ - -UCLASS(BlueprintType) -class TESTPROCCLIENT_API UScheduledProcTableTable : public URemoteTable -{ - GENERATED_BODY() - -public: - UPROPERTY(BlueprintReadOnly) - UScheduledProcTableScheduledIdUniqueIndex* ScheduledId; - - void PostInitialize(); - - /** Update function for scheduled_proc_table table*/ - FTableAppliedDiff Update(TArray> InsertsRef, TArray> DeletesRef); - - /** Number of subscribed rows currently in the cache */ - UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") - int32 Count() const; - - /** Return all subscribed rows in the cache */ - UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") - TArray Iter() const; - - // Table Events - DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( - FOnScheduledProcTableInsert, - const FEventContext&, Context, - const FScheduledProcTableType&, NewRow); - - DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams( - FOnScheduledProcTableUpdate, - const FEventContext&, Context, - const FScheduledProcTableType&, OldRow, - const FScheduledProcTableType&, NewRow); - - DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( - FOnScheduledProcTableDelete, - const FEventContext&, Context, - const FScheduledProcTableType&, DeletedRow); - - UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") - FOnScheduledProcTableInsert OnInsert; - - UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") - FOnScheduledProcTableUpdate OnUpdate; - - UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") - FOnScheduledProcTableDelete OnDelete; - -private: - const FString TableName = TEXT("scheduled_proc_table"); - - TSharedPtr> Data; -}; diff --git a/templates/chat-console-cs/spacetimedb/Lib.cs b/templates/chat-console-cs/spacetimedb/Lib.cs index 3d82175859a..020bf6c072b 100644 --- a/templates/chat-console-cs/spacetimedb/Lib.cs +++ b/templates/chat-console-cs/spacetimedb/Lib.cs @@ -24,7 +24,7 @@ public static void SetName(ReducerContext ctx, string name) { name = ValidateName(name); - if (ctx.Db.User.Identity.Find(ctx.Sender) is User user) + if (ctx.Db.User.Identity.Find(ctx.Sender()) is User user) { user.Name = name; ctx.Db.User.Identity.Update(user); @@ -49,7 +49,7 @@ public static void SendMessage(ReducerContext ctx, string text) ctx.Db.Message.Insert( new Message { - Sender = ctx.Sender, + Sender = ctx.Sender(), Text = text, Sent = ctx.Timestamp, } @@ -69,9 +69,9 @@ private static string ValidateMessage(string text) [Reducer(ReducerKind.ClientConnected)] public static void ClientConnected(ReducerContext ctx) { - Log.Info($"Connect {ctx.Sender}"); + Log.Info($"Connect {ctx.Sender()}"); - if (ctx.Db.User.Identity.Find(ctx.Sender) is User user) + if (ctx.Db.User.Identity.Find(ctx.Sender()) is User user) { // If this is a returning user, i.e., we already have a `User` with this `Identity`, // set `Online: true`, but leave `Name` and `Identity` unchanged. @@ -86,7 +86,7 @@ public static void ClientConnected(ReducerContext ctx) new User { Name = null, - Identity = ctx.Sender, + Identity = ctx.Sender(), Online = true, } ); @@ -96,7 +96,7 @@ public static void ClientConnected(ReducerContext ctx) [Reducer(ReducerKind.ClientDisconnected)] public static void ClientDisconnected(ReducerContext ctx) { - if (ctx.Db.User.Identity.Find(ctx.Sender) is User user) + if (ctx.Db.User.Identity.Find(ctx.Sender()) is User user) { // This user should exist, so set `Online: false`. user.Online = false;