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 #2146

Closed
wants to merge 1 commit into from

Conversation

Razican
Copy link
Contributor

@Razican Razican commented Oct 12, 2022

This PR closes #1111. 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.

@Razican
Copy link
Contributor Author

Razican commented Nov 20, 2022

Hello, is there anything else to do from my side? Is this something that could be merged?

pub fn oid(&self) -> Oid {
self.0.oid()
}

Copy link
Collaborator

@abonander abonander Feb 2, 2023

Choose a reason for hiding this comment

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

This isn't a suitable way to expose this as the type OID may not be resolved yet, e.g. if self was constructed from PgTypeInfo::with_name() this will panic.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Is there a suitable way of exposing the OID? If I want to deserialize a field to a different type depending on the column type, which could be the correct approach?

@abonander
Copy link
Collaborator

Closing due to inactivity. Feel free to reopen but please address the review comment.

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