public static DatabaseModel.Columns CreateTestTable(string createTableStatement, ConnectionType connectionType) { try { RemoveTestTable(connectionType); } catch { } try { DatabaseHelpers.ExecuteSqlStatement(createTableStatement, connectionType); DatabaseAssistant databaseAssistant = DatabaseAssistant.GetDatabaseAssistant(connectionType); using (var connection = databaseAssistant.CreateConnection(DatabaseHelpers.GetDefaultConnectionString(connectionType))) { connection.Open(); return(new DatabaseModel.Columns(databaseAssistant.GetTableColumns(connection, "TESTTABLE"))); } } catch { try { RemoveTestTable(connectionType); } catch { } throw; } }
public static DatabaseModel.ProcedureParameters CreateTestProc(string createProcedureStatement, ConnectionType connectionType) { try { RemoveTestProc(connectionType); } catch { } try { DatabaseHelpers.ExecuteSqlStatement(createProcedureStatement, connectionType); DatabaseAssistant databaseAssistant = DatabaseAssistant.GetDatabaseAssistant(connectionType); using (var connection = databaseAssistant.CreateConnection(DatabaseHelpers.GetDefaultConnectionString(connectionType))) { connection.Open(); return(new DatabaseModel.ProcedureParameters(databaseAssistant.GetStoredProcedureParameters(connection, "Test Proc"))); } } catch { try { RemoveTestProc(connectionType); } catch { } throw; } }
internal static void CreateTestFunction(string createFunctionStatement, ConnectionType connectionType) { try { RemoveTestFunction(connectionType); } catch { } try { DatabaseHelpers.ExecuteSqlStatement(createFunctionStatement, connectionType); } catch { try { RemoveTestFunction(connectionType); } catch { } throw; } }
public static void RemoveTestTable(ConnectionType connectionType) { DatabaseHelpers.ExecuteSqlStatement(@"DROP TABLE TESTTABLE", connectionType); }
internal static void RemoveTestFunction(ConnectionType connectionType) { DatabaseHelpers.ExecuteSqlStatement("DROP Function TestFunction", connectionType); }
public static void RemoveTestProc(ConnectionType connectionType) { DatabaseHelpers.ExecuteSqlStatement("DROP PROCEDURE \"Test Proc\"", connectionType); }