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

expose relation_id and relation_attribution_no on PgColumn #3492

Merged
merged 7 commits into from
Sep 8, 2024

Conversation

kurtbuilds
Copy link
Contributor

I'm building a tool that does introspection on queries that requires reading relation_id and attribute number from postgres queries. Today, sqlx keeps those fields private.

This PR exposes those fields, along with a small data type correction to relation_id - it's an Oid, which is a u32, not a i32.

Copy link
Collaborator

@abonander abonander left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, just a couple nits + documentation

sqlx-postgres/src/column.rs Outdated Show resolved Hide resolved
sqlx-postgres/src/column.rs Outdated Show resolved Hide resolved
sqlx-postgres/src/message/row_description.rs Outdated Show resolved Hide resolved
sqlx-postgres/src/message/row_description.rs Outdated Show resolved Hide resolved
sqlx-postgres/src/message/row_description.rs Outdated Show resolved Hide resolved
sqlx-postgres/src/column.rs Show resolved Hide resolved
kurtbuilds and others added 5 commits September 7, 2024 12:46
Co-authored-by: Austin Bonander <austin.bonander@gmail.com>
Co-authored-by: Austin Bonander <austin.bonander@gmail.com>
Co-authored-by: Austin Bonander <austin.bonander@gmail.com>
Co-authored-by: Austin Bonander <austin.bonander@gmail.com>
Co-authored-by: Austin Bonander <austin.bonander@gmail.com>
@kurtbuilds kurtbuilds requested a review from abonander September 7, 2024 19:56
@kurtbuilds
Copy link
Contributor Author

Thanks for the suggestions!

@abonander abonander merged commit c597a22 into launchbadge:main Sep 8, 2024
79 checks passed
jrasanen pushed a commit to jrasanen/sqlx that referenced this pull request Oct 14, 2024
…nchbadge#3492)

* expose relation_id and relation_attribution_no on PgColumn

* Update sqlx-postgres/src/message/row_description.rs

Co-authored-by: Austin Bonander <austin.bonander@gmail.com>

* Update sqlx-postgres/src/column.rs

Co-authored-by: Austin Bonander <austin.bonander@gmail.com>

* Update sqlx-postgres/src/message/row_description.rs

Co-authored-by: Austin Bonander <austin.bonander@gmail.com>

* Update sqlx-postgres/src/column.rs

Co-authored-by: Austin Bonander <austin.bonander@gmail.com>

* Update sqlx-postgres/src/message/row_description.rs

Co-authored-by: Austin Bonander <austin.bonander@gmail.com>

* fix

---------

Co-authored-by: Austin Bonander <austin.bonander@gmail.com>
jrasanen pushed a commit to jrasanen/sqlx that referenced this pull request Oct 14, 2024
…nchbadge#3492)

* expose relation_id and relation_attribution_no on PgColumn

* Update sqlx-postgres/src/message/row_description.rs

Co-authored-by: Austin Bonander <austin.bonander@gmail.com>

* Update sqlx-postgres/src/column.rs

Co-authored-by: Austin Bonander <austin.bonander@gmail.com>

* Update sqlx-postgres/src/message/row_description.rs

Co-authored-by: Austin Bonander <austin.bonander@gmail.com>

* Update sqlx-postgres/src/column.rs

Co-authored-by: Austin Bonander <austin.bonander@gmail.com>

* Update sqlx-postgres/src/message/row_description.rs

Co-authored-by: Austin Bonander <austin.bonander@gmail.com>

* fix

---------

Co-authored-by: Austin Bonander <austin.bonander@gmail.com>
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.

2 participants