Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions crates/bindings-csharp/Codegen.Tests/fixtures/diag/Lib.cs
Original file line number Diff line number Diff line change
Expand Up @@ -491,6 +491,13 @@ public partial struct Player
public Identity Identity;
}

[SpacetimeDB.Table(Event = true)]
public partial struct ViewAuditEvent
{
[PrimaryKey]
public ulong Id;
}

public struct NotSpacetimeType { }

public partial class Module
Expand Down Expand Up @@ -612,4 +619,30 @@ ViewContext ctx
ctx.Db.Player.Identity.Delete(0);
return null;
}

[SpacetimeDB.View(Accessor = "event_table_view", Public = true)]
public static Player? EventTableView(ViewContext ctx)
{
var _ = ctx.Db.ViewAuditEvent;
return null;
}

[SpacetimeDB.View(Accessor = "event_table_view_anon", Public = true)]
public static Player? EventTableViewAnon(AnonymousViewContext ctx)
{
var _ = ctx.Db.ViewAuditEvent;
return null;
}

[SpacetimeDB.View(Accessor = "event_table_view_query_builder", Public = true)]
public static IQuery<ViewAuditEvent> EventTableViewQueryBuilder(ViewContext ctx)
{
return ctx.From.ViewAuditEvent();
}

[SpacetimeDB.View(Accessor = "event_table_view_anon_query_builder", Public = true)]
public static IQuery<ViewAuditEvent> EventTableViewAnonQueryBuilder(AnonymousViewContext ctx)
{
return ctx.From.ViewAuditEvent();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,53 @@
}
},
{/*
SpacetimeDB.Internal.Module.RegisterTable<global::TestUniqueNotEquatable, SpacetimeDB.Internal.TableHandles.TestUniqueNotEquatable>();
{
var _ = ctx.Db.ViewAuditEvent;
^^^^^^^^^^^^^^
return null;
*/
Message: 'LocalReadOnly' does not contain a definition for 'ViewAuditEvent' and no accessible extension method 'ViewAuditEvent' accepting a first argument of type 'LocalReadOnly' could be found (are you missing a using directive or an assembly reference?),
Comment on lines +27 to +31
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No longer generating bindings for event tables.

Severity: Error,
Descriptor: {
Id: CS1061,
Title: ,
HelpLink: https://msdn.microsoft.com/query/roslyn.query?appId=roslyn&k=k(CS1061),
MessageFormat: '{0}' does not contain a definition for '{1}' and no accessible extension method '{1}' accepting a first argument of type '{0}' could be found (are you missing a using directive or an assembly reference?),
Category: Compiler,
DefaultSeverity: Error,
IsEnabledByDefault: true,
CustomTags: [
Compiler,
Telemetry,
NotConfigurable
]
}
},
{/*
{
var _ = ctx.Db.ViewAuditEvent;
^^^^^^^^^^^^^^
return null;
*/
Message: 'LocalReadOnly' does not contain a definition for 'ViewAuditEvent' and no accessible extension method 'ViewAuditEvent' accepting a first argument of type 'LocalReadOnly' could be found (are you missing a using directive or an assembly reference?),
Severity: Error,
Descriptor: {
Id: CS1061,
Title: ,
HelpLink: https://msdn.microsoft.com/query/roslyn.query?appId=roslyn&k=k(CS1061),
MessageFormat: '{0}' does not contain a definition for '{1}' and no accessible extension method '{1}' accepting a first argument of type '{0}' could be found (are you missing a using directive or an assembly reference?),
Category: Compiler,
DefaultSeverity: Error,
IsEnabledByDefault: true,
CustomTags: [
Compiler,
Telemetry,
NotConfigurable
]
}
},
{/*
SpacetimeDB.Internal.Module.RegisterTable<global::ViewAuditEvent, SpacetimeDB.Internal.TableHandles.ViewAuditEvent>();
SpacetimeDB.Internal.Module.RegisterClientVisibilityFilter(global::Module.MY_FILTER);
^^^^^^^^^
SpacetimeDB.Internal.Module.RegisterClientVisibilityFilter(global::Module.MY_FOURTH_FILTER);
Expand Down Expand Up @@ -160,6 +206,52 @@ SpacetimeDB.Internal.Module.RegisterClientVisibilityFilter(global::Module.MY_FOU
]
}
},
{/*
{
return ctx.From.ViewAuditEvent();
^^^^^^^^^^^^^^
}
*/
Message: 'QueryBuilder' does not contain a definition for 'ViewAuditEvent' and no accessible extension method 'ViewAuditEvent' accepting a first argument of type 'QueryBuilder' could be found (are you missing a using directive or an assembly reference?),
Comment on lines +211 to +215
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The same is true for the query builder

Severity: Error,
Descriptor: {
Id: CS1061,
Title: ,
HelpLink: https://msdn.microsoft.com/query/roslyn.query?appId=roslyn&k=k(CS1061),
MessageFormat: '{0}' does not contain a definition for '{1}' and no accessible extension method '{1}' accepting a first argument of type '{0}' could be found (are you missing a using directive or an assembly reference?),
Category: Compiler,
DefaultSeverity: Error,
IsEnabledByDefault: true,
CustomTags: [
Compiler,
Telemetry,
NotConfigurable
]
}
},
{/*
{
return ctx.From.ViewAuditEvent();
^^^^^^^^^^^^^^
}
*/
Message: 'QueryBuilder' does not contain a definition for 'ViewAuditEvent' and no accessible extension method 'ViewAuditEvent' accepting a first argument of type 'QueryBuilder' could be found (are you missing a using directive or an assembly reference?),
Severity: Error,
Descriptor: {
Id: CS1061,
Title: ,
HelpLink: https://msdn.microsoft.com/query/roslyn.query?appId=roslyn&k=k(CS1061),
MessageFormat: '{0}' does not contain a definition for '{1}' and no accessible extension method '{1}' accepting a first argument of type '{0}' could be found (are you missing a using directive or an assembly reference?),
Category: Compiler,
DefaultSeverity: Error,
IsEnabledByDefault: true,
CustomTags: [
Compiler,
Telemetry,
NotConfigurable
]
}
},
{/*
// Valid Filter, but [ClientVisibilityFilter] is disabled
[SpacetimeDB.ClientVisibilityFilter]
Expand Down
Loading
Loading