mirror of
https://github.com/jackc/pgx.git
synced 2025-07-11 13:08:49 +00:00
Update for pgx v5
parent
28fe4c34fe
commit
4a88418606
@ -6,7 +6,7 @@ Import the following package:
|
||||
|
||||
```go
|
||||
import (
|
||||
pgtypeuuid "github.com/jackc/pgtype/ext/gofrs-uuid"
|
||||
pgxuuid "github.com/jackc/pgx-gofrs-uuid"
|
||||
)
|
||||
```
|
||||
|
||||
@ -18,11 +18,7 @@ if err != nil {
|
||||
// handle error
|
||||
}
|
||||
dbconfig.AfterConnect = func(ctx context.Context, conn *pgx.Conn) error {
|
||||
conn.ConnInfo().RegisterDataType(pgtype.DataType{
|
||||
Value: &pgtypeuuid.UUID{},
|
||||
Name: "uuid",
|
||||
OID: pgtype.UUIDOID,
|
||||
})
|
||||
pgxuuid.Register(conn.TypeMap())
|
||||
return nil
|
||||
}
|
||||
```
|
||||
|
Loading…
x
Reference in New Issue
Block a user