// return value for system tables public RelationValue GetCatalogTableValue(CatalogTables table) { var tablemaker = CatalogTableMaker.Create(_catalogtableheadings[table]); _catalogtablemaker[table](tablemaker, PersistentVars.GetEntries()); return(RelationValue.Create(tablemaker.Table)); }
//--- persistence Mk II // Store the persistent catalog and modified tables, local only // note: for Sql, only used to create new empty catalog public void StoreToTable() { Logger.WriteLine(2, "Save catalog for '{0}'", DatabaseName); var ctm = CatalogTableMaker.Create(_catalogtableheading); var table = ctm.AddEntries(PersistentVars.GetEntries()).Table; if (SqlFlag) { DataTableSql.Create(CatalogTableName, table); } else { Persist.Create(DatabasePath, true).Store(CatalogTableName, RelationValue.Create(table)); var savers = PersistentVars.GetEntries().Where(e => e.IsUnsaved); Logger.WriteLine(2, $"Persist {savers.Count()} entries"); foreach (var entry in savers) { Persist.Create(DatabasePath, true).Store(entry.Name, entry.Value); } } }