diff --git a/Cargo.lock b/Cargo.lock
index 78d877eb29e..655f2fe8e04 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -5157,9 +5157,9 @@ dependencies = [
"itertools 0.12.1",
"lazy_static",
"petgraph",
- "pretty_assertions",
"proptest",
"serde_json",
+ "serial_test",
"smallvec",
"spacetimedb-cli",
"spacetimedb-data-structures",
diff --git a/crates/bindings-csharp/BSATN.Codegen/BSATN.Codegen.csproj b/crates/bindings-csharp/BSATN.Codegen/BSATN.Codegen.csproj
index 6edb39ed2d5..647cb6c273e 100644
--- a/crates/bindings-csharp/BSATN.Codegen/BSATN.Codegen.csproj
+++ b/crates/bindings-csharp/BSATN.Codegen/BSATN.Codegen.csproj
@@ -2,7 +2,7 @@
SpacetimeDB.BSATN.Codegen
- 1.0.0-rc1-hotfix1
+ 1.0.0-rc2
SpacetimeDB BSATN Codegen
The SpacetimeDB BSATN Codegen implements the Roslyn incremental generators for BSATN serialization/deserialization in C#.
diff --git a/crates/bindings-csharp/BSATN.Codegen/Diag.cs b/crates/bindings-csharp/BSATN.Codegen/Diag.cs
index 7a60a2a8c68..2ae3b2513ba 100644
--- a/crates/bindings-csharp/BSATN.Codegen/Diag.cs
+++ b/crates/bindings-csharp/BSATN.Codegen/Diag.cs
@@ -91,10 +91,41 @@ Func toLocation
)
: this(group, title, interpolate, ctx => toLocation(ctx).Locations.FirstOrDefault()) { }
+ public ErrorDescriptor(
+ ErrorDescriptorGroup group,
+ string title,
+ Expression> interpolate,
+ Func toLocation
+ )
+ : this(
+ group,
+ title,
+ interpolate,
+ ctx =>
+ toLocation(ctx).ApplicationSyntaxReference is { } r
+ ? r.SyntaxTree.GetLocation(r.Span)
+ : null
+ ) { }
+
public Diagnostic ToDiag(TContext ctx) =>
Diagnostic.Create(descriptor, toLocation(ctx), makeFormatArgs(ctx));
}
+///
+/// No-op error descriptor placeholder.
+///
+/// Error descriptors must have strong ID to avoid breaking semver, since they are used for diagnostic suppression by users.
+/// To ensure this, we cannot reorder to delete unused diagnostics - instead, we need to put some placeholders where they used to be.
+/// This class serves that purpose - it's a no-op error descriptor that you can instantiate just to reserve said ID.
+///
+public sealed class UnusedErrorDescriptor
+{
+ public UnusedErrorDescriptor(ErrorDescriptorGroup group)
+ {
+ group.NextId();
+ }
+}
+
internal static class ErrorDescriptor
{
private static readonly ErrorDescriptorGroup group = new("BSATN", "SpacetimeDB.BSATN");
diff --git a/crates/bindings-csharp/BSATN.Codegen/Type.cs b/crates/bindings-csharp/BSATN.Codegen/Type.cs
index 73197c86b44..44f662f0d7f 100644
--- a/crates/bindings-csharp/BSATN.Codegen/Type.cs
+++ b/crates/bindings-csharp/BSATN.Codegen/Type.cs
@@ -234,10 +234,13 @@ public void Write(System.IO.BinaryWriter writer, {{FullName}} value) {
{{write}}
}
- public SpacetimeDB.BSATN.AlgebraicType GetAlgebraicType(SpacetimeDB.BSATN.ITypeRegistrar registrar) =>
+ public SpacetimeDB.BSATN.AlgebraicType.Ref GetAlgebraicType(SpacetimeDB.BSATN.ITypeRegistrar registrar) =>
registrar.RegisterType<{{FullName}}>(_ => new SpacetimeDB.BSATN.AlgebraicType.{{Kind}}(new SpacetimeDB.BSATN.AggregateElement[] {
{{MemberDeclaration.GenerateDefs(Members)}}
}));
+
+ SpacetimeDB.BSATN.AlgebraicType SpacetimeDB.BSATN.IReadWrite<{{FullName}}>.GetAlgebraicType(SpacetimeDB.BSATN.ITypeRegistrar registrar) =>
+ GetAlgebraicType(registrar);
}
"""
);
diff --git a/crates/bindings-csharp/BSATN.Codegen/Utils.cs b/crates/bindings-csharp/BSATN.Codegen/Utils.cs
index 5f7ee915af6..7c9964b7a01 100644
--- a/crates/bindings-csharp/BSATN.Codegen/Utils.cs
+++ b/crates/bindings-csharp/BSATN.Codegen/Utils.cs
@@ -313,7 +313,11 @@ public override string ToString()
sb.Append(" : ").AppendJoin(", ", BaseTypes);
}
- sb.Append(typeScope.Constraints).AppendLine(" {");
+ if (typeScope.Constraints.Length > 0)
+ {
+ sb.Append(' ').Append(typeScope.Constraints);
+ }
+ sb.AppendLine(" {");
}
sb.AppendLine();
diff --git a/crates/bindings-csharp/BSATN.Runtime/BSATN.Runtime.csproj b/crates/bindings-csharp/BSATN.Runtime/BSATN.Runtime.csproj
index 5b795237723..0cc0841f96b 100644
--- a/crates/bindings-csharp/BSATN.Runtime/BSATN.Runtime.csproj
+++ b/crates/bindings-csharp/BSATN.Runtime/BSATN.Runtime.csproj
@@ -2,7 +2,7 @@
SpacetimeDB.BSATN.Runtime
- 1.0.0-rc1-hotfix1
+ 1.0.0-rc2
SpacetimeDB BSATN Runtime
The SpacetimeDB BSATN Runtime implements APIs for BSATN serialization/deserialization in C#.
diff --git a/crates/bindings-csharp/Codegen.Tests/fixtures/client/snapshots/Type#CustomClass.verified.cs b/crates/bindings-csharp/Codegen.Tests/fixtures/client/snapshots/Type#CustomClass.verified.cs
index f1c7727c41d..9493914333f 100644
--- a/crates/bindings-csharp/Codegen.Tests/fixtures/client/snapshots/Type#CustomClass.verified.cs
+++ b/crates/bindings-csharp/Codegen.Tests/fixtures/client/snapshots/Type#CustomClass.verified.cs
@@ -29,7 +29,7 @@ public void Write(System.IO.BinaryWriter writer, CustomClass value)
value.WriteFields(writer);
}
- public SpacetimeDB.BSATN.AlgebraicType GetAlgebraicType(
+ public SpacetimeDB.BSATN.AlgebraicType.Ref GetAlgebraicType(
SpacetimeDB.BSATN.ITypeRegistrar registrar
) =>
registrar.RegisterType(_ => new SpacetimeDB.BSATN.AlgebraicType.Product(
@@ -39,5 +39,9 @@ SpacetimeDB.BSATN.ITypeRegistrar registrar
new(nameof(StringField), StringField.GetAlgebraicType(registrar))
}
));
+
+ SpacetimeDB.BSATN.AlgebraicType SpacetimeDB.BSATN.IReadWrite.GetAlgebraicType(
+ SpacetimeDB.BSATN.ITypeRegistrar registrar
+ ) => GetAlgebraicType(registrar);
}
} // CustomClass
diff --git a/crates/bindings-csharp/Codegen.Tests/fixtures/client/snapshots/Type#CustomStruct.verified.cs b/crates/bindings-csharp/Codegen.Tests/fixtures/client/snapshots/Type#CustomStruct.verified.cs
index 855a5757c9c..95a910c8f01 100644
--- a/crates/bindings-csharp/Codegen.Tests/fixtures/client/snapshots/Type#CustomStruct.verified.cs
+++ b/crates/bindings-csharp/Codegen.Tests/fixtures/client/snapshots/Type#CustomStruct.verified.cs
@@ -29,7 +29,7 @@ public void Write(System.IO.BinaryWriter writer, CustomStruct value)
value.WriteFields(writer);
}
- public SpacetimeDB.BSATN.AlgebraicType GetAlgebraicType(
+ public SpacetimeDB.BSATN.AlgebraicType.Ref GetAlgebraicType(
SpacetimeDB.BSATN.ITypeRegistrar registrar
) =>
registrar.RegisterType(_ => new SpacetimeDB.BSATN.AlgebraicType.Product(
@@ -39,5 +39,9 @@ SpacetimeDB.BSATN.ITypeRegistrar registrar
new(nameof(StringField), StringField.GetAlgebraicType(registrar))
}
));
+
+ SpacetimeDB.BSATN.AlgebraicType SpacetimeDB.BSATN.IReadWrite.GetAlgebraicType(
+ SpacetimeDB.BSATN.ITypeRegistrar registrar
+ ) => GetAlgebraicType(registrar);
}
} // CustomStruct
diff --git a/crates/bindings-csharp/Codegen.Tests/fixtures/client/snapshots/Type#CustomTaggedEnum.verified.cs b/crates/bindings-csharp/Codegen.Tests/fixtures/client/snapshots/Type#CustomTaggedEnum.verified.cs
index 66edf6ee00d..d9be5d8eb86 100644
--- a/crates/bindings-csharp/Codegen.Tests/fixtures/client/snapshots/Type#CustomTaggedEnum.verified.cs
+++ b/crates/bindings-csharp/Codegen.Tests/fixtures/client/snapshots/Type#CustomTaggedEnum.verified.cs
@@ -48,7 +48,7 @@ public void Write(System.IO.BinaryWriter writer, CustomTaggedEnum value)
}
}
- public SpacetimeDB.BSATN.AlgebraicType GetAlgebraicType(
+ public SpacetimeDB.BSATN.AlgebraicType.Ref GetAlgebraicType(
SpacetimeDB.BSATN.ITypeRegistrar registrar
) =>
registrar.RegisterType(_ => new SpacetimeDB.BSATN.AlgebraicType.Sum(
@@ -58,5 +58,9 @@ SpacetimeDB.BSATN.ITypeRegistrar registrar
new(nameof(StringVariant), StringVariant.GetAlgebraicType(registrar))
}
));
+
+ SpacetimeDB.BSATN.AlgebraicType SpacetimeDB.BSATN.IReadWrite.GetAlgebraicType(
+ SpacetimeDB.BSATN.ITypeRegistrar registrar
+ ) => GetAlgebraicType(registrar);
}
} // CustomTaggedEnum
diff --git a/crates/bindings-csharp/Codegen.Tests/fixtures/client/snapshots/Type#PublicTable.verified.cs b/crates/bindings-csharp/Codegen.Tests/fixtures/client/snapshots/Type#PublicTable.verified.cs
index 3a47ce3009f..e993d0875c6 100644
--- a/crates/bindings-csharp/Codegen.Tests/fixtures/client/snapshots/Type#PublicTable.verified.cs
+++ b/crates/bindings-csharp/Codegen.Tests/fixtures/client/snapshots/Type#PublicTable.verified.cs
@@ -105,7 +105,7 @@ public void Write(System.IO.BinaryWriter writer, PublicTable value)
value.WriteFields(writer);
}
- public SpacetimeDB.BSATN.AlgebraicType GetAlgebraicType(
+ public SpacetimeDB.BSATN.AlgebraicType.Ref GetAlgebraicType(
SpacetimeDB.BSATN.ITypeRegistrar registrar
) =>
registrar.RegisterType(_ => new SpacetimeDB.BSATN.AlgebraicType.Product(
@@ -144,5 +144,9 @@ SpacetimeDB.BSATN.ITypeRegistrar registrar
)
}
));
+
+ SpacetimeDB.BSATN.AlgebraicType SpacetimeDB.BSATN.IReadWrite.GetAlgebraicType(
+ SpacetimeDB.BSATN.ITypeRegistrar registrar
+ ) => GetAlgebraicType(registrar);
}
} // PublicTable
diff --git a/crates/bindings-csharp/Codegen.Tests/fixtures/diag/Lib.cs b/crates/bindings-csharp/Codegen.Tests/fixtures/diag/Lib.cs
index 61423e76db3..8b485188a7f 100644
--- a/crates/bindings-csharp/Codegen.Tests/fixtures/diag/Lib.cs
+++ b/crates/bindings-csharp/Codegen.Tests/fixtures/diag/Lib.cs
@@ -361,20 +361,6 @@ public static partial class InAnotherNamespace
public partial struct TestDuplicateTableName { }
}
-[SpacetimeDB.Table(
- Name = "TestIncompatibleSchedule1",
- Scheduled = nameof(TestIncompatibleScheduleReducer)
-)]
-[SpacetimeDB.Table(Name = "TestIncompatibleSchedule2")]
-public partial struct TestIncompatibleSchedule
-{
- [SpacetimeDB.Reducer]
- public static void TestIncompatibleScheduleReducer(
- ReducerContext ctx,
- TestIncompatibleSchedule table
- ) { }
-}
-
[SpacetimeDB.Table]
[SpacetimeDB.Index]
public partial struct TestIndexWithoutColumns { }
@@ -382,3 +368,35 @@ public partial struct TestIndexWithoutColumns { }
[SpacetimeDB.Table]
[SpacetimeDB.Index(BTree = [])]
public partial struct TestIndexWithEmptyColumns { }
+
+[SpacetimeDB.Table(
+ Name = "TestScheduleWithoutPrimaryKey",
+ Scheduled = "DummyScheduledReducer",
+ ScheduledAt = nameof(ScheduleAtCorrectType)
+)]
+[SpacetimeDB.Table(
+ Name = "TestScheduleWithWrongPrimaryKeyType",
+ Scheduled = "DummyScheduledReducer",
+ ScheduledAt = nameof(ScheduleAtCorrectType)
+)]
+[SpacetimeDB.Table(Name = "TestScheduleWithoutScheduleAt", Scheduled = "DummyScheduledReducer")]
+[SpacetimeDB.Table(
+ Name = "TestScheduleWithWrongScheduleAtType",
+ Scheduled = "DummyScheduledReducer",
+ ScheduledAt = nameof(ScheduleAtWrongType)
+)]
+public partial struct TestScheduleIssues
+{
+ [SpacetimeDB.PrimaryKey(Table = "TestScheduleWithWrongPrimaryKeyType")]
+ public string IdWrongType;
+
+ [SpacetimeDB.PrimaryKey(Table = "TestScheduleWithoutScheduleAt")]
+ [SpacetimeDB.PrimaryKey(Table = "TestScheduleWithWrongScheduleAtType")]
+ public int IdCorrectType;
+
+ public int ScheduleAtWrongType;
+ public ScheduleAt ScheduleAtCorrectType;
+
+ [SpacetimeDB.Reducer]
+ public static void DummyScheduledReducer(ReducerContext ctx, TestScheduleIssues table) { }
+}
diff --git a/crates/bindings-csharp/Codegen.Tests/fixtures/diag/snapshots/ExtraCompilationErrors.verified.txt b/crates/bindings-csharp/Codegen.Tests/fixtures/diag/snapshots/ExtraCompilationErrors.verified.txt
index 50427f075b2..465227b1cc9 100644
--- a/crates/bindings-csharp/Codegen.Tests/fixtures/diag/snapshots/ExtraCompilationErrors.verified.txt
+++ b/crates/bindings-csharp/Codegen.Tests/fixtures/diag/snapshots/ExtraCompilationErrors.verified.txt
@@ -184,18 +184,18 @@ internal static readonly SpacetimeDB.BSATN.IReadWrite Unsuppor
}
},
{/*
-
- public sealed class TestUniqueNotEquatableUniqueIndex : UniqueIndex> {
- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- internal TestUniqueNotEquatableUniqueIndex(TestUniqueNotEquatable handle) : base(handle, "TestUniqueNotEquatable_UniqueField_idx_btree") {}
+}
+public readonly struct TestTableTaggedEnum : SpacetimeDB.Internal.ITableView {
+ ^^^^^^^^^^^^^^^^^^^
+ static global::TestTableTaggedEnum SpacetimeDB.Internal.ITableView.ReadGenFields(System.IO.BinaryReader reader, global::TestTableTaggedEnum row) {
*/
- Message: Partial declarations of 'TestUniqueNotEquatable.TestUniqueNotEquatableUniqueIndex' must not specify different base classes,
+ Message: The type 'TestTableTaggedEnum' cannot be used as type parameter 'T' in the generic type or method 'ITableView'. There is no implicit reference conversion from 'TestTableTaggedEnum' to 'SpacetimeDB.BSATN.IStructuralReadWrite'.,
Severity: Error,
Descriptor: {
- Id: CS0263,
+ Id: CS0311,
Title: ,
- HelpLink: https://msdn.microsoft.com/query/roslyn.query?appId=roslyn&k=k(CS0263),
- MessageFormat: Partial declarations of '{0}' must not specify different base classes,
+ HelpLink: https://msdn.microsoft.com/query/roslyn.query?appId=roslyn&k=k(CS0311),
+ MessageFormat: The type '{3}' cannot be used as type parameter '{2}' in the generic type or method '{0}'. There is no implicit reference conversion from '{3}' to '{1}'.,
Category: Compiler,
DefaultSeverity: Error,
IsEnabledByDefault: true,
@@ -207,18 +207,18 @@ internal static readonly SpacetimeDB.BSATN.IReadWrite Unsuppor
}
},
{/*
- public sealed class TestUniqueNotEquatableUniqueIndex : UniqueIndex> {
- internal TestUniqueNotEquatableUniqueIndex(TestUniqueNotEquatable handle) : base(handle, "TestUniqueNotEquatable_UniqueField_idx_btree") {}
- ^^^^
- // Important: don't move this to the base class.
+}
+public readonly struct TestTableTaggedEnum : SpacetimeDB.Internal.ITableView {
+ ^^^^^^^^^^^^^^^^^^^
+ static global::TestTableTaggedEnum SpacetimeDB.Internal.ITableView.ReadGenFields(System.IO.BinaryReader reader, global::TestTableTaggedEnum row) {
*/
- Message: 'UniqueIndex>.UniqueIndex(TestUniqueNotEquatable, string)' is inaccessible due to its protection level,
+ Message: 'TestTableTaggedEnum' must be a non-abstract type with a public parameterless constructor in order to use it as parameter 'T' in the generic type or method 'ITableView',
Severity: Error,
Descriptor: {
- Id: CS0122,
+ Id: CS0310,
Title: ,
- HelpLink: https://msdn.microsoft.com/query/roslyn.query?appId=roslyn&k=k(CS0122),
- MessageFormat: '{0}' is inaccessible due to its protection level,
+ HelpLink: https://msdn.microsoft.com/query/roslyn.query?appId=roslyn&k=k(CS0310),
+ MessageFormat: '{2}' must be a non-abstract type with a public parameterless constructor in order to use it as parameter '{1}' in the generic type or method '{0}',
Category: Compiler,
DefaultSeverity: Error,
IsEnabledByDefault: true,
@@ -230,18 +230,18 @@ internal static readonly SpacetimeDB.BSATN.IReadWrite Unsuppor
}
},
{/*
- // `globalName` in one generic definition, leading to buggy `Row?` expansion for either one or another.
- public global::TestUniqueNotEquatable? Find(int? key) => DoFilter(key).Cast().SingleOrDefault();
- ^^^^^^^^
- public bool Update(global::TestUniqueNotEquatable row) => DoUpdate(row.UniqueField, row);
+public readonly struct TestTableTaggedEnum : SpacetimeDB.Internal.ITableView {
+ static global::TestTableTaggedEnum SpacetimeDB.Internal.ITableView.ReadGenFields(System.IO.BinaryReader reader, global::TestTableTaggedEnum row) {
+ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
*/
- Message: The name 'DoFilter' does not exist in the current context,
+ Message: The type 'TestTableTaggedEnum' cannot be used as type parameter 'T' in the generic type or method 'ITableView'. There is no implicit reference conversion from 'TestTableTaggedEnum' to 'SpacetimeDB.BSATN.IStructuralReadWrite'.,
Severity: Error,
Descriptor: {
- Id: CS0103,
+ Id: CS0311,
Title: ,
- HelpLink: https://msdn.microsoft.com/query/roslyn.query?appId=roslyn&k=k(CS0103),
- MessageFormat: The name '{0}' does not exist in the current context,
+ HelpLink: https://msdn.microsoft.com/query/roslyn.query?appId=roslyn&k=k(CS0311),
+ MessageFormat: The type '{3}' cannot be used as type parameter '{2}' in the generic type or method '{0}'. There is no implicit reference conversion from '{3}' to '{1}'.,
Category: Compiler,
DefaultSeverity: Error,
IsEnabledByDefault: true,
@@ -253,18 +253,18 @@ internal static readonly SpacetimeDB.BSATN.IReadWrite Unsuppor
}
},
{/*
- public global::TestUniqueNotEquatable? Find(int? key) => DoFilter(key).Cast().SingleOrDefault();
- public bool Update(global::TestUniqueNotEquatable row) => DoUpdate(row.UniqueField, row);
- ^^^^^^^^
-}
+public readonly struct TestTableTaggedEnum : SpacetimeDB.Internal.ITableView {
+ static global::TestTableTaggedEnum SpacetimeDB.Internal.ITableView.ReadGenFields(System.IO.BinaryReader reader, global::TestTableTaggedEnum row) {
+ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
*/
- Message: The name 'DoUpdate' does not exist in the current context,
+ Message: 'TestTableTaggedEnum' must be a non-abstract type with a public parameterless constructor in order to use it as parameter 'T' in the generic type or method 'ITableView',
Severity: Error,
Descriptor: {
- Id: CS0103,
+ Id: CS0310,
Title: ,
- HelpLink: https://msdn.microsoft.com/query/roslyn.query?appId=roslyn&k=k(CS0103),
- MessageFormat: The name '{0}' does not exist in the current context,
+ HelpLink: https://msdn.microsoft.com/query/roslyn.query?appId=roslyn&k=k(CS0310),
+ MessageFormat: '{2}' must be a non-abstract type with a public parameterless constructor in order to use it as parameter '{1}' in the generic type or method '{0}',
Category: Compiler,
DefaultSeverity: Error,
IsEnabledByDefault: true,
@@ -276,18 +276,18 @@ internal static readonly SpacetimeDB.BSATN.IReadWrite Unsuppor
}
},
{/*
-}
-public TestUniqueNotEquatableUniqueIndex UniqueField => new(this);
- ^^^^^^^^^
-public sealed class TestUniqueNotEquatableUniqueIndex : UniqueIndex> {
+
+ static SpacetimeDB.Internal.RawTableDefV9 SpacetimeDB.Internal.ITableView.MakeTableDesc(SpacetimeDB.BSATN.ITypeRegistrar registrar) => new (
+ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ Name: nameof(TestTableTaggedEnum),
*/
- Message: The call is ambiguous between the following methods or properties: 'TestUniqueNotEquatable.TestUniqueNotEquatableUniqueIndex.TestUniqueNotEquatableUniqueIndex(TestUniqueNotEquatable)' and 'TestUniqueNotEquatable.TestUniqueNotEquatableUniqueIndex.TestUniqueNotEquatableUniqueIndex(TestUniqueNotEquatable)',
+ Message: The type 'TestTableTaggedEnum' cannot be used as type parameter 'T' in the generic type or method 'ITableView'. There is no implicit reference conversion from 'TestTableTaggedEnum' to 'SpacetimeDB.BSATN.IStructuralReadWrite'.,
Severity: Error,
Descriptor: {
- Id: CS0121,
+ Id: CS0311,
Title: ,
- HelpLink: https://msdn.microsoft.com/query/roslyn.query?appId=roslyn&k=k(CS0121),
- MessageFormat: The call is ambiguous between the following methods or properties: '{0}' and '{1}',
+ HelpLink: https://msdn.microsoft.com/query/roslyn.query?appId=roslyn&k=k(CS0311),
+ MessageFormat: The type '{3}' cannot be used as type parameter '{2}' in the generic type or method '{0}'. There is no implicit reference conversion from '{3}' to '{1}'.,
Category: Compiler,
DefaultSeverity: Error,
IsEnabledByDefault: true,
@@ -299,18 +299,18 @@ public sealed class TestUniqueNotEquatableUniqueIndex : UniqueIndex new(this);
-public sealed class TestUniqueNotEquatableUniqueIndex : UniqueIndex> {
- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- internal TestUniqueNotEquatableUniqueIndex(TestUniqueNotEquatable handle) : base(handle, "TestUniqueNotEquatable_PrimaryKeyField_idx_btree") {}
+
+ static SpacetimeDB.Internal.RawTableDefV9 SpacetimeDB.Internal.ITableView.MakeTableDesc(SpacetimeDB.BSATN.ITypeRegistrar registrar) => new (
+ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ Name: nameof(TestTableTaggedEnum),
*/
- Message: The type 'TestUniqueNotEquatable' already contains a definition for 'TestUniqueNotEquatableUniqueIndex',
+ Message: 'TestTableTaggedEnum' must be a non-abstract type with a public parameterless constructor in order to use it as parameter 'T' in the generic type or method 'ITableView',
Severity: Error,
Descriptor: {
- Id: CS0102,
+ Id: CS0310,
Title: ,
- HelpLink: https://msdn.microsoft.com/query/roslyn.query?appId=roslyn&k=k(CS0102),
- MessageFormat: The type '{0}' already contains a definition for '{1}',
+ HelpLink: https://msdn.microsoft.com/query/roslyn.query?appId=roslyn&k=k(CS0310),
+ MessageFormat: '{2}' must be a non-abstract type with a public parameterless constructor in order to use it as parameter '{1}' in the generic type or method '{0}',
Category: Compiler,
DefaultSeverity: Error,
IsEnabledByDefault: true,
@@ -322,18 +322,18 @@ public sealed class TestUniqueNotEquatableUniqueIndex : UniqueIndex> {
- internal TestUniqueNotEquatableUniqueIndex(TestUniqueNotEquatable handle) : base(handle, "TestUniqueNotEquatable_PrimaryKeyField_idx_btree") {}
- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- // Important: don't move this to the base class.
+
+ public ulong Count => SpacetimeDB.Internal.ITableView.DoCount();
+ ^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ public IEnumerable Iter() => SpacetimeDB.Internal.ITableView.DoIter();
*/
- Message: Type 'TestUniqueNotEquatable.TestUniqueNotEquatableUniqueIndex' already defines a member called 'TestUniqueNotEquatableUniqueIndex' with the same parameter types,
+ Message: The type 'TestTableTaggedEnum' cannot be used as type parameter 'T' in the generic type or method 'ITableView'. There is no implicit reference conversion from 'TestTableTaggedEnum' to 'SpacetimeDB.BSATN.IStructuralReadWrite'.,
Severity: Error,
Descriptor: {
- Id: CS0111,
+ Id: CS0311,
Title: ,
- HelpLink: https://msdn.microsoft.com/query/roslyn.query?appId=roslyn&k=k(CS0111),
- MessageFormat: Type '{1}' already defines a member called '{0}' with the same parameter types,
+ HelpLink: https://msdn.microsoft.com/query/roslyn.query?appId=roslyn&k=k(CS0311),
+ MessageFormat: The type '{3}' cannot be used as type parameter '{2}' in the generic type or method '{0}'. There is no implicit reference conversion from '{3}' to '{1}'.,
Category: Compiler,
DefaultSeverity: Error,
IsEnabledByDefault: true,
@@ -345,18 +345,18 @@ public sealed class TestUniqueNotEquatableUniqueIndex : UniqueIndex> {
- internal TestUniqueNotEquatableUniqueIndex(TestUniqueNotEquatable handle) : base(handle, "TestUniqueNotEquatable_PrimaryKeyField_idx_btree") {}
- ^^^^
- // Important: don't move this to the base class.
+
+ public ulong Count => SpacetimeDB.Internal.ITableView.DoCount();
+ ^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ public IEnumerable Iter() => SpacetimeDB.Internal.ITableView.DoIter();
*/
- Message: 'UniqueIndex>.UniqueIndex(TestUniqueNotEquatable, string)' is inaccessible due to its protection level,
+ Message: 'TestTableTaggedEnum' must be a non-abstract type with a public parameterless constructor in order to use it as parameter 'T' in the generic type or method 'ITableView',
Severity: Error,
Descriptor: {
- Id: CS0122,
+ Id: CS0310,
Title: ,
- HelpLink: https://msdn.microsoft.com/query/roslyn.query?appId=roslyn&k=k(CS0122),
- MessageFormat: '{0}' is inaccessible due to its protection level,
+ HelpLink: https://msdn.microsoft.com/query/roslyn.query?appId=roslyn&k=k(CS0310),
+ MessageFormat: '{2}' must be a non-abstract type with a public parameterless constructor in order to use it as parameter '{1}' in the generic type or method '{0}',
Category: Compiler,
DefaultSeverity: Error,
IsEnabledByDefault: true,
@@ -368,18 +368,18 @@ public sealed class TestUniqueNotEquatableUniqueIndex : UniqueIndex DoFilter(key).Cast().SingleOrDefault();
- ^^^^^^^^
- public bool Update(global::TestUniqueNotEquatable row) => DoUpdate(row.PrimaryKeyField, row);
+ public ulong Count => SpacetimeDB.Internal.ITableView.DoCount();
+ public IEnumerable Iter() => SpacetimeDB.Internal.ITableView.DoIter();
+ ^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ public global::TestTableTaggedEnum Insert(global::TestTableTaggedEnum row) => SpacetimeDB.Internal.ITableView.DoInsert(row);
*/
- Message: The name 'DoFilter' does not exist in the current context,
+ Message: The type 'TestTableTaggedEnum' cannot be used as type parameter 'T' in the generic type or method 'ITableView'. There is no implicit reference conversion from 'TestTableTaggedEnum' to 'SpacetimeDB.BSATN.IStructuralReadWrite'.,
Severity: Error,
Descriptor: {
- Id: CS0103,
+ Id: CS0311,
Title: ,
- HelpLink: https://msdn.microsoft.com/query/roslyn.query?appId=roslyn&k=k(CS0103),
- MessageFormat: The name '{0}' does not exist in the current context,
+ HelpLink: https://msdn.microsoft.com/query/roslyn.query?appId=roslyn&k=k(CS0311),
+ MessageFormat: The type '{3}' cannot be used as type parameter '{2}' in the generic type or method '{0}'. There is no implicit reference conversion from '{3}' to '{1}'.,
Category: Compiler,
DefaultSeverity: Error,
IsEnabledByDefault: true,
@@ -391,18 +391,18 @@ public sealed class TestUniqueNotEquatableUniqueIndex : UniqueIndex DoFilter(key).Cast().SingleOrDefault();
- public bool Update(global::TestUniqueNotEquatable row) => DoUpdate(row.PrimaryKeyField, row);
- ^^^^^^
-}
+ public ulong Count => SpacetimeDB.Internal.ITableView.DoCount();
+ public IEnumerable Iter() => SpacetimeDB.Internal.ITableView.DoIter();
+ ^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ public global::TestTableTaggedEnum Insert(global::TestTableTaggedEnum row) => SpacetimeDB.Internal.ITableView.DoInsert(row);
*/
- Message: Type 'TestUniqueNotEquatable.TestUniqueNotEquatableUniqueIndex' already defines a member called 'Update' with the same parameter types,
+ Message: 'TestTableTaggedEnum' must be a non-abstract type with a public parameterless constructor in order to use it as parameter 'T' in the generic type or method 'ITableView',
Severity: Error,
Descriptor: {
- Id: CS0111,
+ Id: CS0310,
Title: ,
- HelpLink: https://msdn.microsoft.com/query/roslyn.query?appId=roslyn&k=k(CS0111),
- MessageFormat: Type '{1}' already defines a member called '{0}' with the same parameter types,
+ HelpLink: https://msdn.microsoft.com/query/roslyn.query?appId=roslyn&k=k(CS0310),
+ MessageFormat: '{2}' must be a non-abstract type with a public parameterless constructor in order to use it as parameter '{1}' in the generic type or method '{0}',
Category: Compiler,
DefaultSeverity: Error,
IsEnabledByDefault: true,
@@ -414,18 +414,18 @@ public sealed class TestUniqueNotEquatableUniqueIndex : UniqueIndex DoFilter(key).Cast().SingleOrDefault();
- public bool Update(global::TestUniqueNotEquatable row) => DoUpdate(row.PrimaryKeyField, row);
- ^^^^^^^^
-}
+ public IEnumerable Iter() => SpacetimeDB.Internal.ITableView.DoIter();
+ public global::TestTableTaggedEnum Insert(global::TestTableTaggedEnum row) => SpacetimeDB.Internal.ITableView.DoInsert(row);
+ ^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ public bool Delete(global::TestTableTaggedEnum row) => SpacetimeDB.Internal.ITableView.DoDelete(row);
*/
- Message: The name 'DoUpdate' does not exist in the current context,
+ Message: The type 'TestTableTaggedEnum' cannot be used as type parameter 'T' in the generic type or method 'ITableView'. There is no implicit reference conversion from 'TestTableTaggedEnum' to 'SpacetimeDB.BSATN.IStructuralReadWrite'.,
Severity: Error,
Descriptor: {
- Id: CS0103,
+ Id: CS0311,
Title: ,
- HelpLink: https://msdn.microsoft.com/query/roslyn.query?appId=roslyn&k=k(CS0103),
- MessageFormat: The name '{0}' does not exist in the current context,
+ HelpLink: https://msdn.microsoft.com/query/roslyn.query?appId=roslyn&k=k(CS0311),
+ MessageFormat: The type '{3}' cannot be used as type parameter '{2}' in the generic type or method '{0}'. There is no implicit reference conversion from '{3}' to '{1}'.,
Category: Compiler,
DefaultSeverity: Error,
IsEnabledByDefault: true,
@@ -437,18 +437,18 @@ public sealed class TestUniqueNotEquatableUniqueIndex : UniqueIndex new(this);
- ^^^^^^^^^
-}
+ public IEnumerable Iter() => SpacetimeDB.Internal.ITableView.DoIter();
+ public global::TestTableTaggedEnum Insert(global::TestTableTaggedEnum row) => SpacetimeDB.Internal.ITableView.DoInsert(row);
+ ^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ public bool Delete(global::TestTableTaggedEnum row) => SpacetimeDB.Internal.ITableView.DoDelete(row);
*/
- Message: The call is ambiguous between the following methods or properties: 'TestUniqueNotEquatable.TestUniqueNotEquatableUniqueIndex.TestUniqueNotEquatableUniqueIndex(TestUniqueNotEquatable)' and 'TestUniqueNotEquatable.TestUniqueNotEquatableUniqueIndex.TestUniqueNotEquatableUniqueIndex(TestUniqueNotEquatable)',
+ Message: 'TestTableTaggedEnum' must be a non-abstract type with a public parameterless constructor in order to use it as parameter 'T' in the generic type or method 'ITableView',
Severity: Error,
Descriptor: {
- Id: CS0121,
+ Id: CS0310,
Title: ,
- HelpLink: https://msdn.microsoft.com/query/roslyn.query?appId=roslyn&k=k(CS0121),
- MessageFormat: The call is ambiguous between the following methods or properties: '{0}' and '{1}',
+ HelpLink: https://msdn.microsoft.com/query/roslyn.query?appId=roslyn&k=k(CS0310),
+ MessageFormat: '{2}' must be a non-abstract type with a public parameterless constructor in order to use it as parameter '{1}' in the generic type or method '{0}',
Category: Compiler,
DefaultSeverity: Error,
IsEnabledByDefault: true,
@@ -460,18 +460,41 @@ public TestUniqueNotEquatableUniqueIndex PrimaryKeyField => new(this);
}
},
{/*
- public void Invoke(BinaryReader reader, SpacetimeDB.Internal.IReducerContext ctx) {
- Reducers.TestReducerWithoutContext((SpacetimeDB.ReducerContext)ctx);
- ^^^^^^^^^^^^^^^^^^^^^^^^^
+ public global::TestTableTaggedEnum Insert(global::TestTableTaggedEnum row) => SpacetimeDB.Internal.ITableView.DoInsert(row);
+ public bool Delete(global::TestTableTaggedEnum row) => SpacetimeDB.Internal.ITableView.DoDelete(row);
+ ^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+*/
+ Message: The type 'TestTableTaggedEnum' cannot be used as type parameter 'T' in the generic type or method 'ITableView'. There is no implicit reference conversion from 'TestTableTaggedEnum' to 'SpacetimeDB.BSATN.IStructuralReadWrite'.,
+ Severity: Error,
+ Descriptor: {
+ Id: CS0311,
+ Title: ,
+ HelpLink: https://msdn.microsoft.com/query/roslyn.query?appId=roslyn&k=k(CS0311),
+ MessageFormat: The type '{3}' cannot be used as type parameter '{2}' in the generic type or method '{0}'. There is no implicit reference conversion from '{3}' to '{1}'.,
+ Category: Compiler,
+ DefaultSeverity: Error,
+ IsEnabledByDefault: true,
+ CustomTags: [
+ Compiler,
+ Telemetry,
+ NotConfigurable
+ ]
}
+ },
+ {/*
+ public global::TestTableTaggedEnum Insert(global::TestTableTaggedEnum row) => SpacetimeDB.Internal.ITableView.DoInsert(row);
+ public bool Delete(global::TestTableTaggedEnum row) => SpacetimeDB.Internal.ITableView.DoDelete(row);
+ ^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
*/
- Message: No overload for method 'TestReducerWithoutContext' takes 1 arguments,
+ Message: 'TestTableTaggedEnum' must be a non-abstract type with a public parameterless constructor in order to use it as parameter 'T' in the generic type or method 'ITableView',
Severity: Error,
Descriptor: {
- Id: CS1501,
+ Id: CS0310,
Title: ,
- HelpLink: https://msdn.microsoft.com/query/roslyn.query?appId=roslyn&k=k(CS1501),
- MessageFormat: No overload for method '{0}' takes {1} arguments,
+ HelpLink: https://msdn.microsoft.com/query/roslyn.query?appId=roslyn&k=k(CS0310),
+ MessageFormat: '{2}' must be a non-abstract type with a public parameterless constructor in order to use it as parameter '{1}' in the generic type or method '{0}',
Category: Compiler,
DefaultSeverity: Error,
IsEnabledByDefault: true,
@@ -483,18 +506,18 @@ public TestUniqueNotEquatableUniqueIndex PrimaryKeyField => new(this);
}
},
{/*
-SpacetimeDB.Internal.Module.RegisterTable();
-SpacetimeDB.Internal.Module.RegisterTable();
- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-SpacetimeDB.Internal.Module.RegisterTable();
+
+ public sealed class TestUniqueNotEquatableUniqueIndex : UniqueIndex> {
+ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ internal TestUniqueNotEquatableUniqueIndex(TestUniqueNotEquatable handle) : base(handle, "TestUniqueNotEquatable_UniqueField_idx_btree") {}
*/
- Message: The type 'TestTableTaggedEnum' cannot be used as type parameter 'T' in the generic type or method 'Module.RegisterTable()'. There is no implicit reference conversion from 'TestTableTaggedEnum' to 'SpacetimeDB.Internal.ITable'.,
+ Message: Partial declarations of 'TestUniqueNotEquatable.TestUniqueNotEquatableUniqueIndex' must not specify different base classes,
Severity: Error,
Descriptor: {
- Id: CS0311,
+ Id: CS0263,
Title: ,
- HelpLink: https://msdn.microsoft.com/query/roslyn.query?appId=roslyn&k=k(CS0311),
- MessageFormat: The type '{3}' cannot be used as type parameter '{2}' in the generic type or method '{0}'. There is no implicit reference conversion from '{3}' to '{1}'.,
+ HelpLink: https://msdn.microsoft.com/query/roslyn.query?appId=roslyn&k=k(CS0263),
+ MessageFormat: Partial declarations of '{0}' must not specify different base classes,
Category: Compiler,
DefaultSeverity: Error,
IsEnabledByDefault: true,
@@ -506,18 +529,18 @@ SpacetimeDB.Internal.Module.RegisterTable();
}
},
{/*
-SpacetimeDB.Internal.Module.RegisterTable();
-SpacetimeDB.Internal.Module.RegisterTable();
- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-SpacetimeDB.Internal.Module.RegisterTable();
+ public sealed class TestUniqueNotEquatableUniqueIndex : UniqueIndex> {
+ internal TestUniqueNotEquatableUniqueIndex(TestUniqueNotEquatable handle) : base(handle, "TestUniqueNotEquatable_UniqueField_idx_btree") {}
+ ^^^^
+ // Important: don't move this to the base class.
*/
- Message: 'TestTableTaggedEnum' must be a non-abstract type with a public parameterless constructor in order to use it as parameter 'T' in the generic type or method 'Module.RegisterTable()',
+ Message: 'UniqueIndex>.UniqueIndex(TestUniqueNotEquatable, string)' is inaccessible due to its protection level,
Severity: Error,
Descriptor: {
- Id: CS0310,
+ Id: CS0122,
Title: ,
- HelpLink: https://msdn.microsoft.com/query/roslyn.query?appId=roslyn&k=k(CS0310),
- MessageFormat: '{2}' must be a non-abstract type with a public parameterless constructor in order to use it as parameter '{1}' in the generic type or method '{0}',
+ HelpLink: https://msdn.microsoft.com/query/roslyn.query?appId=roslyn&k=k(CS0122),
+ MessageFormat: '{0}' is inaccessible due to its protection level,
Category: Compiler,
DefaultSeverity: Error,
IsEnabledByDefault: true,
@@ -529,18 +552,41 @@ SpacetimeDB.Internal.Module.RegisterTable();
}
},
{/*
+ // `globalName` in one generic definition, leading to buggy `Row?` expansion for either one or another.
+ public global::TestUniqueNotEquatable? Find(int? key) => DoFilter(key).Cast().SingleOrDefault();
+ ^^^^^^^^
+ public bool Update(global::TestUniqueNotEquatable row) => DoUpdate(row.UniqueField, row);
+*/
+ Message: The name 'DoFilter' does not exist in the current context,
+ Severity: Error,
+ Descriptor: {
+ Id: CS0103,
+ Title: ,
+ HelpLink: https://msdn.microsoft.com/query/roslyn.query?appId=roslyn&k=k(CS0103),
+ MessageFormat: The name '{0}' does not exist in the current context,
+ Category: Compiler,
+ DefaultSeverity: Error,
+ IsEnabledByDefault: true,
+ CustomTags: [
+ Compiler,
+ Telemetry,
+ NotConfigurable
+ ]
+ }
+ },
+ {/*
+ public global::TestUniqueNotEquatable? Find(int? key) => DoFilter(key).Cast().SingleOrDefault();
+ public bool Update(global::TestUniqueNotEquatable row) => DoUpdate(row.UniqueField, row);
+ ^^^^^^^^
}
-public readonly struct TestTableTaggedEnum : SpacetimeDB.Internal.ITableView {
- ^^^^^^^^^^^^^^^^^^^
- static global::TestTableTaggedEnum SpacetimeDB.Internal.ITableView.ReadGenFields(System.IO.BinaryReader reader, global::TestTableTaggedEnum row) {
*/
- Message: The type 'TestTableTaggedEnum' cannot be used as type parameter 'T' in the generic type or method 'ITableView'. There is no implicit reference conversion from 'TestTableTaggedEnum' to 'SpacetimeDB.Internal.ITable'.,
+ Message: The name 'DoUpdate' does not exist in the current context,
Severity: Error,
Descriptor: {
- Id: CS0311,
+ Id: CS0103,
Title: ,
- HelpLink: https://msdn.microsoft.com/query/roslyn.query?appId=roslyn&k=k(CS0311),
- MessageFormat: The type '{3}' cannot be used as type parameter '{2}' in the generic type or method '{0}'. There is no implicit reference conversion from '{3}' to '{1}'.,
+ HelpLink: https://msdn.microsoft.com/query/roslyn.query?appId=roslyn&k=k(CS0103),
+ MessageFormat: The name '{0}' does not exist in the current context,
Category: Compiler,
DefaultSeverity: Error,
IsEnabledByDefault: true,
@@ -553,17 +599,17 @@ public readonly struct TestTableTaggedEnum : SpacetimeDB.Internal.ITableView {
- ^^^^^^^^^^^^^^^^^^^
- static global::TestTableTaggedEnum SpacetimeDB.Internal.ITableView.ReadGenFields(System.IO.BinaryReader reader, global::TestTableTaggedEnum row) {
+public TestUniqueNotEquatableUniqueIndex UniqueField => new(this);
+ ^^^^^^^^^
+public sealed class TestUniqueNotEquatableUniqueIndex : UniqueIndex> {
*/
- Message: 'TestTableTaggedEnum' must be a non-abstract type with a public parameterless constructor in order to use it as parameter 'T' in the generic type or method 'ITableView',
+ Message: The call is ambiguous between the following methods or properties: 'TestUniqueNotEquatable.TestUniqueNotEquatableUniqueIndex.TestUniqueNotEquatableUniqueIndex(TestUniqueNotEquatable)' and 'TestUniqueNotEquatable.TestUniqueNotEquatableUniqueIndex.TestUniqueNotEquatableUniqueIndex(TestUniqueNotEquatable)',
Severity: Error,
Descriptor: {
- Id: CS0310,
+ Id: CS0121,
Title: ,
- HelpLink: https://msdn.microsoft.com/query/roslyn.query?appId=roslyn&k=k(CS0310),
- MessageFormat: '{2}' must be a non-abstract type with a public parameterless constructor in order to use it as parameter '{1}' in the generic type or method '{0}',
+ HelpLink: https://msdn.microsoft.com/query/roslyn.query?appId=roslyn&k=k(CS0121),
+ MessageFormat: The call is ambiguous between the following methods or properties: '{0}' and '{1}',
Category: Compiler,
DefaultSeverity: Error,
IsEnabledByDefault: true,
@@ -575,18 +621,18 @@ public readonly struct TestTableTaggedEnum : SpacetimeDB.Internal.ITableView {
- static global::TestTableTaggedEnum SpacetimeDB.Internal.ITableView.ReadGenFields(System.IO.BinaryReader reader, global::TestTableTaggedEnum row) {
- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
+public TestUniqueNotEquatableUniqueIndex UniqueField => new(this);
+public sealed class TestUniqueNotEquatableUniqueIndex : UniqueIndex> {
+ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ internal TestUniqueNotEquatableUniqueIndex(TestUniqueNotEquatable handle) : base(handle, "TestUniqueNotEquatable_PrimaryKeyField_idx_btree") {}
*/
- Message: The type 'TestTableTaggedEnum' cannot be used as type parameter 'T' in the generic type or method 'ITableView'. There is no implicit reference conversion from 'TestTableTaggedEnum' to 'SpacetimeDB.Internal.ITable'.,
+ Message: The type 'TestUniqueNotEquatable' already contains a definition for 'TestUniqueNotEquatableUniqueIndex',
Severity: Error,
Descriptor: {
- Id: CS0311,
+ Id: CS0102,
Title: ,
- HelpLink: https://msdn.microsoft.com/query/roslyn.query?appId=roslyn&k=k(CS0311),
- MessageFormat: The type '{3}' cannot be used as type parameter '{2}' in the generic type or method '{0}'. There is no implicit reference conversion from '{3}' to '{1}'.,
+ HelpLink: https://msdn.microsoft.com/query/roslyn.query?appId=roslyn&k=k(CS0102),
+ MessageFormat: The type '{0}' already contains a definition for '{1}',
Category: Compiler,
DefaultSeverity: Error,
IsEnabledByDefault: true,
@@ -598,18 +644,18 @@ public readonly struct TestTableTaggedEnum : SpacetimeDB.Internal.ITableView {
- static global::TestTableTaggedEnum SpacetimeDB.Internal.ITableView.ReadGenFields(System.IO.BinaryReader reader, global::TestTableTaggedEnum row) {
- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
+public sealed class TestUniqueNotEquatableUniqueIndex : UniqueIndex> {
+ internal TestUniqueNotEquatableUniqueIndex(TestUniqueNotEquatable handle) : base(handle, "TestUniqueNotEquatable_PrimaryKeyField_idx_btree") {}
+ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ // Important: don't move this to the base class.
*/
- Message: 'TestTableTaggedEnum' must be a non-abstract type with a public parameterless constructor in order to use it as parameter 'T' in the generic type or method 'ITableView',
+ Message: Type 'TestUniqueNotEquatable.TestUniqueNotEquatableUniqueIndex' already defines a member called 'TestUniqueNotEquatableUniqueIndex' with the same parameter types,
Severity: Error,
Descriptor: {
- Id: CS0310,
+ Id: CS0111,
Title: ,
- HelpLink: https://msdn.microsoft.com/query/roslyn.query?appId=roslyn&k=k(CS0310),
- MessageFormat: '{2}' must be a non-abstract type with a public parameterless constructor in order to use it as parameter '{1}' in the generic type or method '{0}',
+ HelpLink: https://msdn.microsoft.com/query/roslyn.query?appId=roslyn&k=k(CS0111),
+ MessageFormat: Type '{1}' already defines a member called '{0}' with the same parameter types,
Category: Compiler,
DefaultSeverity: Error,
IsEnabledByDefault: true,
@@ -621,18 +667,18 @@ public readonly struct TestTableTaggedEnum : SpacetimeDB.Internal.ITableView SpacetimeDB.Internal.ITableView.DoCount();
- ^^^^^^^^^^^^^^^^^^^^^^^^^^^
- public IEnumerable Iter() => SpacetimeDB.Internal.ITableView.DoIter();
+public sealed class TestUniqueNotEquatableUniqueIndex : UniqueIndex> {
+ internal TestUniqueNotEquatableUniqueIndex(TestUniqueNotEquatable handle) : base(handle, "TestUniqueNotEquatable_PrimaryKeyField_idx_btree") {}
+ ^^^^
+ // Important: don't move this to the base class.
*/
- Message: The type 'TestTableTaggedEnum' cannot be used as type parameter 'T' in the generic type or method 'ITableView'. There is no implicit reference conversion from 'TestTableTaggedEnum' to 'SpacetimeDB.Internal.ITable'.,
+ Message: 'UniqueIndex>.UniqueIndex(TestUniqueNotEquatable, string)' is inaccessible due to its protection level,
Severity: Error,
Descriptor: {
- Id: CS0311,
+ Id: CS0122,
Title: ,
- HelpLink: https://msdn.microsoft.com/query/roslyn.query?appId=roslyn&k=k(CS0311),
- MessageFormat: The type '{3}' cannot be used as type parameter '{2}' in the generic type or method '{0}'. There is no implicit reference conversion from '{3}' to '{1}'.,
+ HelpLink: https://msdn.microsoft.com/query/roslyn.query?appId=roslyn&k=k(CS0122),
+ MessageFormat: '{0}' is inaccessible due to its protection level,
Category: Compiler,
DefaultSeverity: Error,
IsEnabledByDefault: true,
@@ -644,18 +690,18 @@ public readonly struct TestTableTaggedEnum : SpacetimeDB.Internal.ITableView SpacetimeDB.Internal.ITableView.DoCount();
- ^^^^^^^^^^^^^^^^^^^^^^^^^^^
- public IEnumerable Iter() => SpacetimeDB.Internal.ITableView.DoIter();
+ // `globalName` in one generic definition, leading to buggy `Row?` expansion for either one or another.
+ public global::TestUniqueNotEquatable? Find(TestEnumWithExplicitValues key) => DoFilter(key).Cast().SingleOrDefault();
+ ^^^^^^^^
+ public bool Update(global::TestUniqueNotEquatable row) => DoUpdate(row.PrimaryKeyField, row);
*/
- Message: 'TestTableTaggedEnum' must be a non-abstract type with a public parameterless constructor in order to use it as parameter 'T' in the generic type or method 'ITableView',
+ Message: The name 'DoFilter' does not exist in the current context,
Severity: Error,
Descriptor: {
- Id: CS0310,
+ Id: CS0103,
Title: ,
- HelpLink: https://msdn.microsoft.com/query/roslyn.query?appId=roslyn&k=k(CS0310),
- MessageFormat: '{2}' must be a non-abstract type with a public parameterless constructor in order to use it as parameter '{1}' in the generic type or method '{0}',
+ HelpLink: https://msdn.microsoft.com/query/roslyn.query?appId=roslyn&k=k(CS0103),
+ MessageFormat: The name '{0}' does not exist in the current context,
Category: Compiler,
DefaultSeverity: Error,
IsEnabledByDefault: true,
@@ -667,18 +713,18 @@ public readonly struct TestTableTaggedEnum : SpacetimeDB.Internal.ITableView SpacetimeDB.Internal.ITableView.DoCount();
- public IEnumerable Iter() => SpacetimeDB.Internal.ITableView.DoIter();
- ^^^^^^^^^^^^^^^^^^^^^^^^^^^
- public global::TestTableTaggedEnum Insert(global::TestTableTaggedEnum row) => SpacetimeDB.Internal.ITableView.DoInsert(row);
+ public global::TestUniqueNotEquatable? Find(TestEnumWithExplicitValues key) => DoFilter(key).Cast().SingleOrDefault();
+ public bool Update(global::TestUniqueNotEquatable row) => DoUpdate(row.PrimaryKeyField, row);
+ ^^^^^^
+}
*/
- Message: The type 'TestTableTaggedEnum' cannot be used as type parameter 'T' in the generic type or method 'ITableView'. There is no implicit reference conversion from 'TestTableTaggedEnum' to 'SpacetimeDB.Internal.ITable'.,
+ Message: Type 'TestUniqueNotEquatable.TestUniqueNotEquatableUniqueIndex' already defines a member called 'Update' with the same parameter types,
Severity: Error,
Descriptor: {
- Id: CS0311,
+ Id: CS0111,
Title: ,
- HelpLink: https://msdn.microsoft.com/query/roslyn.query?appId=roslyn&k=k(CS0311),
- MessageFormat: The type '{3}' cannot be used as type parameter '{2}' in the generic type or method '{0}'. There is no implicit reference conversion from '{3}' to '{1}'.,
+ HelpLink: https://msdn.microsoft.com/query/roslyn.query?appId=roslyn&k=k(CS0111),
+ MessageFormat: Type '{1}' already defines a member called '{0}' with the same parameter types,
Category: Compiler,
DefaultSeverity: Error,
IsEnabledByDefault: true,
@@ -690,18 +736,18 @@ public readonly struct TestTableTaggedEnum : SpacetimeDB.Internal.ITableView SpacetimeDB.Internal.ITableView.DoCount();
- public IEnumerable Iter() => SpacetimeDB.Internal.ITableView.DoIter();
- ^^^^^^^^^^^^^^^^^^^^^^^^^^^
- public global::TestTableTaggedEnum Insert(global::TestTableTaggedEnum row) => SpacetimeDB.Internal.ITableView.DoInsert(row);
+ public global::TestUniqueNotEquatable? Find(TestEnumWithExplicitValues key) => DoFilter(key).Cast().SingleOrDefault();
+ public bool Update(global::TestUniqueNotEquatable row) => DoUpdate(row.PrimaryKeyField, row);
+ ^^^^^^^^
+}
*/
- Message: 'TestTableTaggedEnum' must be a non-abstract type with a public parameterless constructor in order to use it as parameter 'T' in the generic type or method 'ITableView',
+ Message: The name 'DoUpdate' does not exist in the current context,
Severity: Error,
Descriptor: {
- Id: CS0310,
+ Id: CS0103,
Title: ,
- HelpLink: https://msdn.microsoft.com/query/roslyn.query?appId=roslyn&k=k(CS0310),
- MessageFormat: '{2}' must be a non-abstract type with a public parameterless constructor in order to use it as parameter '{1}' in the generic type or method '{0}',
+ HelpLink: https://msdn.microsoft.com/query/roslyn.query?appId=roslyn&k=k(CS0103),
+ MessageFormat: The name '{0}' does not exist in the current context,
Category: Compiler,
DefaultSeverity: Error,
IsEnabledByDefault: true,
@@ -713,18 +759,18 @@ public readonly struct TestTableTaggedEnum : SpacetimeDB.Internal.ITableView Iter() => SpacetimeDB.Internal.ITableView.DoIter();
- public global::TestTableTaggedEnum Insert(global::TestTableTaggedEnum row) => SpacetimeDB.Internal.ITableView.DoInsert(row);
- ^^^^^^^^^^^^^^^^^^^^^^^^^^^
- public bool Delete(global::TestTableTaggedEnum row) => SpacetimeDB.Internal.ITableView.DoDelete(row);
+}
+public TestUniqueNotEquatableUniqueIndex PrimaryKeyField => new(this);
+ ^^^^^^^^^
+}
*/
- Message: The type 'TestTableTaggedEnum' cannot be used as type parameter 'T' in the generic type or method 'ITableView'. There is no implicit reference conversion from 'TestTableTaggedEnum' to 'SpacetimeDB.Internal.ITable'.,
+ Message: The call is ambiguous between the following methods or properties: 'TestUniqueNotEquatable.TestUniqueNotEquatableUniqueIndex.TestUniqueNotEquatableUniqueIndex(TestUniqueNotEquatable)' and 'TestUniqueNotEquatable.TestUniqueNotEquatableUniqueIndex.TestUniqueNotEquatableUniqueIndex(TestUniqueNotEquatable)',
Severity: Error,
Descriptor: {
- Id: CS0311,
+ Id: CS0121,
Title: ,
- HelpLink: https://msdn.microsoft.com/query/roslyn.query?appId=roslyn&k=k(CS0311),
- MessageFormat: The type '{3}' cannot be used as type parameter '{2}' in the generic type or method '{0}'. There is no implicit reference conversion from '{3}' to '{1}'.,
+ HelpLink: https://msdn.microsoft.com/query/roslyn.query?appId=roslyn&k=k(CS0121),
+ MessageFormat: The call is ambiguous between the following methods or properties: '{0}' and '{1}',
Category: Compiler,
DefaultSeverity: Error,
IsEnabledByDefault: true,
@@ -736,18 +782,18 @@ public readonly struct TestTableTaggedEnum : SpacetimeDB.Internal.ITableView Iter() => SpacetimeDB.Internal.ITableView.DoIter();
- public global::TestTableTaggedEnum Insert(global::TestTableTaggedEnum row) => SpacetimeDB.Internal.ITableView.DoInsert(row);
- ^^^^^^^^^^^^^^^^^^^^^^^^^^^
- public bool Delete(global::TestTableTaggedEnum row) => SpacetimeDB.Internal.ITableView.DoDelete(row);
+ public void Invoke(BinaryReader reader, SpacetimeDB.Internal.IReducerContext ctx) {
+ Reducers.TestReducerWithoutContext((SpacetimeDB.ReducerContext)ctx);
+ ^^^^^^^^^^^^^^^^^^^^^^^^^
+ }
*/
- Message: 'TestTableTaggedEnum' must be a non-abstract type with a public parameterless constructor in order to use it as parameter 'T' in the generic type or method 'ITableView',
+ Message: No overload for method 'TestReducerWithoutContext' takes 1 arguments,
Severity: Error,
Descriptor: {
- Id: CS0310,
+ Id: CS1501,
Title: ,
- HelpLink: https://msdn.microsoft.com/query/roslyn.query?appId=roslyn&k=k(CS0310),
- MessageFormat: '{2}' must be a non-abstract type with a public parameterless constructor in order to use it as parameter '{1}' in the generic type or method '{0}',
+ HelpLink: https://msdn.microsoft.com/query/roslyn.query?appId=roslyn&k=k(CS1501),
+ MessageFormat: No overload for method '{0}' takes {1} arguments,
Category: Compiler,
DefaultSeverity: Error,
IsEnabledByDefault: true,
@@ -759,12 +805,12 @@ public readonly struct TestTableTaggedEnum : SpacetimeDB.Internal.ITableView SpacetimeDB.Internal.ITableView.DoInsert(row);
- public bool Delete(global::TestTableTaggedEnum row) => SpacetimeDB.Internal.ITableView.DoDelete(row);
- ^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
+SpacetimeDB.Internal.Module.RegisterTable();
+SpacetimeDB.Internal.Module.RegisterTable();
+ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+SpacetimeDB.Internal.Module.RegisterTable();
*/
- Message: The type 'TestTableTaggedEnum' cannot be used as type parameter 'T' in the generic type or method 'ITableView'. There is no implicit reference conversion from 'TestTableTaggedEnum' to 'SpacetimeDB.Internal.ITable'.,
+ Message: The type 'TestTableTaggedEnum' cannot be used as type parameter 'T' in the generic type or method 'Module.RegisterTable()'. There is no implicit reference conversion from 'TestTableTaggedEnum' to 'SpacetimeDB.BSATN.IStructuralReadWrite'.,
Severity: Error,
Descriptor: {
Id: CS0311,
@@ -782,12 +828,12 @@ public readonly struct TestTableTaggedEnum : SpacetimeDB.Internal.ITableView SpacetimeDB.Internal.ITableView.DoInsert(row);
- public bool Delete(global::TestTableTaggedEnum row) => SpacetimeDB.Internal.ITableView.DoDelete(row);
- ^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
+SpacetimeDB.Internal.Module.RegisterTable();
+SpacetimeDB.Internal.Module.RegisterTable();
+ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+SpacetimeDB.Internal.Module.RegisterTable();
*/
- Message: 'TestTableTaggedEnum' must be a non-abstract type with a public parameterless constructor in order to use it as parameter 'T' in the generic type or method 'ITableView',
+ Message: 'TestTableTaggedEnum' must be a non-abstract type with a public parameterless constructor in order to use it as parameter 'T' in the generic type or method 'Module.RegisterTable()',
Severity: Error,
Descriptor: {
Id: CS0310,
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 294d986eb8f..a3c89ede44e 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
@@ -54,6 +54,46 @@ public readonly struct TestAutoIncNotInteger
return row;
}
+ static SpacetimeDB.Internal.RawTableDefV9 SpacetimeDB.Internal.ITableView<
+ TestAutoIncNotInteger,
+ global::TestAutoIncNotInteger
+ >.MakeTableDesc(SpacetimeDB.BSATN.ITypeRegistrar registrar) =>
+ new(
+ Name: nameof(TestAutoIncNotInteger),
+ ProductTypeRef: (uint)
+ new global::TestAutoIncNotInteger.BSATN().GetAlgebraicType(registrar).Ref_,
+ PrimaryKey: [],
+ Indexes:
+ [
+ new(
+ Name: null,
+ AccessorName: "IdentityField",
+ Algorithm: new SpacetimeDB.Internal.RawIndexAlgorithm.BTree([1])
+ )
+ ],
+ Constraints:
+ [
+ SpacetimeDB.Internal.ITableView<
+ TestAutoIncNotInteger,
+ global::TestAutoIncNotInteger
+ >.MakeUniqueConstraint(1)
+ ],
+ Sequences:
+ [
+ SpacetimeDB.Internal.ITableView<
+ TestAutoIncNotInteger,
+ global::TestAutoIncNotInteger
+ >.MakeSequence(0),
+ SpacetimeDB.Internal.ITableView<
+ TestAutoIncNotInteger,
+ global::TestAutoIncNotInteger
+ >.MakeSequence(1)
+ ],
+ Schedule: null,
+ TableType: SpacetimeDB.Internal.TableType.User,
+ TableAccess: SpacetimeDB.Internal.TableAccess.Private
+ );
+
public ulong Count =>
SpacetimeDB.Internal.ITableView<
TestAutoIncNotInteger,
@@ -116,6 +156,23 @@ public readonly struct TestDuplicateTableName
return row;
}
+ static SpacetimeDB.Internal.RawTableDefV9 SpacetimeDB.Internal.ITableView<
+ TestDuplicateTableName,
+ global::TestDuplicateTableName
+ >.MakeTableDesc(SpacetimeDB.BSATN.ITypeRegistrar registrar) =>
+ new(
+ Name: nameof(TestDuplicateTableName),
+ ProductTypeRef: (uint)
+ new global::TestDuplicateTableName.BSATN().GetAlgebraicType(registrar).Ref_,
+ PrimaryKey: [],
+ Indexes: [],
+ Constraints: [],
+ Sequences: [],
+ Schedule: null,
+ TableType: SpacetimeDB.Internal.TableType.User,
+ TableAccess: SpacetimeDB.Internal.TableAccess.Private
+ );
+
public ulong Count =>
SpacetimeDB.Internal.ITableView<
TestDuplicateTableName,
@@ -141,140 +198,352 @@ public bool Delete(global::TestDuplicateTableName row) =>
>.DoDelete(row);
}
- public readonly struct TestIncompatibleSchedule1
+ public readonly struct TestScheduleWithoutPrimaryKey
: SpacetimeDB.Internal.ITableView<
- TestIncompatibleSchedule1,
- global::TestIncompatibleSchedule
+ TestScheduleWithoutPrimaryKey,
+ global::TestScheduleIssues
>
{
- static global::TestIncompatibleSchedule SpacetimeDB.Internal.ITableView<
- TestIncompatibleSchedule1,
- global::TestIncompatibleSchedule
- >.ReadGenFields(System.IO.BinaryReader reader, global::TestIncompatibleSchedule row)
+ static global::TestScheduleIssues SpacetimeDB.Internal.ITableView<
+ TestScheduleWithoutPrimaryKey,
+ global::TestScheduleIssues
+ >.ReadGenFields(System.IO.BinaryReader reader, global::TestScheduleIssues row)
{
- if (row.ScheduledId == default)
- {
- row.ScheduledId = global::TestIncompatibleSchedule.BSATN.ScheduledId.Read(
- reader
- );
- }
return row;
}
+ static SpacetimeDB.Internal.RawTableDefV9 SpacetimeDB.Internal.ITableView<
+ TestScheduleWithoutPrimaryKey,
+ global::TestScheduleIssues
+ >.MakeTableDesc(SpacetimeDB.BSATN.ITypeRegistrar registrar) =>
+ new(
+ Name: nameof(TestScheduleWithoutPrimaryKey),
+ ProductTypeRef: (uint)
+ new global::TestScheduleIssues.BSATN().GetAlgebraicType(registrar).Ref_,
+ PrimaryKey: [],
+ Indexes: [],
+ Constraints: [],
+ Sequences: [],
+ Schedule: SpacetimeDB.Internal.ITableView<
+ TestScheduleWithoutPrimaryKey,
+ global::TestScheduleIssues
+ >.MakeSchedule("DummyScheduledReducer", 3),
+ TableType: SpacetimeDB.Internal.TableType.User,
+ TableAccess: SpacetimeDB.Internal.TableAccess.Private
+ );
+
public ulong Count =>
SpacetimeDB.Internal.ITableView<
- TestIncompatibleSchedule1,
- global::TestIncompatibleSchedule
+ TestScheduleWithoutPrimaryKey,
+ global::TestScheduleIssues
>.DoCount();
- public IEnumerable Iter() =>
+ public IEnumerable Iter() =>
SpacetimeDB.Internal.ITableView<
- TestIncompatibleSchedule1,
- global::TestIncompatibleSchedule
+ TestScheduleWithoutPrimaryKey,
+ global::TestScheduleIssues
>.DoIter();
- public global::TestIncompatibleSchedule Insert(global::TestIncompatibleSchedule row) =>
+ public global::TestScheduleIssues Insert(global::TestScheduleIssues row) =>
SpacetimeDB.Internal.ITableView<
- TestIncompatibleSchedule1,
- global::TestIncompatibleSchedule
+ TestScheduleWithoutPrimaryKey,
+ global::TestScheduleIssues
>.DoInsert(row);
- public bool Delete(global::TestIncompatibleSchedule row) =>
+ public bool Delete(global::TestScheduleIssues row) =>
SpacetimeDB.Internal.ITableView<
- TestIncompatibleSchedule1,
- global::TestIncompatibleSchedule
+ TestScheduleWithoutPrimaryKey,
+ global::TestScheduleIssues
>.DoDelete(row);
+ }
- public sealed class TestIncompatibleSchedule1UniqueIndex
+ public readonly struct TestScheduleWithoutScheduleAt
+ : SpacetimeDB.Internal.ITableView<
+ TestScheduleWithoutScheduleAt,
+ global::TestScheduleIssues
+ >
+ {
+ static global::TestScheduleIssues SpacetimeDB.Internal.ITableView<
+ TestScheduleWithoutScheduleAt,
+ global::TestScheduleIssues
+ >.ReadGenFields(System.IO.BinaryReader reader, global::TestScheduleIssues row)
+ {
+ return row;
+ }
+
+ static SpacetimeDB.Internal.RawTableDefV9 SpacetimeDB.Internal.ITableView<
+ TestScheduleWithoutScheduleAt,
+ global::TestScheduleIssues
+ >.MakeTableDesc(SpacetimeDB.BSATN.ITypeRegistrar registrar) =>
+ new(
+ Name: nameof(TestScheduleWithoutScheduleAt),
+ ProductTypeRef: (uint)
+ new global::TestScheduleIssues.BSATN().GetAlgebraicType(registrar).Ref_,
+ PrimaryKey: [1],
+ Indexes:
+ [
+ new(
+ Name: null,
+ AccessorName: "IdCorrectType",
+ Algorithm: new SpacetimeDB.Internal.RawIndexAlgorithm.BTree([1])
+ )
+ ],
+ Constraints:
+ [
+ SpacetimeDB.Internal.ITableView<
+ TestScheduleWithoutScheduleAt,
+ global::TestScheduleIssues
+ >.MakeUniqueConstraint(1)
+ ],
+ Sequences: [],
+ Schedule: null,
+ TableType: SpacetimeDB.Internal.TableType.User,
+ TableAccess: SpacetimeDB.Internal.TableAccess.Private
+ );
+
+ public ulong Count =>
+ SpacetimeDB.Internal.ITableView<
+ TestScheduleWithoutScheduleAt,
+ global::TestScheduleIssues
+ >.DoCount();
+
+ public IEnumerable Iter() =>
+ SpacetimeDB.Internal.ITableView<
+ TestScheduleWithoutScheduleAt,
+ global::TestScheduleIssues
+ >.DoIter();
+
+ public global::TestScheduleIssues Insert(global::TestScheduleIssues row) =>
+ SpacetimeDB.Internal.ITableView<
+ TestScheduleWithoutScheduleAt,
+ global::TestScheduleIssues
+ >.DoInsert(row);
+
+ public bool Delete(global::TestScheduleIssues row) =>
+ SpacetimeDB.Internal.ITableView<
+ TestScheduleWithoutScheduleAt,
+ global::TestScheduleIssues
+ >.DoDelete(row);
+
+ public sealed class TestScheduleWithoutScheduleAtUniqueIndex
: UniqueIndex<
- TestIncompatibleSchedule1,
- global::TestIncompatibleSchedule,
- ulong,
- SpacetimeDB.BSATN.U64
+ TestScheduleWithoutScheduleAt,
+ global::TestScheduleIssues,
+ int,
+ SpacetimeDB.BSATN.I32
>
{
- internal TestIncompatibleSchedule1UniqueIndex(TestIncompatibleSchedule1 handle)
- : base(handle, "TestIncompatibleSchedule1_ScheduledId_idx_btree") { }
+ internal TestScheduleWithoutScheduleAtUniqueIndex(
+ TestScheduleWithoutScheduleAt handle
+ )
+ : base(handle, "TestScheduleWithoutScheduleAt_IdCorrectType_idx_btree") { }
// Important: don't move this to the base class.
// C# generics don't play well with nullable types and can't accept both struct-type-based and class-type-based
// `globalName` in one generic definition, leading to buggy `Row?` expansion for either one or another.
- public global::TestIncompatibleSchedule? Find(ulong key) =>
- DoFilter(key).Cast().SingleOrDefault();
+ public global::TestScheduleIssues? Find(int key) =>
+ DoFilter(key).Cast().SingleOrDefault();
- public bool Update(global::TestIncompatibleSchedule row) =>
- DoUpdate(row.ScheduledId, row);
+ public bool Update(global::TestScheduleIssues row) =>
+ DoUpdate(row.IdCorrectType, row);
}
- public TestIncompatibleSchedule1UniqueIndex ScheduledId => new(this);
+ public TestScheduleWithoutScheduleAtUniqueIndex IdCorrectType => new(this);
}
- public readonly struct TestIncompatibleSchedule2
+ public readonly struct TestScheduleWithWrongPrimaryKeyType
: SpacetimeDB.Internal.ITableView<
- TestIncompatibleSchedule2,
- global::TestIncompatibleSchedule
+ TestScheduleWithWrongPrimaryKeyType,
+ global::TestScheduleIssues
>
{
- static global::TestIncompatibleSchedule SpacetimeDB.Internal.ITableView<
- TestIncompatibleSchedule2,
- global::TestIncompatibleSchedule
- >.ReadGenFields(System.IO.BinaryReader reader, global::TestIncompatibleSchedule row)
+ static global::TestScheduleIssues SpacetimeDB.Internal.ITableView<
+ TestScheduleWithWrongPrimaryKeyType,
+ global::TestScheduleIssues
+ >.ReadGenFields(System.IO.BinaryReader reader, global::TestScheduleIssues row)
{
- if (row.ScheduledId == default)
- {
- row.ScheduledId = global::TestIncompatibleSchedule.BSATN.ScheduledId.Read(
- reader
- );
- }
return row;
}
+ static SpacetimeDB.Internal.RawTableDefV9 SpacetimeDB.Internal.ITableView<
+ TestScheduleWithWrongPrimaryKeyType,
+ global::TestScheduleIssues
+ >.MakeTableDesc(SpacetimeDB.BSATN.ITypeRegistrar registrar) =>
+ new(
+ Name: nameof(TestScheduleWithWrongPrimaryKeyType),
+ ProductTypeRef: (uint)
+ new global::TestScheduleIssues.BSATN().GetAlgebraicType(registrar).Ref_,
+ PrimaryKey: [0],
+ Indexes:
+ [
+ new(
+ Name: null,
+ AccessorName: "IdWrongType",
+ Algorithm: new SpacetimeDB.Internal.RawIndexAlgorithm.BTree([0])
+ )
+ ],
+ Constraints:
+ [
+ SpacetimeDB.Internal.ITableView<
+ TestScheduleWithWrongPrimaryKeyType,
+ global::TestScheduleIssues
+ >.MakeUniqueConstraint(0)
+ ],
+ Sequences: [],
+ Schedule: SpacetimeDB.Internal.ITableView<
+ TestScheduleWithWrongPrimaryKeyType,
+ global::TestScheduleIssues
+ >.MakeSchedule("DummyScheduledReducer", 3),
+ TableType: SpacetimeDB.Internal.TableType.User,
+ TableAccess: SpacetimeDB.Internal.TableAccess.Private
+ );
+
public ulong Count =>
SpacetimeDB.Internal.ITableView<
- TestIncompatibleSchedule2,
- global::TestIncompatibleSchedule
+ TestScheduleWithWrongPrimaryKeyType,
+ global::TestScheduleIssues
>.DoCount();
- public IEnumerable Iter() =>
+ public IEnumerable Iter() =>
SpacetimeDB.Internal.ITableView<
- TestIncompatibleSchedule2,
- global::TestIncompatibleSchedule
+ TestScheduleWithWrongPrimaryKeyType,
+ global::TestScheduleIssues
>.DoIter();
- public global::TestIncompatibleSchedule Insert(global::TestIncompatibleSchedule row) =>
+ public global::TestScheduleIssues Insert(global::TestScheduleIssues row) =>
SpacetimeDB.Internal.ITableView<
- TestIncompatibleSchedule2,
- global::TestIncompatibleSchedule
+ TestScheduleWithWrongPrimaryKeyType,
+ global::TestScheduleIssues
>.DoInsert(row);
- public bool Delete(global::TestIncompatibleSchedule row) =>
+ public bool Delete(global::TestScheduleIssues row) =>
SpacetimeDB.Internal.ITableView<
- TestIncompatibleSchedule2,
- global::TestIncompatibleSchedule
+ TestScheduleWithWrongPrimaryKeyType,
+ global::TestScheduleIssues
>.DoDelete(row);
- public sealed class TestIncompatibleSchedule2UniqueIndex
+ public sealed class TestScheduleWithWrongPrimaryKeyTypeUniqueIndex
: UniqueIndex<
- TestIncompatibleSchedule2,
- global::TestIncompatibleSchedule,
- ulong,
- SpacetimeDB.BSATN.U64
+ TestScheduleWithWrongPrimaryKeyType,
+ global::TestScheduleIssues,
+ string,
+ SpacetimeDB.BSATN.String
>
{
- internal TestIncompatibleSchedule2UniqueIndex(TestIncompatibleSchedule2 handle)
- : base(handle, "TestIncompatibleSchedule2_ScheduledId_idx_btree") { }
+ internal TestScheduleWithWrongPrimaryKeyTypeUniqueIndex(
+ TestScheduleWithWrongPrimaryKeyType handle
+ )
+ : base(handle, "TestScheduleWithWrongPrimaryKeyType_IdWrongType_idx_btree") { }
// Important: don't move this to the base class.
// C# generics don't play well with nullable types and can't accept both struct-type-based and class-type-based
// `globalName` in one generic definition, leading to buggy `Row?` expansion for either one or another.
- public global::TestIncompatibleSchedule? Find(ulong key) =>
- DoFilter(key).Cast().SingleOrDefault();
+ public global::TestScheduleIssues? Find(string key) =>
+ DoFilter(key).Cast().SingleOrDefault();
- public bool Update(global::TestIncompatibleSchedule row) =>
- DoUpdate(row.ScheduledId, row);
+ public bool Update(global::TestScheduleIssues row) =>
+ DoUpdate(row.IdWrongType, row);
}
- public TestIncompatibleSchedule2UniqueIndex ScheduledId => new(this);
+ public TestScheduleWithWrongPrimaryKeyTypeUniqueIndex IdWrongType => new(this);
+ }
+
+ public readonly struct TestScheduleWithWrongScheduleAtType
+ : SpacetimeDB.Internal.ITableView<
+ TestScheduleWithWrongScheduleAtType,
+ global::TestScheduleIssues
+ >
+ {
+ static global::TestScheduleIssues SpacetimeDB.Internal.ITableView<
+ TestScheduleWithWrongScheduleAtType,
+ global::TestScheduleIssues
+ >.ReadGenFields(System.IO.BinaryReader reader, global::TestScheduleIssues row)
+ {
+ return row;
+ }
+
+ static SpacetimeDB.Internal.RawTableDefV9 SpacetimeDB.Internal.ITableView<
+ TestScheduleWithWrongScheduleAtType,
+ global::TestScheduleIssues
+ >.MakeTableDesc(SpacetimeDB.BSATN.ITypeRegistrar registrar) =>
+ new(
+ Name: nameof(TestScheduleWithWrongScheduleAtType),
+ ProductTypeRef: (uint)
+ new global::TestScheduleIssues.BSATN().GetAlgebraicType(registrar).Ref_,
+ PrimaryKey: [1],
+ Indexes:
+ [
+ new(
+ Name: null,
+ AccessorName: "IdCorrectType",
+ Algorithm: new SpacetimeDB.Internal.RawIndexAlgorithm.BTree([1])
+ )
+ ],
+ Constraints:
+ [
+ SpacetimeDB.Internal.ITableView<
+ TestScheduleWithWrongScheduleAtType,
+ global::TestScheduleIssues
+ >.MakeUniqueConstraint(1)
+ ],
+ Sequences: [],
+ Schedule: SpacetimeDB.Internal.ITableView<
+ TestScheduleWithWrongScheduleAtType,
+ global::TestScheduleIssues
+ >.MakeSchedule("DummyScheduledReducer", 2),
+ TableType: SpacetimeDB.Internal.TableType.User,
+ TableAccess: SpacetimeDB.Internal.TableAccess.Private
+ );
+
+ public ulong Count =>
+ SpacetimeDB.Internal.ITableView<
+ TestScheduleWithWrongScheduleAtType,
+ global::TestScheduleIssues
+ >.DoCount();
+
+ public IEnumerable Iter() =>
+ SpacetimeDB.Internal.ITableView<
+ TestScheduleWithWrongScheduleAtType,
+ global::TestScheduleIssues
+ >.DoIter();
+
+ public global::TestScheduleIssues Insert(global::TestScheduleIssues row) =>
+ SpacetimeDB.Internal.ITableView<
+ TestScheduleWithWrongScheduleAtType,
+ global::TestScheduleIssues
+ >.DoInsert(row);
+
+ public bool Delete(global::TestScheduleIssues row) =>
+ SpacetimeDB.Internal.ITableView<
+ TestScheduleWithWrongScheduleAtType,
+ global::TestScheduleIssues
+ >.DoDelete(row);
+
+ public sealed class TestScheduleWithWrongScheduleAtTypeUniqueIndex
+ : UniqueIndex<
+ TestScheduleWithWrongScheduleAtType,
+ global::TestScheduleIssues,
+ int,
+ SpacetimeDB.BSATN.I32
+ >
+ {
+ internal TestScheduleWithWrongScheduleAtTypeUniqueIndex(
+ TestScheduleWithWrongScheduleAtType handle
+ )
+ : base(handle, "TestScheduleWithWrongScheduleAtType_IdCorrectType_idx_btree")
+ { }
+
+ // Important: don't move this to the base class.
+ // C# generics don't play well with nullable types and can't accept both struct-type-based and class-type-based
+ // `globalName` in one generic definition, leading to buggy `Row?` expansion for either one or another.
+ public global::TestScheduleIssues? Find(int key) =>
+ DoFilter(key).Cast().SingleOrDefault();
+
+ public bool Update(global::TestScheduleIssues row) =>
+ DoUpdate(row.IdCorrectType, row);
+ }
+
+ public TestScheduleWithWrongScheduleAtTypeUniqueIndex IdCorrectType => new(this);
}
public readonly struct TestTableTaggedEnum
@@ -288,6 +557,23 @@ public readonly struct TestTableTaggedEnum
return row;
}
+ static SpacetimeDB.Internal.RawTableDefV9 SpacetimeDB.Internal.ITableView<
+ TestTableTaggedEnum,
+ global::TestTableTaggedEnum
+ >.MakeTableDesc(SpacetimeDB.BSATN.ITypeRegistrar registrar) =>
+ new(
+ Name: nameof(TestTableTaggedEnum),
+ ProductTypeRef: (uint)
+ new global::TestTableTaggedEnum.BSATN().GetAlgebraicType(registrar).Ref_,
+ PrimaryKey: [],
+ Indexes: [],
+ Constraints: [],
+ Sequences: [],
+ Schedule: null,
+ TableType: SpacetimeDB.Internal.TableType.User,
+ TableAccess: SpacetimeDB.Internal.TableAccess.Private
+ );
+
public ulong Count =>
SpacetimeDB.Internal.ITableView<
TestTableTaggedEnum,
@@ -327,6 +613,45 @@ public readonly struct TestUniqueNotEquatable
return row;
}
+ static SpacetimeDB.Internal.RawTableDefV9 SpacetimeDB.Internal.ITableView<
+ TestUniqueNotEquatable,
+ global::TestUniqueNotEquatable
+ >.MakeTableDesc(SpacetimeDB.BSATN.ITypeRegistrar registrar) =>
+ new(
+ Name: nameof(TestUniqueNotEquatable),
+ ProductTypeRef: (uint)
+ new global::TestUniqueNotEquatable.BSATN().GetAlgebraicType(registrar).Ref_,
+ PrimaryKey: [1],
+ Indexes:
+ [
+ new(
+ Name: null,
+ AccessorName: "UniqueField",
+ Algorithm: new SpacetimeDB.Internal.RawIndexAlgorithm.BTree([0])
+ ),
+ new(
+ Name: null,
+ AccessorName: "PrimaryKeyField",
+ Algorithm: new SpacetimeDB.Internal.RawIndexAlgorithm.BTree([1])
+ )
+ ],
+ Constraints:
+ [
+ SpacetimeDB.Internal.ITableView<
+ TestUniqueNotEquatable,
+ global::TestUniqueNotEquatable
+ >.MakeUniqueConstraint(0),
+ SpacetimeDB.Internal.ITableView<
+ TestUniqueNotEquatable,
+ global::TestUniqueNotEquatable
+ >.MakeUniqueConstraint(1)
+ ],
+ Sequences: [],
+ Schedule: null,
+ TableType: SpacetimeDB.Internal.TableType.User,
+ TableAccess: SpacetimeDB.Internal.TableAccess.Private
+ );
+
public ulong Count =>
SpacetimeDB.Internal.ITableView<
TestUniqueNotEquatable,
@@ -403,8 +728,14 @@ public sealed class Local
{
public Internal.TableHandles.TestAutoIncNotInteger TestAutoIncNotInteger => new();
public Internal.TableHandles.TestDuplicateTableName TestDuplicateTableName => new();
- public Internal.TableHandles.TestIncompatibleSchedule1 TestIncompatibleSchedule1 => new();
- public Internal.TableHandles.TestIncompatibleSchedule2 TestIncompatibleSchedule2 => new();
+ public Internal.TableHandles.TestScheduleWithoutPrimaryKey TestScheduleWithoutPrimaryKey =>
+ new();
+ public Internal.TableHandles.TestScheduleWithoutScheduleAt TestScheduleWithoutScheduleAt =>
+ new();
+ public Internal.TableHandles.TestScheduleWithWrongPrimaryKeyType TestScheduleWithWrongPrimaryKeyType =>
+ new();
+ public Internal.TableHandles.TestScheduleWithWrongScheduleAtType TestScheduleWithWrongScheduleAtType =>
+ new();
public Internal.TableHandles.TestTableTaggedEnum TestTableTaggedEnum => new();
public Internal.TableHandles.TestUniqueNotEquatable TestUniqueNotEquatable => new();
}
@@ -412,35 +743,45 @@ public sealed class Local
static class ModuleRegistration
{
- class TestDuplicateReducerKind1 : SpacetimeDB.Internal.IReducer
+ class __ReducerWithReservedPrefix : SpacetimeDB.Internal.IReducer
{
- public SpacetimeDB.Internal.ReducerDef MakeReducerDef(
+ public SpacetimeDB.Internal.RawReducerDefV9 MakeReducerDef(
SpacetimeDB.BSATN.ITypeRegistrar registrar
- ) => new("__init__", []);
+ ) => new(nameof(__ReducerWithReservedPrefix), [], null);
public void Invoke(BinaryReader reader, SpacetimeDB.Internal.IReducerContext ctx)
{
- Reducers.TestDuplicateReducerKind1((SpacetimeDB.ReducerContext)ctx);
+ Reducers.__ReducerWithReservedPrefix((SpacetimeDB.ReducerContext)ctx);
}
}
- class __ReducerWithReservedPrefix : SpacetimeDB.Internal.IReducer
+ class DummyScheduledReducer : SpacetimeDB.Internal.IReducer
{
- public SpacetimeDB.Internal.ReducerDef MakeReducerDef(
+ private static readonly TestScheduleIssues.BSATN table = new();
+
+ public SpacetimeDB.Internal.RawReducerDefV9 MakeReducerDef(
SpacetimeDB.BSATN.ITypeRegistrar registrar
- ) => new("__ReducerWithReservedPrefix", []);
+ ) =>
+ new(
+ nameof(DummyScheduledReducer),
+ [new(nameof(table), table.GetAlgebraicType(registrar))],
+ null
+ );
public void Invoke(BinaryReader reader, SpacetimeDB.Internal.IReducerContext ctx)
{
- Reducers.__ReducerWithReservedPrefix((SpacetimeDB.ReducerContext)ctx);
+ TestScheduleIssues.DummyScheduledReducer(
+ (SpacetimeDB.ReducerContext)ctx,
+ table.Read(reader)
+ );
}
}
class OnReducerWithReservedPrefix : SpacetimeDB.Internal.IReducer
{
- public SpacetimeDB.Internal.ReducerDef MakeReducerDef(
+ public SpacetimeDB.Internal.RawReducerDefV9 MakeReducerDef(
SpacetimeDB.BSATN.ITypeRegistrar registrar
- ) => new("OnReducerWithReservedPrefix", []);
+ ) => new(nameof(OnReducerWithReservedPrefix), [], null);
public void Invoke(BinaryReader reader, SpacetimeDB.Internal.IReducerContext ctx)
{
@@ -448,44 +789,47 @@ public void Invoke(BinaryReader reader, SpacetimeDB.Internal.IReducerContext ctx
}
}
- class TestDuplicateReducerName : SpacetimeDB.Internal.IReducer
+ class TestDuplicateReducerKind1 : SpacetimeDB.Internal.IReducer
{
- public SpacetimeDB.Internal.ReducerDef MakeReducerDef(
+ public SpacetimeDB.Internal.RawReducerDefV9 MakeReducerDef(
SpacetimeDB.BSATN.ITypeRegistrar registrar
- ) => new("TestDuplicateReducerName", []);
+ ) => new(nameof(TestDuplicateReducerKind1), [], SpacetimeDB.Internal.Lifecycle.Init);
public void Invoke(BinaryReader reader, SpacetimeDB.Internal.IReducerContext ctx)
{
- Reducers.TestDuplicateReducerName((SpacetimeDB.ReducerContext)ctx);
+ Reducers.TestDuplicateReducerKind1((SpacetimeDB.ReducerContext)ctx);
}
}
- class TestIncompatibleScheduleReducer : SpacetimeDB.Internal.IReducer
+ class TestDuplicateReducerKind2 : SpacetimeDB.Internal.IReducer
{
- private static readonly TestIncompatibleSchedule.BSATN table = new();
+ public SpacetimeDB.Internal.RawReducerDefV9 MakeReducerDef(
+ SpacetimeDB.BSATN.ITypeRegistrar registrar
+ ) => new(nameof(TestDuplicateReducerKind2), [], SpacetimeDB.Internal.Lifecycle.Init);
+
+ public void Invoke(BinaryReader reader, SpacetimeDB.Internal.IReducerContext ctx)
+ {
+ Reducers.TestDuplicateReducerKind2((SpacetimeDB.ReducerContext)ctx);
+ }
+ }
- public SpacetimeDB.Internal.ReducerDef MakeReducerDef(
+ class TestDuplicateReducerName : SpacetimeDB.Internal.IReducer
+ {
+ public SpacetimeDB.Internal.RawReducerDefV9 MakeReducerDef(
SpacetimeDB.BSATN.ITypeRegistrar registrar
- ) =>
- new(
- "TestIncompatibleScheduleReducer",
- [new(nameof(table), table.GetAlgebraicType(registrar))]
- );
+ ) => new(nameof(TestDuplicateReducerName), [], null);
public void Invoke(BinaryReader reader, SpacetimeDB.Internal.IReducerContext ctx)
{
- TestIncompatibleSchedule.TestIncompatibleScheduleReducer(
- (SpacetimeDB.ReducerContext)ctx,
- table.Read(reader)
- );
+ Reducers.TestDuplicateReducerName((SpacetimeDB.ReducerContext)ctx);
}
}
class TestReducerReturnType : SpacetimeDB.Internal.IReducer
{
- public SpacetimeDB.Internal.ReducerDef MakeReducerDef(
+ public SpacetimeDB.Internal.RawReducerDefV9 MakeReducerDef(
SpacetimeDB.BSATN.ITypeRegistrar registrar
- ) => new("TestReducerReturnType", []);
+ ) => new(nameof(TestReducerReturnType), [], null);
public void Invoke(BinaryReader reader, SpacetimeDB.Internal.IReducerContext ctx)
{
@@ -495,9 +839,9 @@ public void Invoke(BinaryReader reader, SpacetimeDB.Internal.IReducerContext ctx
class TestReducerWithoutContext : SpacetimeDB.Internal.IReducer
{
- public SpacetimeDB.Internal.ReducerDef MakeReducerDef(
+ public SpacetimeDB.Internal.RawReducerDefV9 MakeReducerDef(
SpacetimeDB.BSATN.ITypeRegistrar registrar
- ) => new("TestReducerWithoutContext", []);
+ ) => new(nameof(TestReducerWithoutContext), [], null);
public void Invoke(BinaryReader reader, SpacetimeDB.Internal.IReducerContext ctx)
{
@@ -523,18 +867,46 @@ public static void Main()
new SpacetimeDB.ReducerContext(identity, address, random, time)
);
- SpacetimeDB.Internal.Module.RegisterReducer();
SpacetimeDB.Internal.Module.RegisterReducer<__ReducerWithReservedPrefix>();
+ SpacetimeDB.Internal.Module.RegisterReducer();
SpacetimeDB.Internal.Module.RegisterReducer();
+ SpacetimeDB.Internal.Module.RegisterReducer();
+ SpacetimeDB.Internal.Module.RegisterReducer();
SpacetimeDB.Internal.Module.RegisterReducer();
- SpacetimeDB.Internal.Module.RegisterReducer();
SpacetimeDB.Internal.Module.RegisterReducer();
SpacetimeDB.Internal.Module.RegisterReducer();
- SpacetimeDB.Internal.Module.RegisterTable();
- SpacetimeDB.Internal.Module.RegisterTable();
- SpacetimeDB.Internal.Module.RegisterTable();
- SpacetimeDB.Internal.Module.RegisterTable();
- SpacetimeDB.Internal.Module.RegisterTable();
+ SpacetimeDB.Internal.Module.RegisterTable<
+ global::TestAutoIncNotInteger,
+ SpacetimeDB.Internal.TableHandles.TestAutoIncNotInteger
+ >();
+ SpacetimeDB.Internal.Module.RegisterTable<
+ global::TestDuplicateTableName,
+ SpacetimeDB.Internal.TableHandles.TestDuplicateTableName
+ >();
+ SpacetimeDB.Internal.Module.RegisterTable<
+ global::TestScheduleIssues,
+ SpacetimeDB.Internal.TableHandles.TestScheduleWithoutPrimaryKey
+ >();
+ SpacetimeDB.Internal.Module.RegisterTable<
+ global::TestScheduleIssues,
+ SpacetimeDB.Internal.TableHandles.TestScheduleWithoutScheduleAt
+ >();
+ SpacetimeDB.Internal.Module.RegisterTable<
+ global::TestScheduleIssues,
+ SpacetimeDB.Internal.TableHandles.TestScheduleWithWrongPrimaryKeyType
+ >();
+ SpacetimeDB.Internal.Module.RegisterTable<
+ global::TestScheduleIssues,
+ SpacetimeDB.Internal.TableHandles.TestScheduleWithWrongScheduleAtType
+ >();
+ SpacetimeDB.Internal.Module.RegisterTable<
+ global::TestTableTaggedEnum,
+ SpacetimeDB.Internal.TableHandles.TestTableTaggedEnum
+ >();
+ SpacetimeDB.Internal.Module.RegisterTable<
+ global::TestUniqueNotEquatable,
+ SpacetimeDB.Internal.TableHandles.TestUniqueNotEquatable
+ >();
}
// Exports only work from the main assembly, so we need to generate forwarding methods.
diff --git a/crates/bindings-csharp/Codegen.Tests/fixtures/diag/snapshots/Module#InAnotherNamespace.TestDuplicateTableName.verified.cs b/crates/bindings-csharp/Codegen.Tests/fixtures/diag/snapshots/Module#InAnotherNamespace.TestDuplicateTableName.verified.cs
index 4c8719683c7..130e8da0694 100644
--- a/crates/bindings-csharp/Codegen.Tests/fixtures/diag/snapshots/Module#InAnotherNamespace.TestDuplicateTableName.verified.cs
+++ b/crates/bindings-csharp/Codegen.Tests/fixtures/diag/snapshots/Module#InAnotherNamespace.TestDuplicateTableName.verified.cs
@@ -4,7 +4,7 @@
partial class InAnotherNamespace
{
- partial struct TestDuplicateTableName : SpacetimeDB.Internal.ITable
+ partial struct TestDuplicateTableName : SpacetimeDB.BSATN.IStructuralReadWrite
{
public void ReadFields(System.IO.BinaryReader reader) { }
@@ -26,7 +26,7 @@ InAnotherNamespace.TestDuplicateTableName value
value.WriteFields(writer);
}
- public SpacetimeDB.BSATN.AlgebraicType GetAlgebraicType(
+ public SpacetimeDB.BSATN.AlgebraicType.Ref GetAlgebraicType(
SpacetimeDB.BSATN.ITypeRegistrar registrar
) =>
registrar.RegisterType(
@@ -34,31 +34,10 @@ SpacetimeDB.BSATN.ITypeRegistrar registrar
new SpacetimeDB.BSATN.AggregateElement[] { }
)
);
- }
- static IEnumerable SpacetimeDB.Internal.ITable.MakeTableDesc(
- SpacetimeDB.BSATN.ITypeRegistrar registrar
- ) =>
- [
- new(
- new(
- TableName: nameof(SpacetimeDB.Local.TestDuplicateTableName),
- Columns: [],
- Indexes: [],
- Constraints: [],
- Sequences: [],
- // "system" | "user"
- TableType: "user",
- // "public" | "private"
- TableAccess: "private",
- Scheduled: null
- ),
- (uint)
- (
- (SpacetimeDB.BSATN.AlgebraicType.Ref)
- new BSATN().GetAlgebraicType(registrar)
- ).Ref_
- ),
- ];
+ SpacetimeDB.BSATN.AlgebraicType SpacetimeDB.BSATN.IReadWrite.GetAlgebraicType(
+ SpacetimeDB.BSATN.ITypeRegistrar registrar
+ ) => GetAlgebraicType(registrar);
+ }
} // TestDuplicateTableName
} // InAnotherNamespace
diff --git a/crates/bindings-csharp/Codegen.Tests/fixtures/diag/snapshots/Module#Reducers.InAnotherNamespace.TestDuplicateReducerName.verified.cs b/crates/bindings-csharp/Codegen.Tests/fixtures/diag/snapshots/Module#Reducers.InAnotherNamespace.TestDuplicateReducerName.verified.cs
index 79f324641ec..d3235595557 100644
--- a/crates/bindings-csharp/Codegen.Tests/fixtures/diag/snapshots/Module#Reducers.InAnotherNamespace.TestDuplicateReducerName.verified.cs
+++ b/crates/bindings-csharp/Codegen.Tests/fixtures/diag/snapshots/Module#Reducers.InAnotherNamespace.TestDuplicateReducerName.verified.cs
@@ -13,7 +13,7 @@ public static void VolatileNonatomicScheduleImmediateTestDuplicateReducerName()
using var writer = new BinaryWriter(stream);
SpacetimeDB.Internal.IReducer.VolatileNonatomicScheduleImmediate(
- "TestDuplicateReducerName",
+ nameof(TestDuplicateReducerName),
stream
);
}
diff --git a/crates/bindings-csharp/Codegen.Tests/fixtures/diag/snapshots/Module#Reducers.OnReducerWithReservedPrefix.verified.cs b/crates/bindings-csharp/Codegen.Tests/fixtures/diag/snapshots/Module#Reducers.OnReducerWithReservedPrefix.verified.cs
index e1bb60b457e..058b95c0c43 100644
--- a/crates/bindings-csharp/Codegen.Tests/fixtures/diag/snapshots/Module#Reducers.OnReducerWithReservedPrefix.verified.cs
+++ b/crates/bindings-csharp/Codegen.Tests/fixtures/diag/snapshots/Module#Reducers.OnReducerWithReservedPrefix.verified.cs
@@ -11,7 +11,7 @@ public static void VolatileNonatomicScheduleImmediateOnReducerWithReservedPrefix
using var writer = new BinaryWriter(stream);
SpacetimeDB.Internal.IReducer.VolatileNonatomicScheduleImmediate(
- "OnReducerWithReservedPrefix",
+ nameof(OnReducerWithReservedPrefix),
stream
);
}
diff --git a/crates/bindings-csharp/Codegen.Tests/fixtures/diag/snapshots/Module#Reducers.TestDuplicateReducerKind1.verified.cs b/crates/bindings-csharp/Codegen.Tests/fixtures/diag/snapshots/Module#Reducers.TestDuplicateReducerKind1.verified.cs
index 26dcf01debd..a7ad2e1574d 100644
--- a/crates/bindings-csharp/Codegen.Tests/fixtures/diag/snapshots/Module#Reducers.TestDuplicateReducerKind1.verified.cs
+++ b/crates/bindings-csharp/Codegen.Tests/fixtures/diag/snapshots/Module#Reducers.TestDuplicateReducerKind1.verified.cs
@@ -10,6 +10,9 @@ public static void VolatileNonatomicScheduleImmediateTestDuplicateReducerKind1()
using var stream = new MemoryStream();
using var writer = new BinaryWriter(stream);
- SpacetimeDB.Internal.IReducer.VolatileNonatomicScheduleImmediate("__init__", stream);
+ SpacetimeDB.Internal.IReducer.VolatileNonatomicScheduleImmediate(
+ nameof(TestDuplicateReducerKind1),
+ stream
+ );
}
} // Reducers
diff --git a/crates/bindings-csharp/Codegen.Tests/fixtures/diag/snapshots/Module#Reducers.TestDuplicateReducerKind2.verified.cs b/crates/bindings-csharp/Codegen.Tests/fixtures/diag/snapshots/Module#Reducers.TestDuplicateReducerKind2.verified.cs
index ed109522242..2d0fa1d5c40 100644
--- a/crates/bindings-csharp/Codegen.Tests/fixtures/diag/snapshots/Module#Reducers.TestDuplicateReducerKind2.verified.cs
+++ b/crates/bindings-csharp/Codegen.Tests/fixtures/diag/snapshots/Module#Reducers.TestDuplicateReducerKind2.verified.cs
@@ -10,6 +10,9 @@ public static void VolatileNonatomicScheduleImmediateTestDuplicateReducerKind2()
using var stream = new MemoryStream();
using var writer = new BinaryWriter(stream);
- SpacetimeDB.Internal.IReducer.VolatileNonatomicScheduleImmediate("__init__", stream);
+ SpacetimeDB.Internal.IReducer.VolatileNonatomicScheduleImmediate(
+ nameof(TestDuplicateReducerKind2),
+ stream
+ );
}
} // Reducers
diff --git a/crates/bindings-csharp/Codegen.Tests/fixtures/diag/snapshots/Module#Reducers.TestDuplicateReducerName.verified.cs b/crates/bindings-csharp/Codegen.Tests/fixtures/diag/snapshots/Module#Reducers.TestDuplicateReducerName.verified.cs
index 8de882954d2..2bd8ae447b7 100644
--- a/crates/bindings-csharp/Codegen.Tests/fixtures/diag/snapshots/Module#Reducers.TestDuplicateReducerName.verified.cs
+++ b/crates/bindings-csharp/Codegen.Tests/fixtures/diag/snapshots/Module#Reducers.TestDuplicateReducerName.verified.cs
@@ -11,7 +11,7 @@ public static void VolatileNonatomicScheduleImmediateTestDuplicateReducerName()
using var writer = new BinaryWriter(stream);
SpacetimeDB.Internal.IReducer.VolatileNonatomicScheduleImmediate(
- "TestDuplicateReducerName",
+ nameof(TestDuplicateReducerName),
stream
);
}
diff --git a/crates/bindings-csharp/Codegen.Tests/fixtures/diag/snapshots/Module#Reducers.TestReducerReturnType.verified.cs b/crates/bindings-csharp/Codegen.Tests/fixtures/diag/snapshots/Module#Reducers.TestReducerReturnType.verified.cs
index 78ecae225fe..3e4c6571395 100644
--- a/crates/bindings-csharp/Codegen.Tests/fixtures/diag/snapshots/Module#Reducers.TestReducerReturnType.verified.cs
+++ b/crates/bindings-csharp/Codegen.Tests/fixtures/diag/snapshots/Module#Reducers.TestReducerReturnType.verified.cs
@@ -11,7 +11,7 @@ public static void VolatileNonatomicScheduleImmediateTestReducerReturnType()
using var writer = new BinaryWriter(stream);
SpacetimeDB.Internal.IReducer.VolatileNonatomicScheduleImmediate(
- "TestReducerReturnType",
+ nameof(TestReducerReturnType),
stream
);
}
diff --git a/crates/bindings-csharp/Codegen.Tests/fixtures/diag/snapshots/Module#Reducers.TestReducerWithoutContext.verified.cs b/crates/bindings-csharp/Codegen.Tests/fixtures/diag/snapshots/Module#Reducers.TestReducerWithoutContext.verified.cs
index f05edb4fd5c..be30e5b7e5b 100644
--- a/crates/bindings-csharp/Codegen.Tests/fixtures/diag/snapshots/Module#Reducers.TestReducerWithoutContext.verified.cs
+++ b/crates/bindings-csharp/Codegen.Tests/fixtures/diag/snapshots/Module#Reducers.TestReducerWithoutContext.verified.cs
@@ -11,7 +11,7 @@ public static void VolatileNonatomicScheduleImmediateTestReducerWithoutContext()
using var writer = new BinaryWriter(stream);
SpacetimeDB.Internal.IReducer.VolatileNonatomicScheduleImmediate(
- "TestReducerWithoutContext",
+ nameof(TestReducerWithoutContext),
stream
);
}
diff --git a/crates/bindings-csharp/Codegen.Tests/fixtures/diag/snapshots/Module#Reducers.__ReducerWithReservedPrefix.verified.cs b/crates/bindings-csharp/Codegen.Tests/fixtures/diag/snapshots/Module#Reducers.__ReducerWithReservedPrefix.verified.cs
index e7cbe63e389..78e0e7bcff5 100644
--- a/crates/bindings-csharp/Codegen.Tests/fixtures/diag/snapshots/Module#Reducers.__ReducerWithReservedPrefix.verified.cs
+++ b/crates/bindings-csharp/Codegen.Tests/fixtures/diag/snapshots/Module#Reducers.__ReducerWithReservedPrefix.verified.cs
@@ -11,7 +11,7 @@ public static void VolatileNonatomicScheduleImmediate__ReducerWithReservedPrefix
using var writer = new BinaryWriter(stream);
SpacetimeDB.Internal.IReducer.VolatileNonatomicScheduleImmediate(
- "__ReducerWithReservedPrefix",
+ nameof(__ReducerWithReservedPrefix),
stream
);
}
diff --git a/crates/bindings-csharp/Codegen.Tests/fixtures/diag/snapshots/Module#TestAutoIncNotInteger.verified.cs b/crates/bindings-csharp/Codegen.Tests/fixtures/diag/snapshots/Module#TestAutoIncNotInteger.verified.cs
index bd8dfba24cc..02975bc53bd 100644
--- a/crates/bindings-csharp/Codegen.Tests/fixtures/diag/snapshots/Module#TestAutoIncNotInteger.verified.cs
+++ b/crates/bindings-csharp/Codegen.Tests/fixtures/diag/snapshots/Module#TestAutoIncNotInteger.verified.cs
@@ -2,7 +2,7 @@
//
#nullable enable
-partial struct TestAutoIncNotInteger : SpacetimeDB.Internal.ITable
+partial struct TestAutoIncNotInteger : SpacetimeDB.BSATN.IStructuralReadWrite
{
public void ReadFields(System.IO.BinaryReader reader)
{
@@ -29,7 +29,7 @@ public void Write(System.IO.BinaryWriter writer, TestAutoIncNotInteger value)
value.WriteFields(writer);
}
- public SpacetimeDB.BSATN.AlgebraicType GetAlgebraicType(
+ public SpacetimeDB.BSATN.AlgebraicType.Ref GetAlgebraicType(
SpacetimeDB.BSATN.ITypeRegistrar registrar
) =>
registrar.RegisterType(
@@ -41,45 +41,9 @@ SpacetimeDB.BSATN.ITypeRegistrar registrar
}
)
);
- }
- static IEnumerable SpacetimeDB.Internal.ITable.MakeTableDesc(
- SpacetimeDB.BSATN.ITypeRegistrar registrar
- ) =>
- [
- new(
- new(
- TableName: nameof(SpacetimeDB.Local.TestAutoIncNotInteger),
- Columns:
- [
- new(nameof(AutoIncField), BSATN.AutoIncField.GetAlgebraicType(registrar)),
- new(nameof(IdentityField), BSATN.IdentityField.GetAlgebraicType(registrar))
- ],
- Indexes: [],
- Constraints:
- [
- new(
- "TestAutoIncNotInteger_AutoIncField",
- (byte)SpacetimeDB.Internal.ColumnAttrs.AutoInc,
- [0]
- ),
- new(
- "TestAutoIncNotInteger_IdentityField",
- (byte)SpacetimeDB.Internal.ColumnAttrs.Identity,
- [1]
- )
- ],
- Sequences: [],
- // "system" | "user"
- TableType: "user",
- // "public" | "private"
- TableAccess: "private",
- Scheduled: null
- ),
- (uint)
- (
- (SpacetimeDB.BSATN.AlgebraicType.Ref)new BSATN().GetAlgebraicType(registrar)
- ).Ref_
- ),
- ];
+ SpacetimeDB.BSATN.AlgebraicType SpacetimeDB.BSATN.IReadWrite.GetAlgebraicType(
+ SpacetimeDB.BSATN.ITypeRegistrar registrar
+ ) => GetAlgebraicType(registrar);
+ }
} // TestAutoIncNotInteger
diff --git a/crates/bindings-csharp/Codegen.Tests/fixtures/diag/snapshots/Module#TestDuplicateTableName.verified.cs b/crates/bindings-csharp/Codegen.Tests/fixtures/diag/snapshots/Module#TestDuplicateTableName.verified.cs
index 0cf0b34c9f6..4c9b674dbb7 100644
--- a/crates/bindings-csharp/Codegen.Tests/fixtures/diag/snapshots/Module#TestDuplicateTableName.verified.cs
+++ b/crates/bindings-csharp/Codegen.Tests/fixtures/diag/snapshots/Module#TestDuplicateTableName.verified.cs
@@ -2,7 +2,7 @@
//
#nullable enable
-partial struct TestDuplicateTableName : SpacetimeDB.Internal.ITable
+partial struct TestDuplicateTableName : SpacetimeDB.BSATN.IStructuralReadWrite
{
public void ReadFields(System.IO.BinaryReader reader) { }
@@ -18,7 +18,7 @@ public void Write(System.IO.BinaryWriter writer, TestDuplicateTableName value)
value.WriteFields(writer);
}
- public SpacetimeDB.BSATN.AlgebraicType GetAlgebraicType(
+ public SpacetimeDB.BSATN.AlgebraicType.Ref GetAlgebraicType(
SpacetimeDB.BSATN.ITypeRegistrar registrar
) =>
registrar.RegisterType(
@@ -26,29 +26,9 @@ SpacetimeDB.BSATN.ITypeRegistrar registrar
new SpacetimeDB.BSATN.AggregateElement[] { }
)
);
- }
- static IEnumerable SpacetimeDB.Internal.ITable.MakeTableDesc(
- SpacetimeDB.BSATN.ITypeRegistrar registrar
- ) =>
- [
- new(
- new(
- TableName: nameof(SpacetimeDB.Local.TestDuplicateTableName),
- Columns: [],
- Indexes: [],
- Constraints: [],
- Sequences: [],
- // "system" | "user"
- TableType: "user",
- // "public" | "private"
- TableAccess: "private",
- Scheduled: null
- ),
- (uint)
- (
- (SpacetimeDB.BSATN.AlgebraicType.Ref)new BSATN().GetAlgebraicType(registrar)
- ).Ref_
- ),
- ];
+ SpacetimeDB.BSATN.AlgebraicType SpacetimeDB.BSATN.IReadWrite.GetAlgebraicType(
+ SpacetimeDB.BSATN.ITypeRegistrar registrar
+ ) => GetAlgebraicType(registrar);
+ }
} // TestDuplicateTableName
diff --git a/crates/bindings-csharp/Codegen.Tests/fixtures/diag/snapshots/Module#TestIncompatibleSchedule.TestIncompatibleScheduleReducer.verified.cs b/crates/bindings-csharp/Codegen.Tests/fixtures/diag/snapshots/Module#TestIncompatibleSchedule.TestIncompatibleScheduleReducer.verified.cs
deleted file mode 100644
index 226f5a450a7..00000000000
--- a/crates/bindings-csharp/Codegen.Tests/fixtures/diag/snapshots/Module#TestIncompatibleSchedule.TestIncompatibleScheduleReducer.verified.cs
+++ /dev/null
@@ -1,20 +0,0 @@
-//HintName: TestIncompatibleSchedule.TestIncompatibleScheduleReducer.cs
-//
-#nullable enable
-
-partial struct TestIncompatibleSchedule
-{
- [System.Diagnostics.CodeAnalysis.Experimental("STDB_UNSTABLE")]
- public static void VolatileNonatomicScheduleImmediateTestIncompatibleScheduleReducer(
- TestIncompatibleSchedule table
- )
- {
- using var stream = new MemoryStream();
- using var writer = new BinaryWriter(stream);
- new TestIncompatibleSchedule.BSATN().Write(writer, table);
- SpacetimeDB.Internal.IReducer.VolatileNonatomicScheduleImmediate(
- "TestIncompatibleScheduleReducer",
- stream
- );
- }
-} // TestIncompatibleSchedule
diff --git a/crates/bindings-csharp/Codegen.Tests/fixtures/diag/snapshots/Module#TestIncompatibleSchedule.verified.cs b/crates/bindings-csharp/Codegen.Tests/fixtures/diag/snapshots/Module#TestIncompatibleSchedule.verified.cs
deleted file mode 100644
index b19217b5193..00000000000
--- a/crates/bindings-csharp/Codegen.Tests/fixtures/diag/snapshots/Module#TestIncompatibleSchedule.verified.cs
+++ /dev/null
@@ -1,113 +0,0 @@
-//HintName: TestIncompatibleSchedule.cs
-//
-#nullable enable
-
-[System.Runtime.InteropServices.StructLayout(System.Runtime.InteropServices.LayoutKind.Auto)]
-partial struct TestIncompatibleSchedule : SpacetimeDB.Internal.ITable
-{
- public void ReadFields(System.IO.BinaryReader reader)
- {
- ScheduledId = BSATN.ScheduledId.Read(reader);
- ScheduledAt = BSATN.ScheduledAt.Read(reader);
- }
-
- public void WriteFields(System.IO.BinaryWriter writer)
- {
- BSATN.ScheduledId.Write(writer, ScheduledId);
- BSATN.ScheduledAt.Write(writer, ScheduledAt);
- }
-
- public readonly partial struct BSATN : SpacetimeDB.BSATN.IReadWrite
- {
- internal static readonly SpacetimeDB.BSATN.U64 ScheduledId = new();
- internal static readonly SpacetimeDB.ScheduleAt.BSATN ScheduledAt = new();
-
- public TestIncompatibleSchedule Read(System.IO.BinaryReader reader) =>
- SpacetimeDB.BSATN.IStructuralReadWrite.Read(reader);
-
- public void Write(System.IO.BinaryWriter writer, TestIncompatibleSchedule value)
- {
- value.WriteFields(writer);
- }
-
- public SpacetimeDB.BSATN.AlgebraicType GetAlgebraicType(
- SpacetimeDB.BSATN.ITypeRegistrar registrar
- ) =>
- registrar.RegisterType(
- _ => new SpacetimeDB.BSATN.AlgebraicType.Product(
- new SpacetimeDB.BSATN.AggregateElement[]
- {
- new(nameof(ScheduledId), ScheduledId.GetAlgebraicType(registrar)),
- new(nameof(ScheduledAt), ScheduledAt.GetAlgebraicType(registrar))
- }
- )
- );
- }
-
- public ulong ScheduledId;
- public SpacetimeDB.ScheduleAt ScheduledAt;
-
- static IEnumerable SpacetimeDB.Internal.ITable.MakeTableDesc(
- SpacetimeDB.BSATN.ITypeRegistrar registrar
- ) =>
- [
- new(
- new(
- TableName: nameof(SpacetimeDB.Local.TestIncompatibleSchedule1),
- Columns:
- [
- new(nameof(ScheduledId), BSATN.ScheduledId.GetAlgebraicType(registrar)),
- new(nameof(ScheduledAt), BSATN.ScheduledAt.GetAlgebraicType(registrar))
- ],
- Indexes: [],
- Constraints:
- [
- new(
- "TestIncompatibleSchedule1_ScheduledId",
- (byte)SpacetimeDB.Internal.ColumnAttrs.PrimaryKeyAuto,
- [0]
- )
- ],
- Sequences: [],
- // "system" | "user"
- TableType: "user",
- // "public" | "private"
- TableAccess: "private",
- Scheduled: "TestIncompatibleScheduleReducer"
- ),
- (uint)
- (
- (SpacetimeDB.BSATN.AlgebraicType.Ref)new BSATN().GetAlgebraicType(registrar)
- ).Ref_
- ),
- new(
- new(
- TableName: nameof(SpacetimeDB.Local.TestIncompatibleSchedule2),
- Columns:
- [
- new(nameof(ScheduledId), BSATN.ScheduledId.GetAlgebraicType(registrar)),
- new(nameof(ScheduledAt), BSATN.ScheduledAt.GetAlgebraicType(registrar))
- ],
- Indexes: [],
- Constraints:
- [
- new(
- "TestIncompatibleSchedule2_ScheduledId",
- (byte)SpacetimeDB.Internal.ColumnAttrs.PrimaryKeyAuto,
- [0]
- )
- ],
- Sequences: [],
- // "system" | "user"
- TableType: "user",
- // "public" | "private"
- TableAccess: "private",
- Scheduled: null
- ),
- (uint)
- (
- (SpacetimeDB.BSATN.AlgebraicType.Ref)new BSATN().GetAlgebraicType(registrar)
- ).Ref_
- ),
- ];
-} // TestIncompatibleSchedule
diff --git a/crates/bindings-csharp/Codegen.Tests/fixtures/diag/snapshots/Module#TestScheduleIssues.DummyScheduledReducer.verified.cs b/crates/bindings-csharp/Codegen.Tests/fixtures/diag/snapshots/Module#TestScheduleIssues.DummyScheduledReducer.verified.cs
new file mode 100644
index 00000000000..c5f5137dc91
--- /dev/null
+++ b/crates/bindings-csharp/Codegen.Tests/fixtures/diag/snapshots/Module#TestScheduleIssues.DummyScheduledReducer.verified.cs
@@ -0,0 +1,20 @@
+//HintName: TestScheduleIssues.DummyScheduledReducer.cs
+//
+#nullable enable
+
+partial struct TestScheduleIssues
+{
+ [System.Diagnostics.CodeAnalysis.Experimental("STDB_UNSTABLE")]
+ public static void VolatileNonatomicScheduleImmediateDummyScheduledReducer(
+ TestScheduleIssues table
+ )
+ {
+ using var stream = new MemoryStream();
+ using var writer = new BinaryWriter(stream);
+ new TestScheduleIssues.BSATN().Write(writer, table);
+ SpacetimeDB.Internal.IReducer.VolatileNonatomicScheduleImmediate(
+ nameof(DummyScheduledReducer),
+ stream
+ );
+ }
+} // TestScheduleIssues
diff --git a/crates/bindings-csharp/Codegen.Tests/fixtures/diag/snapshots/Module#TestScheduleIssues.verified.cs b/crates/bindings-csharp/Codegen.Tests/fixtures/diag/snapshots/Module#TestScheduleIssues.verified.cs
new file mode 100644
index 00000000000..72612e1c0e9
--- /dev/null
+++ b/crates/bindings-csharp/Codegen.Tests/fixtures/diag/snapshots/Module#TestScheduleIssues.verified.cs
@@ -0,0 +1,63 @@
+//HintName: TestScheduleIssues.cs
+//
+#nullable enable
+
+partial struct TestScheduleIssues : SpacetimeDB.BSATN.IStructuralReadWrite
+{
+ public void ReadFields(System.IO.BinaryReader reader)
+ {
+ IdWrongType = BSATN.IdWrongType.Read(reader);
+ IdCorrectType = BSATN.IdCorrectType.Read(reader);
+ ScheduleAtWrongType = BSATN.ScheduleAtWrongType.Read(reader);
+ ScheduleAtCorrectType = BSATN.ScheduleAtCorrectType.Read(reader);
+ }
+
+ public void WriteFields(System.IO.BinaryWriter writer)
+ {
+ BSATN.IdWrongType.Write(writer, IdWrongType);
+ BSATN.IdCorrectType.Write(writer, IdCorrectType);
+ BSATN.ScheduleAtWrongType.Write(writer, ScheduleAtWrongType);
+ BSATN.ScheduleAtCorrectType.Write(writer, ScheduleAtCorrectType);
+ }
+
+ public readonly partial struct BSATN : SpacetimeDB.BSATN.IReadWrite
+ {
+ internal static readonly SpacetimeDB.BSATN.String IdWrongType = new();
+ internal static readonly SpacetimeDB.BSATN.I32 IdCorrectType = new();
+ internal static readonly SpacetimeDB.BSATN.I32 ScheduleAtWrongType = new();
+ internal static readonly SpacetimeDB.ScheduleAt.BSATN ScheduleAtCorrectType = new();
+
+ public TestScheduleIssues Read(System.IO.BinaryReader reader) =>
+ SpacetimeDB.BSATN.IStructuralReadWrite.Read(reader);
+
+ public void Write(System.IO.BinaryWriter writer, TestScheduleIssues value)
+ {
+ value.WriteFields(writer);
+ }
+
+ public SpacetimeDB.BSATN.AlgebraicType.Ref GetAlgebraicType(
+ SpacetimeDB.BSATN.ITypeRegistrar registrar
+ ) =>
+ registrar.RegisterType(
+ _ => new SpacetimeDB.BSATN.AlgebraicType.Product(
+ new SpacetimeDB.BSATN.AggregateElement[]
+ {
+ new(nameof(IdWrongType), IdWrongType.GetAlgebraicType(registrar)),
+ new(nameof(IdCorrectType), IdCorrectType.GetAlgebraicType(registrar)),
+ new(
+ nameof(ScheduleAtWrongType),
+ ScheduleAtWrongType.GetAlgebraicType(registrar)
+ ),
+ new(
+ nameof(ScheduleAtCorrectType),
+ ScheduleAtCorrectType.GetAlgebraicType(registrar)
+ )
+ }
+ )
+ );
+
+ SpacetimeDB.BSATN.AlgebraicType SpacetimeDB.BSATN.IReadWrite.GetAlgebraicType(
+ SpacetimeDB.BSATN.ITypeRegistrar registrar
+ ) => GetAlgebraicType(registrar);
+ }
+} // TestScheduleIssues
diff --git a/crates/bindings-csharp/Codegen.Tests/fixtures/diag/snapshots/Module#TestTableTaggedEnum.verified.cs b/crates/bindings-csharp/Codegen.Tests/fixtures/diag/snapshots/Module#TestTableTaggedEnum.verified.cs
index 4155c7f93b8..468a7596ae2 100644
--- a/crates/bindings-csharp/Codegen.Tests/fixtures/diag/snapshots/Module#TestTableTaggedEnum.verified.cs
+++ b/crates/bindings-csharp/Codegen.Tests/fixtures/diag/snapshots/Module#TestTableTaggedEnum.verified.cs
@@ -48,7 +48,7 @@ public void Write(System.IO.BinaryWriter writer, TestTableTaggedEnum value)
}
}
- public SpacetimeDB.BSATN.AlgebraicType GetAlgebraicType(
+ public SpacetimeDB.BSATN.AlgebraicType.Ref GetAlgebraicType(
SpacetimeDB.BSATN.ITypeRegistrar registrar
) =>
registrar.RegisterType(
@@ -60,5 +60,9 @@ SpacetimeDB.BSATN.ITypeRegistrar registrar
}
)
);
+
+ SpacetimeDB.BSATN.AlgebraicType SpacetimeDB.BSATN.IReadWrite.GetAlgebraicType(
+ SpacetimeDB.BSATN.ITypeRegistrar registrar
+ ) => GetAlgebraicType(registrar);
}
} // TestTableTaggedEnum
diff --git a/crates/bindings-csharp/Codegen.Tests/fixtures/diag/snapshots/Module#TestUniqueNotEquatable.verified.cs b/crates/bindings-csharp/Codegen.Tests/fixtures/diag/snapshots/Module#TestUniqueNotEquatable.verified.cs
index 57201dbbffc..063e824eb1b 100644
--- a/crates/bindings-csharp/Codegen.Tests/fixtures/diag/snapshots/Module#TestUniqueNotEquatable.verified.cs
+++ b/crates/bindings-csharp/Codegen.Tests/fixtures/diag/snapshots/Module#TestUniqueNotEquatable.verified.cs
@@ -2,7 +2,7 @@
//
#nullable enable
-partial struct TestUniqueNotEquatable : SpacetimeDB.Internal.ITable
+partial struct TestUniqueNotEquatable : SpacetimeDB.BSATN.IStructuralReadWrite
{
public void ReadFields(System.IO.BinaryReader reader)
{
@@ -33,7 +33,7 @@ public void Write(System.IO.BinaryWriter writer, TestUniqueNotEquatable value)
value.WriteFields(writer);
}
- public SpacetimeDB.BSATN.AlgebraicType GetAlgebraicType(
+ public SpacetimeDB.BSATN.AlgebraicType.Ref GetAlgebraicType(
SpacetimeDB.BSATN.ITypeRegistrar registrar
) =>
registrar.RegisterType(
@@ -45,48 +45,9 @@ SpacetimeDB.BSATN.ITypeRegistrar registrar
}
)
);
- }
- static IEnumerable SpacetimeDB.Internal.ITable.MakeTableDesc(
- SpacetimeDB.BSATN.ITypeRegistrar registrar
- ) =>
- [
- new(
- new(
- TableName: nameof(SpacetimeDB.Local.TestUniqueNotEquatable),
- Columns:
- [
- new(nameof(UniqueField), BSATN.UniqueField.GetAlgebraicType(registrar)),
- new(
- nameof(PrimaryKeyField),
- BSATN.PrimaryKeyField.GetAlgebraicType(registrar)
- )
- ],
- Indexes: [],
- Constraints:
- [
- new(
- "TestUniqueNotEquatable_UniqueField",
- (byte)SpacetimeDB.Internal.ColumnAttrs.Unique,
- [0]
- ),
- new(
- "TestUniqueNotEquatable_PrimaryKeyField",
- (byte)SpacetimeDB.Internal.ColumnAttrs.PrimaryKey,
- [1]
- )
- ],
- Sequences: [],
- // "system" | "user"
- TableType: "user",
- // "public" | "private"
- TableAccess: "private",
- Scheduled: null
- ),
- (uint)
- (
- (SpacetimeDB.BSATN.AlgebraicType.Ref)new BSATN().GetAlgebraicType(registrar)
- ).Ref_
- ),
- ];
+ SpacetimeDB.BSATN.AlgebraicType SpacetimeDB.BSATN.IReadWrite.GetAlgebraicType(
+ SpacetimeDB.BSATN.ITypeRegistrar registrar
+ ) => GetAlgebraicType(registrar);
+ }
} // TestUniqueNotEquatable
diff --git a/crates/bindings-csharp/Codegen.Tests/fixtures/diag/snapshots/Module.verified.txt b/crates/bindings-csharp/Codegen.Tests/fixtures/diag/snapshots/Module.verified.txt
index d81c1380582..f68a8506792 100644
--- a/crates/bindings-csharp/Codegen.Tests/fixtures/diag/snapshots/Module.verified.txt
+++ b/crates/bindings-csharp/Codegen.Tests/fixtures/diag/snapshots/Module.verified.txt
@@ -87,31 +87,6 @@ public partial record TestTableTaggedEnum : SpacetimeDB.TaggedEnum<(int X, int Y
},
{/*
-[SpacetimeDB.Table(
-^^^^^^^^^^^^^^^^^^^
- Name = "TestIncompatibleSchedule1",
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- Scheduled = nameof(TestIncompatibleScheduleReducer)
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-)]
-^^
-[SpacetimeDB.Table(Name = "TestIncompatibleSchedule2")]
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-public partial struct TestIncompatibleSchedule
-*/
- Message: Schedule adds extra fields to the row type. Either all `[Table]` attributes should have a `Schedule`, or none of them.,
- Severity: Error,
- Descriptor: {
- Id: STDB0010,
- Title: Incompatible `[Table(Schedule)]` attributes,
- MessageFormat: Schedule adds extra fields to the row type. Either all `[Table]` attributes should have a `Schedule`, or none of them.,
- Category: SpacetimeDB,
- DefaultSeverity: Error,
- IsEnabledByDefault: true
- }
- },
- {/*
-
[SpacetimeDB.Table]
^^^^^^^^^^^^^^^^^^^
[SpacetimeDB.Index]
@@ -153,6 +128,98 @@ public partial struct TestIndexWithEmptyColumns { }
}
},
{/*
+
+[SpacetimeDB.Table(
+ ^^^^^^^^^^^^^^^^^^
+ Name = "TestScheduleWithoutPrimaryKey",
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ Scheduled = "DummyScheduledReducer",
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ ScheduledAt = nameof(ScheduleAtCorrectType)
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+)]
+^
+[SpacetimeDB.Table(
+*/
+ Message: TestScheduleWithoutPrimaryKey is a scheduled table but doesn't have a primary key of type `ulong`.,
+ Severity: Error,
+ Descriptor: {
+ Id: STDB0012,
+ Title: Invalid scheduled table declaration,
+ MessageFormat: {0},
+ Category: SpacetimeDB,
+ DefaultSeverity: Error,
+ IsEnabledByDefault: true
+ }
+ },
+ {/*
+)]
+[SpacetimeDB.Table(
+ ^^^^^^^^^^^^^^^^^^
+ Name = "TestScheduleWithWrongPrimaryKeyType",
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ Scheduled = "DummyScheduledReducer",
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ ScheduledAt = nameof(ScheduleAtCorrectType)
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+)]
+^
+[SpacetimeDB.Table(Name = "TestScheduleWithoutScheduleAt", Scheduled = "DummyScheduledReducer")]
+*/
+ Message: TestScheduleWithWrongPrimaryKeyType is a scheduled table but doesn't have a primary key of type `ulong`.,
+ Severity: Error,
+ Descriptor: {
+ Id: STDB0012,
+ Title: Invalid scheduled table declaration,
+ MessageFormat: {0},
+ Category: SpacetimeDB,
+ DefaultSeverity: Error,
+ IsEnabledByDefault: true
+ }
+ },
+ {/*
+)]
+[SpacetimeDB.Table(Name = "TestScheduleWithoutScheduleAt", Scheduled = "DummyScheduledReducer")]
+ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+[SpacetimeDB.Table(
+*/
+ Message: Item ScheduledAt not found.,
+ Severity: Error,
+ Descriptor: {
+ Id: STDB0012,
+ Title: Invalid scheduled table declaration,
+ MessageFormat: {0},
+ Category: SpacetimeDB,
+ DefaultSeverity: Error,
+ IsEnabledByDefault: true
+ }
+ },
+ {/*
+[SpacetimeDB.Table(Name = "TestScheduleWithoutScheduleAt", Scheduled = "DummyScheduledReducer")]
+[SpacetimeDB.Table(
+ ^^^^^^^^^^^^^^^^^^
+ Name = "TestScheduleWithWrongScheduleAtType",
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ Scheduled = "DummyScheduledReducer",
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ ScheduledAt = nameof(ScheduleAtWrongType)
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+)]
+^
+public partial struct TestScheduleIssues
+*/
+ Message: TestScheduleWithWrongScheduleAtType is a scheduled table but doesn't have a primary key of type `ulong`.,
+ Severity: Error,
+ Descriptor: {
+ Id: STDB0012,
+ Title: Invalid scheduled table declaration,
+ MessageFormat: {0},
+ Category: SpacetimeDB,
+ DefaultSeverity: Error,
+ IsEnabledByDefault: true
+ }
+ },
+ {/*
[SpacetimeDB.Reducer]
public static int TestReducerReturnType(ReducerContext ctx) => 0;
^^^
@@ -222,12 +289,12 @@ public partial struct TestIndexWithEmptyColumns { }
},
{
Location: ,
- Message: Reducer with the same export name __init__ is registered in multiple places: Reducers.TestDuplicateReducerKind1, Reducers.TestDuplicateReducerKind2,
+ Message: Several reducers are assigned to the same lifecycle kind Init: Reducers.TestDuplicateReducerKind1, Reducers.TestDuplicateReducerKind2,
Severity: Error,
Descriptor: {
- Id: STDB0007,
- Title: Duplicate exports,
- MessageFormat: {0} with the same export name {1} is registered in multiple places: {2},
+ Id: STDB0011,
+ Title: Multiple reducers of the same kind,
+ MessageFormat: Several reducers are assigned to the same lifecycle kind {0}: {1},
Category: SpacetimeDB,
DefaultSeverity: Error,
IsEnabledByDefault: true
diff --git a/crates/bindings-csharp/Codegen.Tests/fixtures/diag/snapshots/Type#TestTaggedEnumField.verified.cs b/crates/bindings-csharp/Codegen.Tests/fixtures/diag/snapshots/Type#TestTaggedEnumField.verified.cs
index 9ba09be963b..c41d3f73e36 100644
--- a/crates/bindings-csharp/Codegen.Tests/fixtures/diag/snapshots/Type#TestTaggedEnumField.verified.cs
+++ b/crates/bindings-csharp/Codegen.Tests/fixtures/diag/snapshots/Type#TestTaggedEnumField.verified.cs
@@ -48,7 +48,7 @@ public void Write(System.IO.BinaryWriter writer, TestTaggedEnumField value)
}
}
- public SpacetimeDB.BSATN.AlgebraicType GetAlgebraicType(
+ public SpacetimeDB.BSATN.AlgebraicType.Ref GetAlgebraicType(
SpacetimeDB.BSATN.ITypeRegistrar registrar
) =>
registrar.RegisterType(
@@ -60,5 +60,9 @@ SpacetimeDB.BSATN.ITypeRegistrar registrar
}
)
);
+
+ SpacetimeDB.BSATN.AlgebraicType SpacetimeDB.BSATN.IReadWrite.GetAlgebraicType(
+ SpacetimeDB.BSATN.ITypeRegistrar registrar
+ ) => GetAlgebraicType(registrar);
}
} // TestTaggedEnumField
diff --git a/crates/bindings-csharp/Codegen.Tests/fixtures/diag/snapshots/Type#TestTaggedEnumInlineTuple.verified.cs b/crates/bindings-csharp/Codegen.Tests/fixtures/diag/snapshots/Type#TestTaggedEnumInlineTuple.verified.cs
index 26a7b2bb2bf..f09264af234 100644
--- a/crates/bindings-csharp/Codegen.Tests/fixtures/diag/snapshots/Type#TestTaggedEnumInlineTuple.verified.cs
+++ b/crates/bindings-csharp/Codegen.Tests/fixtures/diag/snapshots/Type#TestTaggedEnumInlineTuple.verified.cs
@@ -39,7 +39,7 @@ public void Write(System.IO.BinaryWriter writer, TestTaggedEnumInlineTuple value
}
}
- public SpacetimeDB.BSATN.AlgebraicType GetAlgebraicType(
+ public SpacetimeDB.BSATN.AlgebraicType.Ref GetAlgebraicType(
SpacetimeDB.BSATN.ITypeRegistrar registrar
) =>
registrar.RegisterType(
@@ -50,5 +50,9 @@ SpacetimeDB.BSATN.ITypeRegistrar registrar
}
)
);
+
+ SpacetimeDB.BSATN.AlgebraicType SpacetimeDB.BSATN.IReadWrite.GetAlgebraicType(
+ SpacetimeDB.BSATN.ITypeRegistrar registrar
+ ) => GetAlgebraicType(registrar);
}
} // TestTaggedEnumInlineTuple
diff --git a/crates/bindings-csharp/Codegen.Tests/fixtures/diag/snapshots/Type#TestTypeParams_T_.verified.cs b/crates/bindings-csharp/Codegen.Tests/fixtures/diag/snapshots/Type#TestTypeParams_T_.verified.cs
index dcd36118901..ae8f0904f75 100644
--- a/crates/bindings-csharp/Codegen.Tests/fixtures/diag/snapshots/Type#TestTypeParams_T_.verified.cs
+++ b/crates/bindings-csharp/Codegen.Tests/fixtures/diag/snapshots/Type#TestTypeParams_T_.verified.cs
@@ -26,7 +26,7 @@ public void Write(System.IO.BinaryWriter writer, TestTypeParams value)
value.WriteFields(writer);
}
- public SpacetimeDB.BSATN.AlgebraicType GetAlgebraicType(
+ public SpacetimeDB.BSATN.AlgebraicType.Ref GetAlgebraicType(
SpacetimeDB.BSATN.ITypeRegistrar registrar
) =>
registrar.RegisterType>(
@@ -37,5 +37,10 @@ SpacetimeDB.BSATN.ITypeRegistrar registrar
}
)
);
+
+ SpacetimeDB.BSATN.AlgebraicType SpacetimeDB.BSATN.IReadWrite<
+ TestTypeParams
+ >.GetAlgebraicType(SpacetimeDB.BSATN.ITypeRegistrar registrar) =>
+ GetAlgebraicType(registrar);
}
} // TestTypeParams
diff --git a/crates/bindings-csharp/Codegen.Tests/fixtures/diag/snapshots/Type#TestUnsupportedType.verified.cs b/crates/bindings-csharp/Codegen.Tests/fixtures/diag/snapshots/Type#TestUnsupportedType.verified.cs
index 90568e958d8..8b8e392fe6c 100644
--- a/crates/bindings-csharp/Codegen.Tests/fixtures/diag/snapshots/Type#TestUnsupportedType.verified.cs
+++ b/crates/bindings-csharp/Codegen.Tests/fixtures/diag/snapshots/Type#TestUnsupportedType.verified.cs
@@ -38,7 +38,7 @@ public void Write(System.IO.BinaryWriter writer, TestUnsupportedType value)
value.WriteFields(writer);
}
- public SpacetimeDB.BSATN.AlgebraicType GetAlgebraicType(
+ public SpacetimeDB.BSATN.AlgebraicType.Ref GetAlgebraicType(
SpacetimeDB.BSATN.ITypeRegistrar registrar
) =>
registrar.RegisterType(
@@ -58,5 +58,9 @@ SpacetimeDB.BSATN.ITypeRegistrar registrar
}
)
);
+
+ SpacetimeDB.BSATN.AlgebraicType SpacetimeDB.BSATN.IReadWrite.GetAlgebraicType(
+ SpacetimeDB.BSATN.ITypeRegistrar registrar
+ ) => GetAlgebraicType(registrar);
}
} // TestUnsupportedType
diff --git a/crates/bindings-csharp/Codegen.Tests/fixtures/server/Lib.cs b/crates/bindings-csharp/Codegen.Tests/fixtures/server/Lib.cs
index 84b699424a5..5938e293834 100644
--- a/crates/bindings-csharp/Codegen.Tests/fixtures/server/Lib.cs
+++ b/crates/bindings-csharp/Codegen.Tests/fixtures/server/Lib.cs
@@ -118,6 +118,10 @@ public static partial class Timers
[SpacetimeDB.Table(Scheduled = nameof(SendScheduledMessage))]
public partial struct SendMessageTimer
{
+ [PrimaryKey]
+ [AutoInc]
+ public ulong ScheduledId;
+ public ScheduleAt ScheduledAt;
public string Text;
}
diff --git a/crates/bindings-csharp/Codegen.Tests/fixtures/server/snapshots/Module#BTreeMultiColumn.verified.cs b/crates/bindings-csharp/Codegen.Tests/fixtures/server/snapshots/Module#BTreeMultiColumn.verified.cs
index 2305175ef95..751475f930a 100644
--- a/crates/bindings-csharp/Codegen.Tests/fixtures/server/snapshots/Module#BTreeMultiColumn.verified.cs
+++ b/crates/bindings-csharp/Codegen.Tests/fixtures/server/snapshots/Module#BTreeMultiColumn.verified.cs
@@ -2,7 +2,7 @@
//
#nullable enable
-partial struct BTreeMultiColumn : SpacetimeDB.Internal.ITable
+partial struct BTreeMultiColumn : SpacetimeDB.BSATN.IStructuralReadWrite
{
public void ReadFields(System.IO.BinaryReader reader)
{
@@ -32,7 +32,7 @@ public void Write(System.IO.BinaryWriter writer, BTreeMultiColumn value)
value.WriteFields(writer);
}
- public SpacetimeDB.BSATN.AlgebraicType GetAlgebraicType(
+ public SpacetimeDB.BSATN.AlgebraicType.Ref GetAlgebraicType(
SpacetimeDB.BSATN.ITypeRegistrar registrar
) =>
registrar.RegisterType(
@@ -45,42 +45,9 @@ SpacetimeDB.BSATN.ITypeRegistrar registrar
}
)
);
- }
- static IEnumerable SpacetimeDB.Internal.ITable.MakeTableDesc(
- SpacetimeDB.BSATN.ITypeRegistrar registrar
- ) =>
- [
- new(
- new(
- TableName: nameof(SpacetimeDB.Local.BTreeMultiColumn),
- Columns:
- [
- new(nameof(X), BSATN.X.GetAlgebraicType(registrar)),
- new(nameof(Y), BSATN.Y.GetAlgebraicType(registrar)),
- new(nameof(Z), BSATN.Z.GetAlgebraicType(registrar))
- ],
- Indexes:
- [
- new(
- "BTreeMultiColumn_X_Y_Z_idx_btree",
- false,
- SpacetimeDB.Internal.IndexType.BTree,
- [0, 1, 2]
- )
- ],
- Constraints: [],
- Sequences: [],
- // "system" | "user"
- TableType: "user",
- // "public" | "private"
- TableAccess: "private",
- Scheduled: null
- ),
- (uint)
- (
- (SpacetimeDB.BSATN.AlgebraicType.Ref)new BSATN().GetAlgebraicType(registrar)
- ).Ref_
- ),
- ];
+ SpacetimeDB.BSATN.AlgebraicType SpacetimeDB.BSATN.IReadWrite.GetAlgebraicType(
+ SpacetimeDB.BSATN.ITypeRegistrar registrar
+ ) => GetAlgebraicType(registrar);
+ }
} // BTreeMultiColumn
diff --git a/crates/bindings-csharp/Codegen.Tests/fixtures/server/snapshots/Module#BTreeViews.verified.cs b/crates/bindings-csharp/Codegen.Tests/fixtures/server/snapshots/Module#BTreeViews.verified.cs
index 2dfdbaa2f4d..1542246942c 100644
--- a/crates/bindings-csharp/Codegen.Tests/fixtures/server/snapshots/Module#BTreeViews.verified.cs
+++ b/crates/bindings-csharp/Codegen.Tests/fixtures/server/snapshots/Module#BTreeViews.verified.cs
@@ -2,7 +2,7 @@
//
#nullable enable
-partial struct BTreeViews : SpacetimeDB.Internal.ITable
+partial struct BTreeViews : SpacetimeDB.BSATN.IStructuralReadWrite
{
public void ReadFields(System.IO.BinaryReader reader)
{
@@ -35,7 +35,7 @@ public void Write(System.IO.BinaryWriter writer, BTreeViews value)
value.WriteFields(writer);
}
- public SpacetimeDB.BSATN.AlgebraicType GetAlgebraicType(
+ public SpacetimeDB.BSATN.AlgebraicType.Ref GetAlgebraicType(
SpacetimeDB.BSATN.ITypeRegistrar registrar
) =>
registrar.RegisterType(_ => new SpacetimeDB.BSATN.AlgebraicType.Product(
@@ -47,52 +47,9 @@ SpacetimeDB.BSATN.ITypeRegistrar registrar
new(nameof(Faction), Faction.GetAlgebraicType(registrar))
}
));
- }
- static IEnumerable SpacetimeDB.Internal.ITable.MakeTableDesc(
- SpacetimeDB.BSATN.ITypeRegistrar registrar
- ) =>
- [
- new(
- new(
- TableName: nameof(SpacetimeDB.Local.BTreeViews),
- Columns:
- [
- new(nameof(Id), BSATN.Id.GetAlgebraicType(registrar)),
- new(nameof(X), BSATN.X.GetAlgebraicType(registrar)),
- new(nameof(Y), BSATN.Y.GetAlgebraicType(registrar)),
- new(nameof(Faction), BSATN.Faction.GetAlgebraicType(registrar))
- ],
- Indexes:
- [
- new(
- "BTreeViews_X_Y_idx_btree",
- false,
- SpacetimeDB.Internal.IndexType.BTree,
- [1, 2]
- ),
- new(
- "BTreeViews_Faction_idx_btree",
- false,
- SpacetimeDB.Internal.IndexType.BTree,
- [3]
- )
- ],
- Constraints:
- [
- new("BTreeViews_Id", (byte)SpacetimeDB.Internal.ColumnAttrs.PrimaryKey, [0])
- ],
- Sequences: [],
- // "system" | "user"
- TableType: "user",
- // "public" | "private"
- TableAccess: "private",
- Scheduled: null
- ),
- (uint)
- (
- (SpacetimeDB.BSATN.AlgebraicType.Ref)new BSATN().GetAlgebraicType(registrar)
- ).Ref_
- ),
- ];
+ SpacetimeDB.BSATN.AlgebraicType SpacetimeDB.BSATN.IReadWrite.GetAlgebraicType(
+ SpacetimeDB.BSATN.ITypeRegistrar registrar
+ ) => GetAlgebraicType(registrar);
+ }
} // BTreeViews
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 24248c8e66e..97b9b5cfd12 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
@@ -42,6 +42,30 @@ internal readonly struct BTreeMultiColumn
return row;
}
+ static SpacetimeDB.Internal.RawTableDefV9 SpacetimeDB.Internal.ITableView<
+ BTreeMultiColumn,
+ global::BTreeMultiColumn
+ >.MakeTableDesc(SpacetimeDB.BSATN.ITypeRegistrar registrar) =>
+ new(
+ Name: nameof(BTreeMultiColumn),
+ ProductTypeRef: (uint)
+ new global::BTreeMultiColumn.BSATN().GetAlgebraicType(registrar).Ref_,
+ PrimaryKey: [],
+ Indexes:
+ [
+ new(
+ Name: null,
+ AccessorName: "Location",
+ Algorithm: new SpacetimeDB.Internal.RawIndexAlgorithm.BTree([0, 1, 2])
+ )
+ ],
+ Constraints: [],
+ Sequences: [],
+ Schedule: null,
+ TableType: SpacetimeDB.Internal.TableType.User,
+ TableAccess: SpacetimeDB.Internal.TableAccess.Private
+ );
+
public ulong Count =>
SpacetimeDB.Internal.ITableView<
BTreeMultiColumn,
@@ -196,6 +220,46 @@ internal readonly struct BTreeViews
return row;
}
+ static SpacetimeDB.Internal.RawTableDefV9 SpacetimeDB.Internal.ITableView<
+ BTreeViews,
+ global::BTreeViews
+ >.MakeTableDesc(SpacetimeDB.BSATN.ITypeRegistrar registrar) =>
+ new(
+ Name: nameof(BTreeViews),
+ ProductTypeRef: (uint)
+ new global::BTreeViews.BSATN().GetAlgebraicType(registrar).Ref_,
+ PrimaryKey: [0],
+ Indexes:
+ [
+ new(
+ Name: null,
+ AccessorName: "Id",
+ Algorithm: new SpacetimeDB.Internal.RawIndexAlgorithm.BTree([0])
+ ),
+ new(
+ Name: null,
+ AccessorName: "Location",
+ Algorithm: new SpacetimeDB.Internal.RawIndexAlgorithm.BTree([1, 2])
+ ),
+ new(
+ Name: null,
+ AccessorName: "Faction",
+ Algorithm: new SpacetimeDB.Internal.RawIndexAlgorithm.BTree([3])
+ )
+ ],
+ Constraints:
+ [
+ SpacetimeDB.Internal.ITableView<
+ BTreeViews,
+ global::BTreeViews
+ >.MakeUniqueConstraint(0)
+ ],
+ Sequences: [],
+ Schedule: null,
+ TableType: SpacetimeDB.Internal.TableType.User,
+ TableAccess: SpacetimeDB.Internal.TableAccess.Private
+ );
+
public ulong Count =>
SpacetimeDB.Internal.ITableView.DoCount();
@@ -346,6 +410,47 @@ public readonly struct MultiTable1
return row;
}
+ static SpacetimeDB.Internal.RawTableDefV9 SpacetimeDB.Internal.ITableView<
+ MultiTable1,
+ global::MultiTableRow
+ >.MakeTableDesc(SpacetimeDB.BSATN.ITypeRegistrar registrar) =>
+ new(
+ Name: nameof(MultiTable1),
+ ProductTypeRef: (uint)
+ new global::MultiTableRow.BSATN().GetAlgebraicType(registrar).Ref_,
+ PrimaryKey: [1],
+ Indexes:
+ [
+ new(
+ Name: null,
+ AccessorName: "Foo",
+ Algorithm: new SpacetimeDB.Internal.RawIndexAlgorithm.BTree([1])
+ ),
+ new(
+ Name: null,
+ AccessorName: "Name",
+ Algorithm: new SpacetimeDB.Internal.RawIndexAlgorithm.BTree([0])
+ )
+ ],
+ Constraints:
+ [
+ SpacetimeDB.Internal.ITableView<
+ MultiTable1,
+ global::MultiTableRow
+ >.MakeUniqueConstraint(1)
+ ],
+ Sequences:
+ [
+ SpacetimeDB.Internal.ITableView<
+ MultiTable1,
+ global::MultiTableRow
+ >.MakeSequence(1)
+ ],
+ Schedule: null,
+ TableType: SpacetimeDB.Internal.TableType.User,
+ TableAccess: SpacetimeDB.Internal.TableAccess.Public
+ );
+
public ulong Count =>
SpacetimeDB.Internal.ITableView.DoCount();
@@ -427,6 +532,42 @@ public readonly struct MultiTable2
return row;
}
+ static SpacetimeDB.Internal.RawTableDefV9 SpacetimeDB.Internal.ITableView<
+ MultiTable2,
+ global::MultiTableRow
+ >.MakeTableDesc(SpacetimeDB.BSATN.ITypeRegistrar registrar) =>
+ new(
+ Name: nameof(MultiTable2),
+ ProductTypeRef: (uint)
+ new global::MultiTableRow.BSATN().GetAlgebraicType(registrar).Ref_,
+ PrimaryKey: [],
+ Indexes:
+ [
+ new(
+ Name: null,
+ AccessorName: "Bar",
+ Algorithm: new SpacetimeDB.Internal.RawIndexAlgorithm.BTree([2])
+ )
+ ],
+ Constraints:
+ [
+ SpacetimeDB.Internal.ITableView<
+ MultiTable2,
+ global::MultiTableRow
+ >.MakeUniqueConstraint(2)
+ ],
+ Sequences:
+ [
+ SpacetimeDB.Internal.ITableView<
+ MultiTable2,
+ global::MultiTableRow
+ >.MakeSequence(1)
+ ],
+ Schedule: null,
+ TableType: SpacetimeDB.Internal.TableType.User,
+ TableAccess: SpacetimeDB.Internal.TableAccess.Private
+ );
+
public ulong Count =>
SpacetimeDB.Internal.ITableView.DoCount();
@@ -468,6 +609,23 @@ public readonly struct PrivateTable
return row;
}
+ static SpacetimeDB.Internal.RawTableDefV9 SpacetimeDB.Internal.ITableView<
+ PrivateTable,
+ global::PrivateTable
+ >.MakeTableDesc(SpacetimeDB.BSATN.ITypeRegistrar registrar) =>
+ new(
+ Name: nameof(PrivateTable),
+ ProductTypeRef: (uint)
+ new global::PrivateTable.BSATN().GetAlgebraicType(registrar).Ref_,
+ PrimaryKey: [],
+ Indexes: [],
+ Constraints: [],
+ Sequences: [],
+ Schedule: null,
+ TableType: SpacetimeDB.Internal.TableType.User,
+ TableAccess: SpacetimeDB.Internal.TableAccess.Private
+ );
+
public ulong Count =>
SpacetimeDB.Internal.ITableView