17 lines
291 B
Go
17 lines
291 B
Go
package database
|
|
|
|
import (
|
|
"github.com/google/uuid"
|
|
"github.com/jackc/pgx/v5/pgtype"
|
|
)
|
|
|
|
func MustToDBUUID(id uuid.UUID) pgtype.UUID {
|
|
var dbID pgtype.UUID
|
|
dbID.Scan(id.String())
|
|
return dbID
|
|
}
|
|
|
|
func MustToUUID(id pgtype.UUID) uuid.UUID {
|
|
return uuid.Must(uuid.FromBytes(id.Bytes[:]))
|
|
}
|