private static void CleanTables() { using (var connection = ConnectionUtils.CreateConnection()) { PostgreSqlTestObjectsInitializer.CleanTables(connection); } }
private static void RecreateSchemaAndInstallObjects() { using (var connection = ConnectionUtils.CreateMasterConnection()) { bool databaseExists = connection.Query <bool?>( @"select true :: boolean from pg_database where datname = @databaseName;", new { databaseName = ConnectionUtils.GetDatabaseName() } ).SingleOrDefault() ?? false; if (!databaseExists) { connection.Execute($@"CREATE DATABASE ""{ConnectionUtils.GetDatabaseName()}"""); } } using (var connection = ConnectionUtils.CreateConnection()) { if (connection.State == ConnectionState.Closed) { connection.Open(); } PostgreSqlObjectsInstaller.Install(connection); PostgreSqlTestObjectsInitializer.CleanTables(connection); } }
private static void RecreateSchemaAndInstallObjects() { using (var connection = new NpgsqlConnection( ConnectionUtils.GetMasterConnectionString())) { bool databaseExists = connection.Query <bool?>( @"select true :: boolean from pg_database where datname = @databaseName;", new { databaseName = ConnectionUtils.GetDatabaseName() } ).SingleOrDefault() ?? false; if (!databaseExists) { connection.Execute(String.Format(@"CREATE DATABASE ""{0}""", ConnectionUtils.GetDatabaseName())); } } using (var connection = new NpgsqlConnection( ConnectionUtils.GetConnectionString())) { PostgreSqlObjectsInstaller.Install(connection); PostgreSqlTestObjectsInitializer.CleanTables(connection); } }
private static void CleanTables() { using (var connection = new NpgsqlConnection( ConnectionUtils.GetConnectionString())) { PostgreSqlTestObjectsInitializer.CleanTables(connection); } }