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

Adds RowDescription to the SimpleQueryMessage #1144

Merged
merged 6 commits into from
Jul 9, 2024

Conversation

rigby-dane
Copy link
Contributor

Adds RowDescription to the SimpleQueryMessage to allow column information to be consumed without needing to consume any DataRows

Resolves #1143

_ => return Poll::Ready(Some(Err(Error::unexpected_message()))),
*this.columns = Some(columns.clone());
Poll::Ready(Some(Ok(SimpleQueryMessage::RowDescription(
columns.clone(),
Copy link
Owner

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.

Copy link
Contributor Author

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.

Comment on lines 104 to 107
*this.columns = Some(columns);
Poll::Ready(Some(Ok(SimpleQueryMessage::RowDescription(
columns.clone(),
this.columns.as_ref().unwrap().clone(),
))))
Copy link
Owner

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
                ))))

Copy link
Contributor Author

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!

@sfackler sfackler merged commit 647a925 into sfackler:master Jul 9, 2024
4 checks passed
@sfackler
Copy link
Owner

sfackler commented Jul 9, 2024

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Idea: Add RowDescription to SimpleQueryMessage
2 participants