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

Added support for uuid PostgreSQL type #172

Merged
merged 3 commits into from Sep 3, 2021
Merged

Added support for uuid PostgreSQL type #172

merged 3 commits into from Sep 3, 2021

Conversation

kpumuk
Copy link
Contributor

@kpumuk kpumuk commented Aug 3, 2021

This PR brings uuid PostgreSQL type to pgx. Internally, it is represented as a 16 bytes buffer in Postgres, and so I tried to mimic it in Rust.

I chose to define an internal Uuid type instead of exposing a similar type from uuid crate. This and using [u8; 16] everywhere should provide a flexible enough interface for anybody who wants to use both libraries together.

@eeeebbbbrrrr eeeebbbbrrrr added the enhancement New feature or request label Aug 3, 2021
}

fn format(&self, f: &mut std::fmt::Formatter<'_>, case: UuidFormatCase) -> std::fmt::Result {
let hyphenated = f.sign_minus();
Copy link
Contributor

Choose a reason for hiding this comment

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

Such a good trick. :)

@Hoverbear Hoverbear merged commit 6d0dd95 into pgcentralfoundation:develop Sep 3, 2021
@Hoverbear Hoverbear added this to the 0.2.0 milestone Sep 24, 2021
This was referenced Sep 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants