private void SetupGeneratedStatements() { // Generate the Insert, Update and Delete statements using mysql DB so that we can test the exact strings. var databaseConnection = MyDBConnection.GetDatabaseConfig(DatabaseConfig.MySql).GetDatabaseConnection(); _insertSql = new InsertStatementGenerator(_filledCircle, databaseConnection).Generate(); _updateSql = new UpdateStatementGenerator(_filledCircle, databaseConnection).Generate(); _deleteSql = new DeleteStatementGenerator(_filledCircle, databaseConnection).Generate(); }
public override void TestFixtureSetup() { if (DatabaseConnection.CurrentConnection != null && DatabaseConnection.CurrentConnection.GetType() == typeof(DatabaseConnectionMySql)) { return; } DatabaseConnection.CurrentConnection = new DatabaseConnectionMySql("MySql.Data", "MySql.Data.MySqlClient.MySqlConnection"); DatabaseConnection.CurrentConnection.ConnectionString = MyDBConnection.GetDatabaseConfig().GetConnectionString(); DatabaseConnection.CurrentConnection.GetConnection(); BORegistry.DataAccessor = new DataAccessorDB(); }
public static void CreateContactPersonAddressTable(string cpAddressTableName, string cpTableName) { if (BORegistry.DataAccessor is DataAccessorInMemory) { return; } if (BORegistry.DataAccessor is DataAccessorMultiSource) { return; } var databaseConfig = MyDBConnection.GetDatabaseConfig(); var migrator = new Migrator(databaseConfig); migrator.DirectMigrateUp(new Migration_Temp_ContactPersonAddress(cpAddressTableName, cpTableName)); }
private static InsertStatementGenerator CreateInsertStatementGenerator(IBusinessObject shape, string databaseVendor) { var databaseConnection = MyDBConnection.GetDatabaseConfig(databaseVendor).GetDatabaseConnection(); return(new InsertStatementGenerator(shape, databaseConnection)); }
private static UpdateStatementGenerator CreateUpdateStatementGenerator(IBusinessObject businessObject, string databaseVendor) { var databaseConnection = MyDBConnection.GetDatabaseConfig(databaseVendor).GetDatabaseConnection(); return(new UpdateStatementGenerator(businessObject, databaseConnection)); }