From 00d7e0443ad08654207088ba68964da08664ff2d Mon Sep 17 00:00:00 2001 From: Shubham Mishra Date: Tue, 10 Feb 2026 10:55:49 +0530 Subject: [PATCH 1/3] Revert "[2/3] [Rust] Host changes for `RawModuleDefV10` (#4105)" This reverts commit fd3cdb3d0b285120e4551bcec724180d287618d0. --- .../Autogen/RawColumnDefaultValueV10.g.cs | 35 ---------- .../Internal/Autogen/RawConstraintDefV10.g.cs | 35 ---------- .../Internal/Autogen/RawIndexDefV10.g.cs | 39 ----------- .../Autogen/RawLifeCycleReducerDefV10.g.cs | 35 ---------- .../Internal/Autogen/RawModuleDef.g.cs | 3 +- .../Internal/Autogen/RawModuleDefV10.g.cs | 29 -------- .../Internal/Autogen/RawProcedureDefV10.g.cs | 45 ------------ .../Internal/Autogen/RawReducerDefV10.g.cs | 50 -------------- .../Internal/Autogen/RawScheduleDefV10.g.cs | 44 ------------ .../Autogen/RawScopedTypeNameV10.g.cs | 36 ---------- .../Internal/Autogen/RawSequenceDefV10.g.cs | 50 -------------- .../Internal/Autogen/RawTableDefV10.g.cs | 68 ------------------- .../Internal/Autogen/RawTypeDefV10.g.cs | 39 ----------- .../Internal/Autogen/RawViewDefV10.g.cs | 53 --------------- crates/core/src/host/module_common.rs | 9 ++- crates/core/src/host/v8/mod.rs | 4 +- crates/core/src/host/wasm_common.rs | 47 +------------ .../src/host/wasm_common/module_host_actor.rs | 5 +- .../core/src/host/wasmtime/wasmtime_module.rs | 23 ++----- 19 files changed, 20 insertions(+), 629 deletions(-) delete mode 100644 crates/bindings-csharp/Runtime/Internal/Autogen/RawColumnDefaultValueV10.g.cs delete mode 100644 crates/bindings-csharp/Runtime/Internal/Autogen/RawConstraintDefV10.g.cs delete mode 100644 crates/bindings-csharp/Runtime/Internal/Autogen/RawIndexDefV10.g.cs delete mode 100644 crates/bindings-csharp/Runtime/Internal/Autogen/RawLifeCycleReducerDefV10.g.cs delete mode 100644 crates/bindings-csharp/Runtime/Internal/Autogen/RawModuleDefV10.g.cs delete mode 100644 crates/bindings-csharp/Runtime/Internal/Autogen/RawProcedureDefV10.g.cs delete mode 100644 crates/bindings-csharp/Runtime/Internal/Autogen/RawReducerDefV10.g.cs delete mode 100644 crates/bindings-csharp/Runtime/Internal/Autogen/RawScheduleDefV10.g.cs delete mode 100644 crates/bindings-csharp/Runtime/Internal/Autogen/RawScopedTypeNameV10.g.cs delete mode 100644 crates/bindings-csharp/Runtime/Internal/Autogen/RawSequenceDefV10.g.cs delete mode 100644 crates/bindings-csharp/Runtime/Internal/Autogen/RawTableDefV10.g.cs delete mode 100644 crates/bindings-csharp/Runtime/Internal/Autogen/RawTypeDefV10.g.cs delete mode 100644 crates/bindings-csharp/Runtime/Internal/Autogen/RawViewDefV10.g.cs diff --git a/crates/bindings-csharp/Runtime/Internal/Autogen/RawColumnDefaultValueV10.g.cs b/crates/bindings-csharp/Runtime/Internal/Autogen/RawColumnDefaultValueV10.g.cs deleted file mode 100644 index 521aecf0e5c..00000000000 --- a/crates/bindings-csharp/Runtime/Internal/Autogen/RawColumnDefaultValueV10.g.cs +++ /dev/null @@ -1,35 +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 System.Collections.Generic; -using System.Runtime.Serialization; - -namespace SpacetimeDB.Internal -{ - [SpacetimeDB.Type] - [DataContract] - public sealed partial class RawColumnDefaultValueV10 - { - [DataMember(Name = "col_id")] - public ushort ColId; - [DataMember(Name = "value")] - public System.Collections.Generic.List Value; - - public RawColumnDefaultValueV10( - ushort ColId, - System.Collections.Generic.List Value - ) - { - this.ColId = ColId; - this.Value = Value; - } - - public RawColumnDefaultValueV10() - { - this.Value = new(); - } - } -} diff --git a/crates/bindings-csharp/Runtime/Internal/Autogen/RawConstraintDefV10.g.cs b/crates/bindings-csharp/Runtime/Internal/Autogen/RawConstraintDefV10.g.cs deleted file mode 100644 index b7890df2e8b..00000000000 --- a/crates/bindings-csharp/Runtime/Internal/Autogen/RawConstraintDefV10.g.cs +++ /dev/null @@ -1,35 +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 System.Collections.Generic; -using System.Runtime.Serialization; - -namespace SpacetimeDB.Internal -{ - [SpacetimeDB.Type] - [DataContract] - public sealed partial class RawConstraintDefV10 - { - [DataMember(Name = "source_name")] - public string? SourceName; - [DataMember(Name = "data")] - public RawConstraintDataV9 Data; - - public RawConstraintDefV10( - string? SourceName, - RawConstraintDataV9 Data - ) - { - this.SourceName = SourceName; - this.Data = Data; - } - - public RawConstraintDefV10() - { - this.Data = null!; - } - } -} diff --git a/crates/bindings-csharp/Runtime/Internal/Autogen/RawIndexDefV10.g.cs b/crates/bindings-csharp/Runtime/Internal/Autogen/RawIndexDefV10.g.cs deleted file mode 100644 index 3d228709d7d..00000000000 --- a/crates/bindings-csharp/Runtime/Internal/Autogen/RawIndexDefV10.g.cs +++ /dev/null @@ -1,39 +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 System.Collections.Generic; -using System.Runtime.Serialization; - -namespace SpacetimeDB.Internal -{ - [SpacetimeDB.Type] - [DataContract] - public sealed partial class RawIndexDefV10 - { - [DataMember(Name = "source_name")] - public string? SourceName; - [DataMember(Name = "accessor_name")] - public string? AccessorName; - [DataMember(Name = "algorithm")] - public RawIndexAlgorithm Algorithm; - - public RawIndexDefV10( - string? SourceName, - string? AccessorName, - RawIndexAlgorithm Algorithm - ) - { - this.SourceName = SourceName; - this.AccessorName = AccessorName; - this.Algorithm = Algorithm; - } - - public RawIndexDefV10() - { - this.Algorithm = null!; - } - } -} diff --git a/crates/bindings-csharp/Runtime/Internal/Autogen/RawLifeCycleReducerDefV10.g.cs b/crates/bindings-csharp/Runtime/Internal/Autogen/RawLifeCycleReducerDefV10.g.cs deleted file mode 100644 index 973404d4c5c..00000000000 --- a/crates/bindings-csharp/Runtime/Internal/Autogen/RawLifeCycleReducerDefV10.g.cs +++ /dev/null @@ -1,35 +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 System.Collections.Generic; -using System.Runtime.Serialization; - -namespace SpacetimeDB.Internal -{ - [SpacetimeDB.Type] - [DataContract] - public sealed partial class RawLifeCycleReducerDefV10 - { - [DataMember(Name = "lifecycle_spec")] - public Lifecycle LifecycleSpec; - [DataMember(Name = "function_name")] - public string FunctionName; - - public RawLifeCycleReducerDefV10( - Lifecycle LifecycleSpec, - string FunctionName - ) - { - this.LifecycleSpec = LifecycleSpec; - this.FunctionName = FunctionName; - } - - public RawLifeCycleReducerDefV10() - { - this.FunctionName = ""; - } - } -} diff --git a/crates/bindings-csharp/Runtime/Internal/Autogen/RawModuleDef.g.cs b/crates/bindings-csharp/Runtime/Internal/Autogen/RawModuleDef.g.cs index d6d5d9f52a4..132e6910bcf 100644 --- a/crates/bindings-csharp/Runtime/Internal/Autogen/RawModuleDef.g.cs +++ b/crates/bindings-csharp/Runtime/Internal/Autogen/RawModuleDef.g.cs @@ -10,7 +10,6 @@ namespace SpacetimeDB.Internal [SpacetimeDB.Type] public partial record RawModuleDef : SpacetimeDB.TaggedEnum<( RawModuleDefV8 V8BackCompat, - RawModuleDefV9 V9, - RawModuleDefV10 V10 + RawModuleDefV9 V9 )>; } diff --git a/crates/bindings-csharp/Runtime/Internal/Autogen/RawModuleDefV10.g.cs b/crates/bindings-csharp/Runtime/Internal/Autogen/RawModuleDefV10.g.cs deleted file mode 100644 index da7cd6272bc..00000000000 --- a/crates/bindings-csharp/Runtime/Internal/Autogen/RawModuleDefV10.g.cs +++ /dev/null @@ -1,29 +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 System.Collections.Generic; -using System.Runtime.Serialization; - -namespace SpacetimeDB.Internal -{ - [SpacetimeDB.Type] - [DataContract] - public sealed partial class RawModuleDefV10 - { - [DataMember(Name = "sections")] - public System.Collections.Generic.List Sections; - - public RawModuleDefV10(System.Collections.Generic.List Sections) - { - this.Sections = Sections; - } - - public RawModuleDefV10() - { - this.Sections = new(); - } - } -} diff --git a/crates/bindings-csharp/Runtime/Internal/Autogen/RawProcedureDefV10.g.cs b/crates/bindings-csharp/Runtime/Internal/Autogen/RawProcedureDefV10.g.cs deleted file mode 100644 index 07f05ad075c..00000000000 --- a/crates/bindings-csharp/Runtime/Internal/Autogen/RawProcedureDefV10.g.cs +++ /dev/null @@ -1,45 +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 System.Collections.Generic; -using System.Runtime.Serialization; - -namespace SpacetimeDB.Internal -{ - [SpacetimeDB.Type] - [DataContract] - public sealed partial class RawProcedureDefV10 - { - [DataMember(Name = "source_name")] - public string SourceName; - [DataMember(Name = "params")] - public List Params; - [DataMember(Name = "return_type")] - public SpacetimeDB.BSATN.AlgebraicType ReturnType; - [DataMember(Name = "visibility")] - public FunctionVisibility Visibility; - - public RawProcedureDefV10( - string SourceName, - List Params, - SpacetimeDB.BSATN.AlgebraicType ReturnType, - FunctionVisibility Visibility - ) - { - this.SourceName = SourceName; - this.Params = Params; - this.ReturnType = ReturnType; - this.Visibility = Visibility; - } - - public RawProcedureDefV10() - { - this.SourceName = ""; - this.Params = new(); - this.ReturnType = null!; - } - } -} diff --git a/crates/bindings-csharp/Runtime/Internal/Autogen/RawReducerDefV10.g.cs b/crates/bindings-csharp/Runtime/Internal/Autogen/RawReducerDefV10.g.cs deleted file mode 100644 index f18ed5864f1..00000000000 --- a/crates/bindings-csharp/Runtime/Internal/Autogen/RawReducerDefV10.g.cs +++ /dev/null @@ -1,50 +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 System.Collections.Generic; -using System.Runtime.Serialization; - -namespace SpacetimeDB.Internal -{ - [SpacetimeDB.Type] - [DataContract] - public sealed partial class RawReducerDefV10 - { - [DataMember(Name = "source_name")] - public string SourceName; - [DataMember(Name = "params")] - public List Params; - [DataMember(Name = "visibility")] - public FunctionVisibility Visibility; - [DataMember(Name = "ok_return_type")] - public SpacetimeDB.BSATN.AlgebraicType OkReturnType; - [DataMember(Name = "err_return_type")] - public SpacetimeDB.BSATN.AlgebraicType ErrReturnType; - - public RawReducerDefV10( - string SourceName, - List Params, - FunctionVisibility Visibility, - SpacetimeDB.BSATN.AlgebraicType OkReturnType, - SpacetimeDB.BSATN.AlgebraicType ErrReturnType - ) - { - this.SourceName = SourceName; - this.Params = Params; - this.Visibility = Visibility; - this.OkReturnType = OkReturnType; - this.ErrReturnType = ErrReturnType; - } - - public RawReducerDefV10() - { - this.SourceName = ""; - this.Params = new(); - this.OkReturnType = null!; - this.ErrReturnType = null!; - } - } -} diff --git a/crates/bindings-csharp/Runtime/Internal/Autogen/RawScheduleDefV10.g.cs b/crates/bindings-csharp/Runtime/Internal/Autogen/RawScheduleDefV10.g.cs deleted file mode 100644 index 54963e908ce..00000000000 --- a/crates/bindings-csharp/Runtime/Internal/Autogen/RawScheduleDefV10.g.cs +++ /dev/null @@ -1,44 +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 System.Collections.Generic; -using System.Runtime.Serialization; - -namespace SpacetimeDB.Internal -{ - [SpacetimeDB.Type] - [DataContract] - public sealed partial class RawScheduleDefV10 - { - [DataMember(Name = "source_name")] - public string? SourceName; - [DataMember(Name = "table_name")] - public string TableName; - [DataMember(Name = "schedule_at_col")] - public ushort ScheduleAtCol; - [DataMember(Name = "function_name")] - public string FunctionName; - - public RawScheduleDefV10( - string? SourceName, - string TableName, - ushort ScheduleAtCol, - string FunctionName - ) - { - this.SourceName = SourceName; - this.TableName = TableName; - this.ScheduleAtCol = ScheduleAtCol; - this.FunctionName = FunctionName; - } - - public RawScheduleDefV10() - { - this.TableName = ""; - this.FunctionName = ""; - } - } -} diff --git a/crates/bindings-csharp/Runtime/Internal/Autogen/RawScopedTypeNameV10.g.cs b/crates/bindings-csharp/Runtime/Internal/Autogen/RawScopedTypeNameV10.g.cs deleted file mode 100644 index 0c1decade34..00000000000 --- a/crates/bindings-csharp/Runtime/Internal/Autogen/RawScopedTypeNameV10.g.cs +++ /dev/null @@ -1,36 +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 System.Collections.Generic; -using System.Runtime.Serialization; - -namespace SpacetimeDB.Internal -{ - [SpacetimeDB.Type] - [DataContract] - public sealed partial class RawScopedTypeNameV10 - { - [DataMember(Name = "scope")] - public System.Collections.Generic.List Scope; - [DataMember(Name = "source_name")] - public string SourceName; - - public RawScopedTypeNameV10( - System.Collections.Generic.List Scope, - string SourceName - ) - { - this.Scope = Scope; - this.SourceName = SourceName; - } - - public RawScopedTypeNameV10() - { - this.Scope = new(); - this.SourceName = ""; - } - } -} diff --git a/crates/bindings-csharp/Runtime/Internal/Autogen/RawSequenceDefV10.g.cs b/crates/bindings-csharp/Runtime/Internal/Autogen/RawSequenceDefV10.g.cs deleted file mode 100644 index fadb7b9fd89..00000000000 --- a/crates/bindings-csharp/Runtime/Internal/Autogen/RawSequenceDefV10.g.cs +++ /dev/null @@ -1,50 +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 System.Collections.Generic; -using System.Runtime.Serialization; - -namespace SpacetimeDB.Internal -{ - [SpacetimeDB.Type] - [DataContract] - public sealed partial class RawSequenceDefV10 - { - [DataMember(Name = "source_name")] - public string? SourceName; - [DataMember(Name = "column")] - public ushort Column; - [DataMember(Name = "start")] - public I128? Start; - [DataMember(Name = "min_value")] - public I128? MinValue; - [DataMember(Name = "max_value")] - public I128? MaxValue; - [DataMember(Name = "increment")] - public I128 Increment; - - public RawSequenceDefV10( - string? SourceName, - ushort Column, - I128? Start, - I128? MinValue, - I128? MaxValue, - I128 Increment - ) - { - this.SourceName = SourceName; - this.Column = Column; - this.Start = Start; - this.MinValue = MinValue; - this.MaxValue = MaxValue; - this.Increment = Increment; - } - - public RawSequenceDefV10() - { - } - } -} diff --git a/crates/bindings-csharp/Runtime/Internal/Autogen/RawTableDefV10.g.cs b/crates/bindings-csharp/Runtime/Internal/Autogen/RawTableDefV10.g.cs deleted file mode 100644 index 26d6ae5dcd6..00000000000 --- a/crates/bindings-csharp/Runtime/Internal/Autogen/RawTableDefV10.g.cs +++ /dev/null @@ -1,68 +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 System.Collections.Generic; -using System.Runtime.Serialization; - -namespace SpacetimeDB.Internal -{ - [SpacetimeDB.Type] - [DataContract] - public sealed partial class RawTableDefV10 - { - [DataMember(Name = "source_name")] - public string SourceName; - [DataMember(Name = "product_type_ref")] - public uint ProductTypeRef; - [DataMember(Name = "primary_key")] - public System.Collections.Generic.List PrimaryKey; - [DataMember(Name = "indexes")] - public System.Collections.Generic.List Indexes; - [DataMember(Name = "constraints")] - public System.Collections.Generic.List Constraints; - [DataMember(Name = "sequences")] - public System.Collections.Generic.List Sequences; - [DataMember(Name = "table_type")] - public TableType TableType; - [DataMember(Name = "table_access")] - public TableAccess TableAccess; - [DataMember(Name = "default_values")] - public System.Collections.Generic.List DefaultValues; - - public RawTableDefV10( - string SourceName, - uint ProductTypeRef, - System.Collections.Generic.List PrimaryKey, - System.Collections.Generic.List Indexes, - System.Collections.Generic.List Constraints, - System.Collections.Generic.List Sequences, - TableType TableType, - TableAccess TableAccess, - System.Collections.Generic.List DefaultValues - ) - { - this.SourceName = SourceName; - this.ProductTypeRef = ProductTypeRef; - this.PrimaryKey = PrimaryKey; - this.Indexes = Indexes; - this.Constraints = Constraints; - this.Sequences = Sequences; - this.TableType = TableType; - this.TableAccess = TableAccess; - this.DefaultValues = DefaultValues; - } - - public RawTableDefV10() - { - this.SourceName = ""; - this.PrimaryKey = new(); - this.Indexes = new(); - this.Constraints = new(); - this.Sequences = new(); - this.DefaultValues = new(); - } - } -} diff --git a/crates/bindings-csharp/Runtime/Internal/Autogen/RawTypeDefV10.g.cs b/crates/bindings-csharp/Runtime/Internal/Autogen/RawTypeDefV10.g.cs deleted file mode 100644 index 5185e41b4aa..00000000000 --- a/crates/bindings-csharp/Runtime/Internal/Autogen/RawTypeDefV10.g.cs +++ /dev/null @@ -1,39 +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 System.Collections.Generic; -using System.Runtime.Serialization; - -namespace SpacetimeDB.Internal -{ - [SpacetimeDB.Type] - [DataContract] - public sealed partial class RawTypeDefV10 - { - [DataMember(Name = "source_name")] - public RawScopedTypeNameV10 SourceName; - [DataMember(Name = "ty")] - public uint Ty; - [DataMember(Name = "custom_ordering")] - public bool CustomOrdering; - - public RawTypeDefV10( - RawScopedTypeNameV10 SourceName, - uint Ty, - bool CustomOrdering - ) - { - this.SourceName = SourceName; - this.Ty = Ty; - this.CustomOrdering = CustomOrdering; - } - - public RawTypeDefV10() - { - this.SourceName = new(); - } - } -} diff --git a/crates/bindings-csharp/Runtime/Internal/Autogen/RawViewDefV10.g.cs b/crates/bindings-csharp/Runtime/Internal/Autogen/RawViewDefV10.g.cs deleted file mode 100644 index 78c17bf03d9..00000000000 --- a/crates/bindings-csharp/Runtime/Internal/Autogen/RawViewDefV10.g.cs +++ /dev/null @@ -1,53 +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 System.Collections.Generic; -using System.Runtime.Serialization; - -namespace SpacetimeDB.Internal -{ - [SpacetimeDB.Type] - [DataContract] - public sealed partial class RawViewDefV10 - { - [DataMember(Name = "source_name")] - public string SourceName; - [DataMember(Name = "index")] - public uint Index; - [DataMember(Name = "is_public")] - public bool IsPublic; - [DataMember(Name = "is_anonymous")] - public bool IsAnonymous; - [DataMember(Name = "params")] - public List Params; - [DataMember(Name = "return_type")] - public SpacetimeDB.BSATN.AlgebraicType ReturnType; - - public RawViewDefV10( - string SourceName, - uint Index, - bool IsPublic, - bool IsAnonymous, - List Params, - SpacetimeDB.BSATN.AlgebraicType ReturnType - ) - { - this.SourceName = SourceName; - this.Index = Index; - this.IsPublic = IsPublic; - this.IsAnonymous = IsAnonymous; - this.Params = Params; - this.ReturnType = ReturnType; - } - - public RawViewDefV10() - { - this.SourceName = ""; - this.Params = new(); - this.ReturnType = null!; - } - } -} diff --git a/crates/core/src/host/module_common.rs b/crates/core/src/host/module_common.rs index f444560132b..2b3957f2449 100644 --- a/crates/core/src/host/module_common.rs +++ b/crates/core/src/host/module_common.rs @@ -3,7 +3,11 @@ use crate::{ energy::EnergyMonitor, - host::{module_host::ModuleInfo, wasm_common::module_host_actor::DescribeError, Scheduler}, + host::{ + module_host::ModuleInfo, + wasm_common::{module_host_actor::DescribeError, DESCRIBE_MODULE_DUNDER}, + Scheduler, + }, module_host_context::ModuleCreationContext, replica_context::ReplicaContext, }; @@ -86,10 +90,11 @@ impl ModuleCommon { /// Runs the describer of modules in `run` and does some logging around it. pub(crate) fn run_describer( - describer_func_name: &str, log_traceback: impl Copy + FnOnce(&str, &str, &anyhow::Error), run: impl FnOnce() -> anyhow::Result, ) -> Result { + let describer_func_name = DESCRIBE_MODULE_DUNDER; + let start = std::time::Instant::now(); log::trace!("Start describer \"{describer_func_name}\"..."); diff --git a/crates/core/src/host/v8/mod.rs b/crates/core/src/host/v8/mod.rs index e21a08e5747..c679df0f6e7 100644 --- a/crates/core/src/host/v8/mod.rs +++ b/crates/core/src/host/v8/mod.rs @@ -25,7 +25,7 @@ use crate::host::wasm_common::module_host_actor::{ InstanceOp, ProcedureExecuteResult, ProcedureOp, ReducerExecuteResult, ReducerOp, ViewExecuteResult, ViewOp, WasmInstance, }; -use crate::host::wasm_common::{RowIters, TimingSpanSet, DESCRIBE_MODULE_DUNDER}; +use crate::host::wasm_common::{RowIters, TimingSpanSet}; use crate::host::{ModuleHost, ReducerCallError, ReducerCallResult, Scheduler}; use crate::module_host_context::ModuleCreationContext; use crate::replica_context::ReplicaContext; @@ -925,8 +925,6 @@ fn extract_description<'scope>( replica_ctx: &ReplicaContext, ) -> Result { run_describer( - //TODO(shub): make it work with `DESCRIBE_MODULE_DUNDER_V10` - DESCRIBE_MODULE_DUNDER, |a, b, c| log_traceback(replica_ctx, a, b, c), || { catch_exception(scope, |scope| { diff --git a/crates/core/src/host/wasm_common.rs b/crates/core/src/host/wasm_common.rs index 9e58b8e67e1..a5c737d54d6 100644 --- a/crates/core/src/host/wasm_common.rs +++ b/crates/core/src/host/wasm_common.rs @@ -10,7 +10,6 @@ use super::{scheduler::ScheduleError, AbiCall}; use crate::error::{DBError, DatastoreError, IndexError, NodesError}; use spacetimedb_primitives::errno; use spacetimedb_sats::typespace::TypeRefError; -use spacetimedb_schema::def::RawModuleDefVersion; use spacetimedb_table::table::UniqueConstraintViolation; pub const CALL_REDUCER_DUNDER: &str = "__call_reducer__"; @@ -21,52 +20,13 @@ pub const CALL_VIEW_DUNDER: &str = "__call_view__"; pub const CALL_VIEW_ANON_DUNDER: &str = "__call_view_anon__"; -/// Name of the function that modules export to the host to describe themselves. -/// -/// Used by module definitions with versions up to -/// [`RawModuleDefVersion::V9OrEarlier`]. pub const DESCRIBE_MODULE_DUNDER: &str = "__describe_module__"; -/// Versioned variant of [`DESCRIBE_MODULE_DUNDER`] for -/// [`RawModuleDefVersion::V10`]. -pub const DESCRIBE_MODULE_DUNDER_V10: &str = "__describe_module_v10__"; - /// functions with this prefix run prior to __setup__, initializing global variables and the like pub const PREINIT_DUNDER: &str = "__preinit__"; /// initializes the user code in the module. fallible pub const SETUP_DUNDER: &str = "__setup__"; -/// Detects the [`RawModuleDefVersion`] of a module by checking for the presence -/// of a known describe function export. -pub fn detect_raw_def_version(module: &M) -> Result -where - M: module_host_actor::WasmModule, -{ - if module.get_export(DESCRIBE_MODULE_DUNDER).is_some() { - Ok(RawModuleDefVersion::V9OrEarlier) - } else if module.get_export(DESCRIBE_MODULE_DUNDER_V10).is_some() { - Ok(RawModuleDefVersion::V10) - } else { - Err(module_host_actor::DescribeError::Signature(anyhow::anyhow!( - "module does not export a {} or {} function", - DESCRIBE_MODULE_DUNDER, - DESCRIBE_MODULE_DUNDER_V10 - ))) - } -} -/// Returns the describe dunder symbol for a given module version. -pub const fn describe_dunder(version: RawModuleDefVersion) -> &'static str { - match version { - RawModuleDefVersion::V9OrEarlier => DESCRIBE_MODULE_DUNDER, - RawModuleDefVersion::V10 => DESCRIBE_MODULE_DUNDER_V10, - } -} - -/// Returns all known describe dunder symbols. -pub const fn describe_dunders() -> &'static [&'static str] { - &[DESCRIBE_MODULE_DUNDER, DESCRIBE_MODULE_DUNDER_V10] -} - #[derive(Debug, Clone)] #[allow(unused)] pub enum WasmType { @@ -269,7 +229,7 @@ impl FuncNames { } Ok(()) } - pub fn check_required(raw_def_ver: RawModuleDefVersion, get_export: F) -> Result<(), ValidationError> + pub fn check_required(get_export: F) -> Result<(), ValidationError> where F: Fn(&str) -> Option, T: FuncSigLike, @@ -283,9 +243,8 @@ impl FuncNames { let sig = get_func(CALL_REDUCER_DUNDER)?; Self::validate_signature("call_reducer", &sig, CALL_REDUCER_DUNDER, CALL_REDUCER_SIG)?; - let describe_dunder = describe_dunder(raw_def_ver); - let sig = get_func(describe_dunder)?; - Self::validate_signature("describe_module", &sig, describe_dunder, DESCRIBE_MODULE_SIG)?; + let sig = get_func(DESCRIBE_MODULE_DUNDER)?; + Self::validate_signature("describe_module", &sig, DESCRIBE_MODULE_DUNDER, DESCRIBE_MODULE_SIG)?; Ok(()) } diff --git a/crates/core/src/host/wasm_common/module_host_actor.rs b/crates/core/src/host/wasm_common/module_host_actor.rs index 720144113db..b7f5b84acd2 100644 --- a/crates/core/src/host/wasm_common/module_host_actor.rs +++ b/crates/core/src/host/wasm_common/module_host_actor.rs @@ -283,7 +283,7 @@ impl From for InitializationError { #[derive(thiserror::Error, Debug)] pub enum DescribeError { - #[error("failed to call descriptor function: invalid signature or function does not exist: {0}")] + #[error("bad signature for descriptor function: {0}")] Signature(anyhow::Error), #[error("error when preparing descriptor function: {0}")] Setup(anyhow::Error), @@ -304,9 +304,8 @@ impl WasmModuleHostActor { mcc.program_hash, ); - let raw_def_version = detect_raw_def_version(&module)?; let func_names = { - FuncNames::check_required(raw_def_version, |name| module.get_export(name))?; + FuncNames::check_required(|name| module.get_export(name))?; let mut func_names = FuncNames::default(); module.for_each_export(|sym, ty| func_names.update_from_general(sym, ty))?; func_names.preinits.sort_unstable(); diff --git a/crates/core/src/host/wasmtime/wasmtime_module.rs b/crates/core/src/host/wasmtime/wasmtime_module.rs index 71aab2c1ffb..f877b3aa6b9 100644 --- a/crates/core/src/host/wasmtime/wasmtime_module.rs +++ b/crates/core/src/host/wasmtime/wasmtime_module.rs @@ -352,27 +352,16 @@ pub struct WasmtimeInstance { impl module_host_actor::WasmInstance for WasmtimeInstance { fn extract_descriptions(&mut self) -> Result { - let mut describer_res = None; - for &describe_func_name in describe_dunders() { - match self - .instance - .get_typed_func::(&mut self.store, describe_func_name) - { - Ok(describer) => { - describer_res = Some(Ok((describe_func_name, describer))); - break; - } - Err(e) => describer_res = Some(Err(DescribeError::Signature(e))), - } - } + let describer_func_name = DESCRIBE_MODULE_DUNDER; - let (describer_func_name, describer) = describer_res - .transpose()? - .ok_or_else(|| DescribeError::Signature(anyhow::anyhow!("no describer function found")))?; + let describer = self + .instance + .get_typed_func::(&mut self.store, describer_func_name) + .map_err(DescribeError::Signature)?; let sink = self.store.data_mut().setup_standard_bytes_sink(); - run_describer(describer_func_name, log_traceback, || { + run_describer(log_traceback, || { call_sync_typed_func(&describer, &mut self.store, sink) })?; From 10af9d77d5b7a34c5428dd08070296f30671278d Mon Sep 17 00:00:00 2001 From: Shubham Mishra Date: Tue, 10 Feb 2026 11:00:19 +0530 Subject: [PATCH 2/3] autogen --- .../Autogen/RawColumnDefaultValueV10.g.cs | 35 ++++++++++ .../Internal/Autogen/RawConstraintDefV10.g.cs | 35 ++++++++++ .../Internal/Autogen/RawIndexDefV10.g.cs | 39 +++++++++++ .../Autogen/RawLifeCycleReducerDefV10.g.cs | 35 ++++++++++ .../Internal/Autogen/RawModuleDef.g.cs | 3 +- .../Internal/Autogen/RawModuleDefV10.g.cs | 29 ++++++++ .../Internal/Autogen/RawProcedureDefV10.g.cs | 45 ++++++++++++ .../Internal/Autogen/RawReducerDefV10.g.cs | 50 ++++++++++++++ .../Internal/Autogen/RawScheduleDefV10.g.cs | 44 ++++++++++++ .../Autogen/RawScopedTypeNameV10.g.cs | 36 ++++++++++ .../Internal/Autogen/RawSequenceDefV10.g.cs | 50 ++++++++++++++ .../Internal/Autogen/RawTableDefV10.g.cs | 68 +++++++++++++++++++ .../Internal/Autogen/RawTypeDefV10.g.cs | 39 +++++++++++ .../Internal/Autogen/RawViewDefV10.g.cs | 53 +++++++++++++++ 14 files changed, 560 insertions(+), 1 deletion(-) create mode 100644 crates/bindings-csharp/Runtime/Internal/Autogen/RawColumnDefaultValueV10.g.cs create mode 100644 crates/bindings-csharp/Runtime/Internal/Autogen/RawConstraintDefV10.g.cs create mode 100644 crates/bindings-csharp/Runtime/Internal/Autogen/RawIndexDefV10.g.cs create mode 100644 crates/bindings-csharp/Runtime/Internal/Autogen/RawLifeCycleReducerDefV10.g.cs create mode 100644 crates/bindings-csharp/Runtime/Internal/Autogen/RawModuleDefV10.g.cs create mode 100644 crates/bindings-csharp/Runtime/Internal/Autogen/RawProcedureDefV10.g.cs create mode 100644 crates/bindings-csharp/Runtime/Internal/Autogen/RawReducerDefV10.g.cs create mode 100644 crates/bindings-csharp/Runtime/Internal/Autogen/RawScheduleDefV10.g.cs create mode 100644 crates/bindings-csharp/Runtime/Internal/Autogen/RawScopedTypeNameV10.g.cs create mode 100644 crates/bindings-csharp/Runtime/Internal/Autogen/RawSequenceDefV10.g.cs create mode 100644 crates/bindings-csharp/Runtime/Internal/Autogen/RawTableDefV10.g.cs create mode 100644 crates/bindings-csharp/Runtime/Internal/Autogen/RawTypeDefV10.g.cs create mode 100644 crates/bindings-csharp/Runtime/Internal/Autogen/RawViewDefV10.g.cs diff --git a/crates/bindings-csharp/Runtime/Internal/Autogen/RawColumnDefaultValueV10.g.cs b/crates/bindings-csharp/Runtime/Internal/Autogen/RawColumnDefaultValueV10.g.cs new file mode 100644 index 00000000000..521aecf0e5c --- /dev/null +++ b/crates/bindings-csharp/Runtime/Internal/Autogen/RawColumnDefaultValueV10.g.cs @@ -0,0 +1,35 @@ +// 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 System.Collections.Generic; +using System.Runtime.Serialization; + +namespace SpacetimeDB.Internal +{ + [SpacetimeDB.Type] + [DataContract] + public sealed partial class RawColumnDefaultValueV10 + { + [DataMember(Name = "col_id")] + public ushort ColId; + [DataMember(Name = "value")] + public System.Collections.Generic.List Value; + + public RawColumnDefaultValueV10( + ushort ColId, + System.Collections.Generic.List Value + ) + { + this.ColId = ColId; + this.Value = Value; + } + + public RawColumnDefaultValueV10() + { + this.Value = new(); + } + } +} diff --git a/crates/bindings-csharp/Runtime/Internal/Autogen/RawConstraintDefV10.g.cs b/crates/bindings-csharp/Runtime/Internal/Autogen/RawConstraintDefV10.g.cs new file mode 100644 index 00000000000..b7890df2e8b --- /dev/null +++ b/crates/bindings-csharp/Runtime/Internal/Autogen/RawConstraintDefV10.g.cs @@ -0,0 +1,35 @@ +// 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 System.Collections.Generic; +using System.Runtime.Serialization; + +namespace SpacetimeDB.Internal +{ + [SpacetimeDB.Type] + [DataContract] + public sealed partial class RawConstraintDefV10 + { + [DataMember(Name = "source_name")] + public string? SourceName; + [DataMember(Name = "data")] + public RawConstraintDataV9 Data; + + public RawConstraintDefV10( + string? SourceName, + RawConstraintDataV9 Data + ) + { + this.SourceName = SourceName; + this.Data = Data; + } + + public RawConstraintDefV10() + { + this.Data = null!; + } + } +} diff --git a/crates/bindings-csharp/Runtime/Internal/Autogen/RawIndexDefV10.g.cs b/crates/bindings-csharp/Runtime/Internal/Autogen/RawIndexDefV10.g.cs new file mode 100644 index 00000000000..3d228709d7d --- /dev/null +++ b/crates/bindings-csharp/Runtime/Internal/Autogen/RawIndexDefV10.g.cs @@ -0,0 +1,39 @@ +// 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 System.Collections.Generic; +using System.Runtime.Serialization; + +namespace SpacetimeDB.Internal +{ + [SpacetimeDB.Type] + [DataContract] + public sealed partial class RawIndexDefV10 + { + [DataMember(Name = "source_name")] + public string? SourceName; + [DataMember(Name = "accessor_name")] + public string? AccessorName; + [DataMember(Name = "algorithm")] + public RawIndexAlgorithm Algorithm; + + public RawIndexDefV10( + string? SourceName, + string? AccessorName, + RawIndexAlgorithm Algorithm + ) + { + this.SourceName = SourceName; + this.AccessorName = AccessorName; + this.Algorithm = Algorithm; + } + + public RawIndexDefV10() + { + this.Algorithm = null!; + } + } +} diff --git a/crates/bindings-csharp/Runtime/Internal/Autogen/RawLifeCycleReducerDefV10.g.cs b/crates/bindings-csharp/Runtime/Internal/Autogen/RawLifeCycleReducerDefV10.g.cs new file mode 100644 index 00000000000..973404d4c5c --- /dev/null +++ b/crates/bindings-csharp/Runtime/Internal/Autogen/RawLifeCycleReducerDefV10.g.cs @@ -0,0 +1,35 @@ +// 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 System.Collections.Generic; +using System.Runtime.Serialization; + +namespace SpacetimeDB.Internal +{ + [SpacetimeDB.Type] + [DataContract] + public sealed partial class RawLifeCycleReducerDefV10 + { + [DataMember(Name = "lifecycle_spec")] + public Lifecycle LifecycleSpec; + [DataMember(Name = "function_name")] + public string FunctionName; + + public RawLifeCycleReducerDefV10( + Lifecycle LifecycleSpec, + string FunctionName + ) + { + this.LifecycleSpec = LifecycleSpec; + this.FunctionName = FunctionName; + } + + public RawLifeCycleReducerDefV10() + { + this.FunctionName = ""; + } + } +} diff --git a/crates/bindings-csharp/Runtime/Internal/Autogen/RawModuleDef.g.cs b/crates/bindings-csharp/Runtime/Internal/Autogen/RawModuleDef.g.cs index 132e6910bcf..d6d5d9f52a4 100644 --- a/crates/bindings-csharp/Runtime/Internal/Autogen/RawModuleDef.g.cs +++ b/crates/bindings-csharp/Runtime/Internal/Autogen/RawModuleDef.g.cs @@ -10,6 +10,7 @@ namespace SpacetimeDB.Internal [SpacetimeDB.Type] public partial record RawModuleDef : SpacetimeDB.TaggedEnum<( RawModuleDefV8 V8BackCompat, - RawModuleDefV9 V9 + RawModuleDefV9 V9, + RawModuleDefV10 V10 )>; } diff --git a/crates/bindings-csharp/Runtime/Internal/Autogen/RawModuleDefV10.g.cs b/crates/bindings-csharp/Runtime/Internal/Autogen/RawModuleDefV10.g.cs new file mode 100644 index 00000000000..da7cd6272bc --- /dev/null +++ b/crates/bindings-csharp/Runtime/Internal/Autogen/RawModuleDefV10.g.cs @@ -0,0 +1,29 @@ +// 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 System.Collections.Generic; +using System.Runtime.Serialization; + +namespace SpacetimeDB.Internal +{ + [SpacetimeDB.Type] + [DataContract] + public sealed partial class RawModuleDefV10 + { + [DataMember(Name = "sections")] + public System.Collections.Generic.List Sections; + + public RawModuleDefV10(System.Collections.Generic.List Sections) + { + this.Sections = Sections; + } + + public RawModuleDefV10() + { + this.Sections = new(); + } + } +} diff --git a/crates/bindings-csharp/Runtime/Internal/Autogen/RawProcedureDefV10.g.cs b/crates/bindings-csharp/Runtime/Internal/Autogen/RawProcedureDefV10.g.cs new file mode 100644 index 00000000000..07f05ad075c --- /dev/null +++ b/crates/bindings-csharp/Runtime/Internal/Autogen/RawProcedureDefV10.g.cs @@ -0,0 +1,45 @@ +// 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 System.Collections.Generic; +using System.Runtime.Serialization; + +namespace SpacetimeDB.Internal +{ + [SpacetimeDB.Type] + [DataContract] + public sealed partial class RawProcedureDefV10 + { + [DataMember(Name = "source_name")] + public string SourceName; + [DataMember(Name = "params")] + public List Params; + [DataMember(Name = "return_type")] + public SpacetimeDB.BSATN.AlgebraicType ReturnType; + [DataMember(Name = "visibility")] + public FunctionVisibility Visibility; + + public RawProcedureDefV10( + string SourceName, + List Params, + SpacetimeDB.BSATN.AlgebraicType ReturnType, + FunctionVisibility Visibility + ) + { + this.SourceName = SourceName; + this.Params = Params; + this.ReturnType = ReturnType; + this.Visibility = Visibility; + } + + public RawProcedureDefV10() + { + this.SourceName = ""; + this.Params = new(); + this.ReturnType = null!; + } + } +} diff --git a/crates/bindings-csharp/Runtime/Internal/Autogen/RawReducerDefV10.g.cs b/crates/bindings-csharp/Runtime/Internal/Autogen/RawReducerDefV10.g.cs new file mode 100644 index 00000000000..f18ed5864f1 --- /dev/null +++ b/crates/bindings-csharp/Runtime/Internal/Autogen/RawReducerDefV10.g.cs @@ -0,0 +1,50 @@ +// 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 System.Collections.Generic; +using System.Runtime.Serialization; + +namespace SpacetimeDB.Internal +{ + [SpacetimeDB.Type] + [DataContract] + public sealed partial class RawReducerDefV10 + { + [DataMember(Name = "source_name")] + public string SourceName; + [DataMember(Name = "params")] + public List Params; + [DataMember(Name = "visibility")] + public FunctionVisibility Visibility; + [DataMember(Name = "ok_return_type")] + public SpacetimeDB.BSATN.AlgebraicType OkReturnType; + [DataMember(Name = "err_return_type")] + public SpacetimeDB.BSATN.AlgebraicType ErrReturnType; + + public RawReducerDefV10( + string SourceName, + List Params, + FunctionVisibility Visibility, + SpacetimeDB.BSATN.AlgebraicType OkReturnType, + SpacetimeDB.BSATN.AlgebraicType ErrReturnType + ) + { + this.SourceName = SourceName; + this.Params = Params; + this.Visibility = Visibility; + this.OkReturnType = OkReturnType; + this.ErrReturnType = ErrReturnType; + } + + public RawReducerDefV10() + { + this.SourceName = ""; + this.Params = new(); + this.OkReturnType = null!; + this.ErrReturnType = null!; + } + } +} diff --git a/crates/bindings-csharp/Runtime/Internal/Autogen/RawScheduleDefV10.g.cs b/crates/bindings-csharp/Runtime/Internal/Autogen/RawScheduleDefV10.g.cs new file mode 100644 index 00000000000..54963e908ce --- /dev/null +++ b/crates/bindings-csharp/Runtime/Internal/Autogen/RawScheduleDefV10.g.cs @@ -0,0 +1,44 @@ +// 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 System.Collections.Generic; +using System.Runtime.Serialization; + +namespace SpacetimeDB.Internal +{ + [SpacetimeDB.Type] + [DataContract] + public sealed partial class RawScheduleDefV10 + { + [DataMember(Name = "source_name")] + public string? SourceName; + [DataMember(Name = "table_name")] + public string TableName; + [DataMember(Name = "schedule_at_col")] + public ushort ScheduleAtCol; + [DataMember(Name = "function_name")] + public string FunctionName; + + public RawScheduleDefV10( + string? SourceName, + string TableName, + ushort ScheduleAtCol, + string FunctionName + ) + { + this.SourceName = SourceName; + this.TableName = TableName; + this.ScheduleAtCol = ScheduleAtCol; + this.FunctionName = FunctionName; + } + + public RawScheduleDefV10() + { + this.TableName = ""; + this.FunctionName = ""; + } + } +} diff --git a/crates/bindings-csharp/Runtime/Internal/Autogen/RawScopedTypeNameV10.g.cs b/crates/bindings-csharp/Runtime/Internal/Autogen/RawScopedTypeNameV10.g.cs new file mode 100644 index 00000000000..0c1decade34 --- /dev/null +++ b/crates/bindings-csharp/Runtime/Internal/Autogen/RawScopedTypeNameV10.g.cs @@ -0,0 +1,36 @@ +// 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 System.Collections.Generic; +using System.Runtime.Serialization; + +namespace SpacetimeDB.Internal +{ + [SpacetimeDB.Type] + [DataContract] + public sealed partial class RawScopedTypeNameV10 + { + [DataMember(Name = "scope")] + public System.Collections.Generic.List Scope; + [DataMember(Name = "source_name")] + public string SourceName; + + public RawScopedTypeNameV10( + System.Collections.Generic.List Scope, + string SourceName + ) + { + this.Scope = Scope; + this.SourceName = SourceName; + } + + public RawScopedTypeNameV10() + { + this.Scope = new(); + this.SourceName = ""; + } + } +} diff --git a/crates/bindings-csharp/Runtime/Internal/Autogen/RawSequenceDefV10.g.cs b/crates/bindings-csharp/Runtime/Internal/Autogen/RawSequenceDefV10.g.cs new file mode 100644 index 00000000000..fadb7b9fd89 --- /dev/null +++ b/crates/bindings-csharp/Runtime/Internal/Autogen/RawSequenceDefV10.g.cs @@ -0,0 +1,50 @@ +// 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 System.Collections.Generic; +using System.Runtime.Serialization; + +namespace SpacetimeDB.Internal +{ + [SpacetimeDB.Type] + [DataContract] + public sealed partial class RawSequenceDefV10 + { + [DataMember(Name = "source_name")] + public string? SourceName; + [DataMember(Name = "column")] + public ushort Column; + [DataMember(Name = "start")] + public I128? Start; + [DataMember(Name = "min_value")] + public I128? MinValue; + [DataMember(Name = "max_value")] + public I128? MaxValue; + [DataMember(Name = "increment")] + public I128 Increment; + + public RawSequenceDefV10( + string? SourceName, + ushort Column, + I128? Start, + I128? MinValue, + I128? MaxValue, + I128 Increment + ) + { + this.SourceName = SourceName; + this.Column = Column; + this.Start = Start; + this.MinValue = MinValue; + this.MaxValue = MaxValue; + this.Increment = Increment; + } + + public RawSequenceDefV10() + { + } + } +} diff --git a/crates/bindings-csharp/Runtime/Internal/Autogen/RawTableDefV10.g.cs b/crates/bindings-csharp/Runtime/Internal/Autogen/RawTableDefV10.g.cs new file mode 100644 index 00000000000..26d6ae5dcd6 --- /dev/null +++ b/crates/bindings-csharp/Runtime/Internal/Autogen/RawTableDefV10.g.cs @@ -0,0 +1,68 @@ +// 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 System.Collections.Generic; +using System.Runtime.Serialization; + +namespace SpacetimeDB.Internal +{ + [SpacetimeDB.Type] + [DataContract] + public sealed partial class RawTableDefV10 + { + [DataMember(Name = "source_name")] + public string SourceName; + [DataMember(Name = "product_type_ref")] + public uint ProductTypeRef; + [DataMember(Name = "primary_key")] + public System.Collections.Generic.List PrimaryKey; + [DataMember(Name = "indexes")] + public System.Collections.Generic.List Indexes; + [DataMember(Name = "constraints")] + public System.Collections.Generic.List Constraints; + [DataMember(Name = "sequences")] + public System.Collections.Generic.List Sequences; + [DataMember(Name = "table_type")] + public TableType TableType; + [DataMember(Name = "table_access")] + public TableAccess TableAccess; + [DataMember(Name = "default_values")] + public System.Collections.Generic.List DefaultValues; + + public RawTableDefV10( + string SourceName, + uint ProductTypeRef, + System.Collections.Generic.List PrimaryKey, + System.Collections.Generic.List Indexes, + System.Collections.Generic.List Constraints, + System.Collections.Generic.List Sequences, + TableType TableType, + TableAccess TableAccess, + System.Collections.Generic.List DefaultValues + ) + { + this.SourceName = SourceName; + this.ProductTypeRef = ProductTypeRef; + this.PrimaryKey = PrimaryKey; + this.Indexes = Indexes; + this.Constraints = Constraints; + this.Sequences = Sequences; + this.TableType = TableType; + this.TableAccess = TableAccess; + this.DefaultValues = DefaultValues; + } + + public RawTableDefV10() + { + this.SourceName = ""; + this.PrimaryKey = new(); + this.Indexes = new(); + this.Constraints = new(); + this.Sequences = new(); + this.DefaultValues = new(); + } + } +} diff --git a/crates/bindings-csharp/Runtime/Internal/Autogen/RawTypeDefV10.g.cs b/crates/bindings-csharp/Runtime/Internal/Autogen/RawTypeDefV10.g.cs new file mode 100644 index 00000000000..5185e41b4aa --- /dev/null +++ b/crates/bindings-csharp/Runtime/Internal/Autogen/RawTypeDefV10.g.cs @@ -0,0 +1,39 @@ +// 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 System.Collections.Generic; +using System.Runtime.Serialization; + +namespace SpacetimeDB.Internal +{ + [SpacetimeDB.Type] + [DataContract] + public sealed partial class RawTypeDefV10 + { + [DataMember(Name = "source_name")] + public RawScopedTypeNameV10 SourceName; + [DataMember(Name = "ty")] + public uint Ty; + [DataMember(Name = "custom_ordering")] + public bool CustomOrdering; + + public RawTypeDefV10( + RawScopedTypeNameV10 SourceName, + uint Ty, + bool CustomOrdering + ) + { + this.SourceName = SourceName; + this.Ty = Ty; + this.CustomOrdering = CustomOrdering; + } + + public RawTypeDefV10() + { + this.SourceName = new(); + } + } +} diff --git a/crates/bindings-csharp/Runtime/Internal/Autogen/RawViewDefV10.g.cs b/crates/bindings-csharp/Runtime/Internal/Autogen/RawViewDefV10.g.cs new file mode 100644 index 00000000000..78c17bf03d9 --- /dev/null +++ b/crates/bindings-csharp/Runtime/Internal/Autogen/RawViewDefV10.g.cs @@ -0,0 +1,53 @@ +// 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 System.Collections.Generic; +using System.Runtime.Serialization; + +namespace SpacetimeDB.Internal +{ + [SpacetimeDB.Type] + [DataContract] + public sealed partial class RawViewDefV10 + { + [DataMember(Name = "source_name")] + public string SourceName; + [DataMember(Name = "index")] + public uint Index; + [DataMember(Name = "is_public")] + public bool IsPublic; + [DataMember(Name = "is_anonymous")] + public bool IsAnonymous; + [DataMember(Name = "params")] + public List Params; + [DataMember(Name = "return_type")] + public SpacetimeDB.BSATN.AlgebraicType ReturnType; + + public RawViewDefV10( + string SourceName, + uint Index, + bool IsPublic, + bool IsAnonymous, + List Params, + SpacetimeDB.BSATN.AlgebraicType ReturnType + ) + { + this.SourceName = SourceName; + this.Index = Index; + this.IsPublic = IsPublic; + this.IsAnonymous = IsAnonymous; + this.Params = Params; + this.ReturnType = ReturnType; + } + + public RawViewDefV10() + { + this.SourceName = ""; + this.Params = new(); + this.ReturnType = null!; + } + } +} From 1a5111337b7d921a8560527879b755a99bf1ad7b Mon Sep 17 00:00:00 2001 From: Shubham Mishra Date: Tue, 10 Feb 2026 11:31:00 +0530 Subject: [PATCH 3/3] do not expose v10 describe --- crates/bindings-sys/src/lib.rs | 2 +- crates/bindings/src/rt.rs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/crates/bindings-sys/src/lib.rs b/crates/bindings-sys/src/lib.rs index 50c0ccf13d0..dfbef0c6c55 100644 --- a/crates/bindings-sys/src/lib.rs +++ b/crates/bindings-sys/src/lib.rs @@ -924,7 +924,7 @@ pub mod raw { /// would be where you would initialize the interepreter and load the user module into it. fn __setup__() -> Result; /// Required. Runs after `__setup__`; returns all the exports for the module. - fn __describe_module_v10__() -> Encoded; + fn __describe_module__() -> Encoded; /// Required. id is an index into the `ModuleDef.reducers` returned from `__describe_module__`. /// args is a bsatn-encoded product value defined by the schema at `reducers[id]`. fn __call_reducer__( diff --git a/crates/bindings/src/rt.rs b/crates/bindings/src/rt.rs index cea7adfbbec..654759c7c89 100644 --- a/crates/bindings/src/rt.rs +++ b/crates/bindings/src/rt.rs @@ -678,7 +678,7 @@ pub trait RowLevelSecurityInfo { } /// A function which will be registered by [`register_describer`] into [`DESCRIBERS`], -/// which will be called by [`__describe_module_v10__`] to construct a module definition. +/// which will be called by [`__describe_module__`] to construct a module definition. /// /// May be a closure over static data, so that e.g. /// [`register_row_level_security`] doesn't need to take a type parameter. @@ -874,7 +874,7 @@ static ANONYMOUS_VIEWS: OnceLock> = OnceLock::new(); /// including when modules are updated (re-publishing). /// After initialization, the module cannot alter the schema. #[no_mangle] -extern "C" fn __describe_module_v10__(description: BytesSink) { +extern "C" fn __describe_module__(description: BytesSink) { // Collect the `module`. let mut module = ModuleBuilder::default(); for describer in &mut *DESCRIBERS.lock().unwrap() {