private bool ExecuteUpdateScript(Guid dbSectionId, DbScript updateScript)
 {
     var commands = GetCommands(updateScript.Sql);
     var updateVersionCommand = GetUpdateVersionCommand(dbSectionId, updateScript.Version);
     commands.Add(updateVersionCommand);
     return ExecuteScriptInTransaction(_connectionString, commands);
 }
 public bool TryCreateSection(Guid dbSectionId, DbScript createScript)
 {
     var commands = GetCommands(createScript.Sql);
     var setVersionCommand = GetSetVersionCommand(dbSectionId, createScript.Version);
     commands.Add(setVersionCommand);
     return ExecuteScriptInTransaction(_connectionString, commands);
 }
 public bool TryUpdateSection(Guid dbSectionId, DbScript[] updateScripts)
 {
     bool? successUpdate = null;
     foreach (var updateScript in updateScripts)
     {
         successUpdate = ExecuteUpdateScript(dbSectionId, updateScript);
         if (!successUpdate.Value) break;
     }
     return (successUpdate ?? true);
 }
 public bool TryCreateDbSchema(DbScript createScript)
 {
     var commands = GetCommands(createScript.Sql);
     var insertVersionCommand = string.Format(InsertDbVersionCommandFormat, _dbName, createScript.Version);
     commands.Add(insertVersionCommand);
     return ExecuteScriptInTransaction(_connectionString, commands);
 }
 public bool TryCreateDatabase(DbScript createScript)
 {
     var dbCreated = CreateEmptyDataBase();
     if (dbCreated)
     {
         if (WaitForDatabaseOpen(WaitForDatabaseOpenTimeOut))
         {
             return TryCreateDbSchema(createScript);
         }
         return false;
     }
     return false;
 }
 private bool ExecuteUpdateScript(DbScript updateScript, string dbName, string connectionString)
 {
     var commands = GetCommands(updateScript.Sql);
     var updateVersionCommand = GetUpdateVersionCommand(updateScript.Version, dbName);
     commands.Add(updateVersionCommand);
     return ExecuteScriptInTransaction(connectionString, commands);
 }
 public bool TryUpdate(DbScript[] updateScripts)
 {
     bool? successUpdate = null;
     foreach (var updateScript in updateScripts)
     {
         successUpdate = ExecuteUpdateScript(updateScript, _dbName, _connectionString);
         if (!successUpdate.Value) break;
     }
     return (successUpdate ?? true);
 }