mirror of
https://github.com/clockworklabs/SpacetimeDB.git
synced 2026-05-23 16:11:42 -04:00
Move IndexType and Consume helper to internals
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user