Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implemented DerefMut for PgRelation #1956

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion pgrx/src/rel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ use crate::{
use pgrx_sql_entity_graph::metadata::{
ArgumentError, Returns, ReturnsError, SqlMapping, SqlTranslatable,
};
use std::ops::Deref;
use std::ops::{Deref, DerefMut};
use std::os::raw::c_char;

pub struct PgRelation {
Expand Down Expand Up @@ -334,6 +334,12 @@ impl Deref for PgRelation {
}
}

impl DerefMut for PgRelation {
fn deref_mut(&mut self) -> &mut Self::Target {
&mut self.boxed
}
}

impl Drop for PgRelation {
fn drop(&mut self) {
if !self.boxed.is_null() && self.need_close {
Expand Down
Loading