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

Exposing the Oid of PostgreSQL types #2507

Merged
merged 4 commits into from
Jun 30, 2023
Merged

Conversation

Razican
Copy link
Contributor

@Razican Razican commented May 19, 2023

This PR closes #1111 and supersedes #2146. It adds a function to retrieve OIDs, which is very useful in very dynamic schemas, such as DBMSs or when you want to provide a more low-level interface to the DB.

This function is a non-panicking alternative to .oid().

@Razican
Copy link
Contributor Author

Razican commented May 29, 2023

@abonander is this a better solution to the situation? Could this be reviewed?

sqlx-postgres/src/type_info.rs Outdated Show resolved Hide resolved
@abonander
Copy link
Collaborator

abonander commented Jun 12, 2023

This is fine as long as the documentation is very clear about the caveats. The suggested change has those.

The try_ prefix of the method suggests that the implementation will attempt to look up the OID, so that should be omitted.

Co-authored-by: Austin Bonander <austin.bonander@gmail.com>
@Razican
Copy link
Contributor Author

Razican commented Jun 13, 2023

This is fine as long as the documentation is very clear about the caveats. The suggested change has those.

The try_ prefix of the method suggests that the implementation will attempt to look up the OID, so that should be omitted.

Makes total sense to me :) I added your changes to the PR. Thanks for reviewing it!

@abonander
Copy link
Collaborator

@Razican can you run cargo fmt real quick? It doesn't like something in my suggested change but it's not obvious what (maybe a Tab character got in there somehow).

@Razican
Copy link
Contributor Author

Razican commented Jun 13, 2023

@Razican can you run cargo fmt real quick? It doesn't like something in my suggested change but it's not obvious what (maybe a Tab character got in there somehow).

Done :)

@abonander abonander merged commit 87ff645 into launchbadge:main Jun 30, 2023
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.

Expose PostgreSQL column and type OIDs
2 participants