-
-
Notifications
You must be signed in to change notification settings - Fork 443
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
Adds RowDescription to the SimpleQueryMessage #1144
Conversation
tokio-postgres/src/simple_query.rs
Outdated
_ => return Poll::Ready(Some(Err(Error::unexpected_message()))), | ||
*this.columns = Some(columns.clone()); | ||
Poll::Ready(Some(Ok(SimpleQueryMessage::RowDescription( | ||
columns.clone(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You shouldn't need to clone here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was originally confused about this, but thought it over and figured out a solution. I've added a change to reduce it to just 1 clone instead of 2.
tokio-postgres/src/simple_query.rs
Outdated
*this.columns = Some(columns); | ||
Poll::Ready(Some(Ok(SimpleQueryMessage::RowDescription( | ||
columns.clone(), | ||
this.columns.as_ref().unwrap().clone(), | ||
)))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wouldn't this work?
*this.columns = Some(columns.clone());
Poll::Ready(Some(Ok(SimpleQueryMessage::RowDescription(
columns
))))
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it does. I was clearly overthinking it. Thank you!
Thanks! |
Adds RowDescription to the SimpleQueryMessage to allow column information to be consumed without needing to consume any DataRows
Resolves #1143