public bool CreateDestination() { WriteLog(Status.Running, "Creating CDM database...", 0); var dbDestination = new DbDestination(_settings.DestinationConnectionString, _settings.ConversionSettings.DestinationSchema); try { dbDestination.CreateDatabase(_settings.CreateCdmDatabaseScript); WriteLog(Status.Running, "CDM database created", 0); } catch (Exception e) { WriteLog(Status.Running, "Warning: CDM database exists", 0); } try { dbDestination.CreateSchema(); WriteLog(Status.Running, "Schema created", 0); } catch (Exception e) { WriteLog(Status.Running, "Warning: CDM schema exists", 0); } bool successful; try { dbDestination.ExecuteQuery(_settings.CreateCdmTablesScript); WriteLog(Status.Running, "CDM tables created", 0); successful = true; } catch (Exception e) { WriteLog(Status.Running, "Warning: CDM tables exists", 0); try { dbDestination.ExecuteQuery(_settings.TruncateTablesScript); WriteLog(Status.Running, "CDM tables truncated", 0); successful = true; } catch (Exception e2) { WriteLog(Status.Failed, e2.Message, 0); throw e2; } } return(successful); }
public void FillPostBuildTables() { var dbDestination = new DbDestination(Settings.Settings.Current.Building.DestinationConnectionString, Settings.Settings.Current.Building.DestinationSchemaName); if (!string.IsNullOrEmpty(Settings.Settings.Current.Building.CdmSourceScript)) { dbDestination.ExecuteQuery(Settings.Settings.Current.Building.CdmSourceScript); } if (!string.IsNullOrEmpty(Settings.Settings.Current.Building.CohortDefinitionScript)) { dbDestination.ExecuteQuery(Settings.Settings.Current.Building.CohortDefinitionScript); } }
public void TruncateLookup() { var dbDestination = new DbDestination(Settings.Current.Building.DestinationConnectionString, Settings.Current.Building.CdmSchema); dbDestination.ExecuteQuery(Settings.Current.TruncateLookupScript); }
public void DropDestination() { var dbDestination = new DbDestination(Settings.Current.Building.DestinationConnectionString, Settings.Current.Building.CdmSchema); dbDestination.ExecuteQuery(Settings.Current.DropTablesScript); }
public void CreateTablesStep() { var dbDestination = new DbDestination(Settings.Current.Building.DestinationConnectionString, Settings.Current.Building.CdmSchema); dbDestination.ExecuteQuery(Settings.Current.CreateCdmTablesScript); }
public void ResetVocabularyStep() { var dbDestination = new DbDestination(Settings.Current.Building.DestinationConnectionString, Settings.Current.Building.CdmSchema); dbDestination.ExecuteQuery(Settings.Current.DropVocabularyTablesScript); }
public void TruncateWithoutLookupTables() { var dbDestination = new DbDestination(Settings.Settings.Current.Building.DestinationConnectionString, Settings.Settings.Current.Building.DestinationSchemaName); dbDestination.ExecuteQuery(Settings.Settings.Current.TruncateWithoutLookupTablesScript); }
public void DropDestination() { var dbDestination = new DbDestination(Settings.Settings.Current.Building.DestinationConnectionString, Settings.Settings.Current.Building.DestinationSchemaName); dbDestination.ExecuteQuery(Settings.Settings.Current.DropTablesScript); //dbDestination.DropDatabase(); }
public bool CreateDestination() { _logHub.Clients.All.SendAsync("Log", "Creating CDM database...").Wait(); var dbDestination = new DbDestination(_settings.DestinationConnectionString, _settings.ConversionSettings.DestinationSchema); try { dbDestination.CreateDatabase(_settings.CreateCdmDatabaseScript); _logHub.Clients.All.SendAsync("Log", "CDM database created").Wait(); } catch (Exception e) { _logHub.Clients.All.SendAsync("Log", "Warning: " + e.Message).Wait(); } bool successful; try { dbDestination.ExecuteQuery(_settings.CreateCdmTablesScript); _logHub.Clients.All.SendAsync("Log", "CDM tables created").Wait(); successful = true; } catch (Exception e) { _logHub.Clients.All.SendAsync("Log", "Warning: CDM tables " + e.Message).Wait(); try { dbDestination.ExecuteQuery(_settings.TruncateTablesScript); _logHub.Clients.All.SendAsync("Log", "CDM tables truncated").Wait(); successful = true; } catch (Exception e2) { throw e2; } } return(successful); }
public void CreateDestination() { PerformAction(() => { var dbDestination = new DbDestination(Settings.Current.Building.DestinationConnectionString, Settings.Current.Building.CdmSchema); dbDestination.CreateDatabase(Settings.Current.CreateCdmDatabaseScript); dbDestination.ExecuteQuery(Settings.Current.CreateCdmTablesScript); }); }
public void CreateDestination() { PerformAction(() => { var dbDestination = new DbDestination(Settings.Settings.Current.Building.DestinationConnectionString, Settings.Settings.Current.Building.DestinationSchemaName); if (Settings.Settings.Current.Building.DestinationEngine.Database != Database.Redshift) { dbDestination.CreateDatabase(Settings.Settings.Current.CreateCdmDatabaseScript); } dbDestination.ExecuteQuery(Settings.Settings.Current.CreateCdmTablesScript); }); }