-
Notifications
You must be signed in to change notification settings - Fork 861
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
Conform UUID to Stringer interface #2055
Comments
I guess we could add it, but |
@jackc yep makes sense. thats what I ended up doing, the first example in the sqlc docs is for doing exactly this: |
@andradei The extension libraries are listed in the README. https://github.com/jackc/pgx/?tab=readme-ov-file#adapters-for-3rd-party-types. It's the same situation for decimal/numeric. pgx has a type whose sole purpose is to transfer values, but you really probably want to use shopspring/decimal. |
It's not looking as a big deal especially we already have encode UUID function. |
@grachevko Finally! That's very helpful. |
Is your feature request related to a problem? Please describe.
I use sqlc, updated sql_package use pgx instead of previous version which used github.com/google/uuid. My code generally works as-is, except for some cases where I would pass an ID to something that expects a "stringer":
For example, this makes it easy to tag logs with ID's:
Describe the solution you'd like
Add String method to UUID.
Describe alternatives you've considered
Additional context
here's the implementation from google's package:
I can make a PR if that would help expedite this.
The text was updated successfully, but these errors were encountered: