public override void Create() { using (var masterConnection = _connection.CreateMasterConnection()) { CreateCreateOperations().ExecuteNonQuery(masterConnection); ClearPool(); } var postCreateOperations = CreatePostCreateOperations(); postCreateOperations.ExecuteNonQuery(_connection); if (postCreateOperations.Any()) { // The post-creation operations may have create new types (e.g. extension), // reload type definitions _connection.Open(); try { ((NpgsqlConnection)_connection.DbConnection).ReloadTypes(); } finally { _connection.Close(); } } }
public override bool Exists() { try { _connection.Open(); _connection.Close(); return(true); } catch (PostgresException e) { if (IsDoesNotExist(e)) { return(false); } throw; } }