diff --git a/crates/bindings-csharp/Runtime/Internal/Module.cs b/crates/bindings-csharp/Runtime/Internal/Module.cs index a57b8fcd3..1c54815b3 100644 --- a/crates/bindings-csharp/Runtime/Internal/Module.cs +++ b/crates/bindings-csharp/Runtime/Internal/Module.cs @@ -3,11 +3,18 @@ namespace SpacetimeDB.Internal.Module; using SpacetimeDB.BSATN; [SpacetimeDB.Type] -public partial struct IndexDef(string name, Runtime.IndexType type, bool isUnique, uint[] columnIds) +public enum IndexType : byte +{ + BTree, + Hash, +} + +[SpacetimeDB.Type] +public partial struct IndexDef(string name, IndexType type, bool isUnique, uint[] columnIds) { string IndexName = name; bool IsUnique = isUnique; - Runtime.IndexType Type = type; + IndexType Type = type; uint[] ColumnIds = columnIds; } @@ -177,6 +184,14 @@ public static class FFI TypeRegistrar.Module.Tables.Add(T.MakeTableDesc(TypeRegistrar)); } + private static byte[] Consume(this SpacetimeDB.Internal.FFI.Buffer buffer) + { + var len = SpacetimeDB.Internal.FFI._buffer_len(buffer); + var result = new byte[len]; + SpacetimeDB.Internal.FFI._buffer_consume(buffer, result, len); + return result; + } + public static SpacetimeDB.Internal.FFI.Buffer __describe_module__() { // replace `module` with a temporary internal module that will register ModuleDef, AlgebraicType and other internal types diff --git a/crates/bindings-csharp/Runtime/Runtime.cs b/crates/bindings-csharp/Runtime/Runtime.cs index ca456dfee..446bfbe37 100644 --- a/crates/bindings-csharp/Runtime/Runtime.cs +++ b/crates/bindings-csharp/Runtime/Runtime.cs @@ -30,21 +30,6 @@ public class ScheduleToken public static class Runtime { - [SpacetimeDB.Type] - public enum IndexType : byte - { - BTree, - Hash, - } - - internal static byte[] Consume(this FFI.Buffer buffer) - { - var len = FFI._buffer_len(buffer); - var result = new byte[len]; - FFI._buffer_consume(buffer, result, len); - return result; - } - public enum LogLevel : byte { Error,