@@ -159,49 +159,6 @@ public ColumnAttrs GetAttrs(TableView view) =>
159159 // For the `TableDesc` constructor.
160160 public string GenerateColumnDef ( ) =>
161161 $ "new (nameof({ Name } ), BSATN.{ Name } { TypeUse . BsatnFieldSuffix } .GetAlgebraicType(registrar))";
162-
163- // Converts value to a string that can be used as a default value in generated code.
164- internal static string GetDefaultValueCode ( object ? value )
165- {
166- if ( value == null )
167- return "null" ;
168-
169- // Handle string escaping
170- if ( value is string str )
171- {
172- return $ "\" { str . Replace ( "\" " , "\\ \" " ) } \" ";
173- }
174-
175- // Handle boolean values
176- if ( value is bool b )
177- {
178- return b ? "true" : "false" ;
179- }
180-
181- // Handle numeric types
182- if ( value is int || value is long || value is short || value is byte ||
183- value is uint || value is ulong || value is ushort || value is sbyte ||
184- value is float || value is double || value is decimal )
185- {
186- return value . ToString ( ) ?? "0" ;
187- }
188-
189- // Handle enums
190- if ( value is Enum enumValue )
191- {
192- return $ "{ enumValue . GetType ( ) . FullName } .{ enumValue } ";
193- }
194-
195- // For any other type, use its string representation
196- var strValue = value . ToString ( ) ;
197- if ( string . IsNullOrEmpty ( strValue ) )
198- {
199- return "null" ;
200- }
201-
202- // Escape any quotes in the string representation
203- return $ "\" { strValue . Replace ( "\" " , "\\ \" " ) } \" ";
204- }
205162}
206163
207164record Scheduled ( string ReducerName , int ScheduledAtColumn ) ;
@@ -289,8 +246,7 @@ public ViewIndex(ColumnRef col)
289246 ImmutableArray . Create ( col ) ,
290247 null ,
291248 ViewIndexType . BTree // this might become hash in the future
292- )
293- { }
249+ ) { }
294250
295251 private ViewIndex ( Index . BTreeAttribute attr , ImmutableArray < ColumnRef > columns )
296252 : this ( attr . Name , columns , attr . Table , ViewIndexType . BTree ) { }
@@ -642,7 +598,7 @@ public IEnumerable<FieldDefaultValue> GenerateDefaultValues()
642598 }
643599 }
644600
645- public record struct Constraint ( ColumnDeclaration Col , int Pos , ColumnAttrs Attr )
601+ public record Constraint ( ColumnDeclaration Col , int Pos , ColumnAttrs Attr )
646602 {
647603 public ViewIndex ToIndex ( ) => new ( new ColumnRef ( Pos , Col . Name ) ) ;
648604 }
0 commit comments