jackc / jackc/pgx

Support for Go 1.27 UUIDs

Open
#2,636 1 comment 11 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Go
Stars
14.3k
Forks
1.1k
Avg merge
6d 9h
Merged PRs (30d)
11

Description

**Is your feature request related to a problem? Please describe.**
Go has a uuid package as part of std lib since 1.27 https://pkg.go.dev/uuid
It would be great if `pgtype.UUID` can return a std lib uuid directly.

**Describe the solution you'd like**
I am currently updating my projects to remove the `google/uuid` dependency in favor of the std lib `uuid`. As the std lib uuid implementation does not include `Valuer` or `Scanner` implementations, it is a bit unwieldy to work with when used with pgx results. I need to implement some boiler code to convert the `[16]byte` into a std lib uuid.

**Describe alternatives you've considered**
None.

**Additional context**
None.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the pgtype.UUID implementation and the existing google/uuid integration in pgx. Check how pgx results are scanned and valued, then make the stdlib uuid usable directly while retaining the expected UUID behavior; verify the result with the relevant existing tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
database
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
65/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.