feat: init
This commit is contained in:
parent
7688020b52
commit
6302dd62d6
33 changed files with 6027 additions and 0 deletions
22
internal/repository/helpers.go
Normal file
22
internal/repository/helpers.go
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
package repository
|
||||
|
||||
import (
|
||||
"github.com/google/uuid"
|
||||
"github.com/jackc/pgx/v5/pgtype"
|
||||
)
|
||||
|
||||
func UUIDToPg(in uuid.UUID) pgtype.UUID {
|
||||
if in == uuid.Nil {
|
||||
return pgtype.UUID{}
|
||||
}
|
||||
|
||||
return pgtype.UUID{Bytes: in, Valid: true}
|
||||
}
|
||||
|
||||
func PGToUUID(in pgtype.UUID) uuid.UUID {
|
||||
if !in.Valid {
|
||||
return uuid.Nil
|
||||
}
|
||||
|
||||
return in.Bytes
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue