Skip to content

Commit 3891dcd

Browse files
committed
Re-added Internal Module changes
1 parent 44fda8d commit 3891dcd

2 files changed

Lines changed: 18 additions & 5 deletions

File tree

crates/bindings-csharp/Runtime/Internal/Module.cs

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ namespace SpacetimeDB.Internal;
44
using System.Runtime.InteropServices;
55
using SpacetimeDB;
66
using SpacetimeDB.BSATN;
7+
using System.Collections.Generic;
8+
using System.Text;
79

810
partial class RawModuleDefV9
911
{
@@ -38,7 +40,15 @@ internal AlgebraicType.Ref RegisterType<T>(Func<AlgebraicType.Ref, AlgebraicType
3840

3941
internal void RegisterRowLevelSecurity(RawRowLevelSecurityDefV9 rls) =>
4042
RowLevelSecurity.Add(rls);
41-
43+
44+
internal void RegisterTableDefaultValue(string table, ushort colId, string value) {
45+
var byteArray = Encoding.UTF8.GetBytes(value);
46+
var byteList = new List<byte>(byteArray);
47+
MiscExports.Add(new RawMiscModuleExportV9.ColumnDefaultValue(
48+
new RawColumnDefaultValueV9(table, colId, byteList)
49+
));
50+
}
51+
4252
}
4353

4454
public static class Module
@@ -94,10 +104,7 @@ public static void RegisterReducer<R>()
94104

95105
public static void RegisterTable<T, View>()
96106
where T : IStructuralReadWrite, new()
97-
where View : ITableView<View, T>, new()
98-
{
99-
moduleDef.RegisterTable(View.MakeTableDesc(typeRegistrar));
100-
}
107+
where View : ITableView<View, T>, new() => moduleDef.RegisterTable(View.MakeTableDesc(typeRegistrar));
101108

102109
public static void RegisterClientVisibilityFilter(Filter rlsFilter)
103110
{
@@ -111,6 +118,8 @@ public static void RegisterClientVisibilityFilter(Filter rlsFilter)
111118
}
112119
}
113120

121+
public static void RegisterTableDefaultValue(string table, ushort colId, string value) => moduleDef.RegisterTableDefaultValue(table, colId, value);
122+
114123
private static byte[] Consume(this BytesSource source)
115124
{
116125
if (source == BytesSource.INVALID)
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
2+
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AList_002Ecs_002Fl_003AC_0021_003FUsers_003FRyan_003FAppData_003FRoaming_003FJetBrains_003FRider2025_002E1_003Fresharper_002Dhost_003FSourcesCache_003Fb7208b3f72528d22781d25fde9a55271bdf2b5aade4f03b1324579a25493cd8_003FList_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
3+
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/SourceGeneratedFilesToSkip/=Runtime_005CSpacetimeDB_002EBSATN_002ECodegen_005CSpacetimeDB_002ECodegen_002EType_005CSpacetimeDB_002EInternal_002ERawMiscModuleExportV9_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
4+
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/SourceGeneratedFilesToSkip/=Runtime_005CSpacetimeDB_002EBSATN_002ECodegen_005CSpacetimeDB_002ECodegen_002EType_005CSpacetimeDB_002EInternal_002ERawColumnDefaultValueV9_002Ecs/@EntryIndexedValue">ForceIncluded</s:String></wpf:ResourceDictionary>

0 commit comments

Comments
 (0)