public void SaveToDisk(PartialDatabase database) { var fileName = Path.Combine(_databaseFolder, database.Name + _databaseExtension); var file = _databaseFileMapper.Map(database); _dataFileManager.SaveDataFile(fileName, file); }
private void Map(PartialDatabase database) { DatabaseName = database.Name; DatabaseId = database.Id; database.Tables.ForEach(table => Tables.Add(table.GetSchema())); Location = (Location)_process.GetLocation(); }
public void AddDatabase(PartialDatabase database) { if (!HasDatabase(database.Name)) { _databases.Add(database); SaveToDisk(database); } }
public PartialDatabase GetFullDatabase(string databaseName) { PartialDatabase db = null; Databases.ForEach(database => { if ((database is PartialDatabase) && (database.Name == databaseName)) { db = database as PartialDatabase; } }); return(db); }
public void CreateDatabaseFromContractInfo(ContractInfo info, Process process) { var dbName = info.DatabaseName; if (!HasDatabase(dbName)) { var reference = new DatabaseReference(); reference.DatabaseName = dbName; var location = new Location(null, info.Location.IpAddress, info.Location.PortNumber, string.Empty); reference.Location = location; reference.DatabaseId = info.DatabaseId; var db = new PartialDatabase(dbName, process, reference); foreach (var table in info.Schema.Tables) { db.AddTable(table); } _databases.Add(db); SaveToDisk(db); } }
public void SaveToDisk(PartialDatabase database) { throw new NotImplementedException(); }
public DbSchema(PartialDatabase database, Process process) : this() { _process = process; Map(database); }