chore: Add 'Empty' fn for BlueTable/Schema (for convenience)

This commit is contained in:
John Colvin committed 2025-11-19 13:57:47 -05:00
1 parent c2db246ce5
commit a2f9359077
2 files changed
+7

No files matched your search

@@ -80,6 +80,10 @@ namespace BCG {
/// </summary>
/// <param name="schema"></param>
public BlueTable(IBlueTableSchema schema) { mySchema = schema; }
public static BlueTable Empty(string name, bool includeIdColumn = true) =>
new(BlueTableSchema.Empty(name, includeIdColumn));
#endregion
#region IBlueRowCollection members
@@ -138,6 +138,9 @@ namespace BCG {
myConstruct(cis, tableName);
}
public static BlueTableSchema Empty(string name, bool includeIdColumn = true) =>
new(includeIdColumn ? new ColumnInfo[] { new("id", 0, typeof(int)) } : Array.Empty<ColumnInfo>(), name);
private void myConstruct(ColumnInfo[] cis, string tableName) {
myIndexByColOrder = new ColumnInfo[cis.Length];
myTableName = tableName;