mirror of
https://github.com/hatchet-dev/hatchet.git
synced 2025-12-16 22:35:11 -06:00
fix: handle invalid uuid input
This commit is contained in:
@@ -1,11 +1,16 @@
|
||||
package sqlchelpers
|
||||
|
||||
import (
|
||||
"github.com/google/uuid"
|
||||
"github.com/jackc/pgx/v5/pgtype"
|
||||
)
|
||||
|
||||
func UUIDToStr(uuid pgtype.UUID) string {
|
||||
return uuid.String()
|
||||
func UUIDToStr(u pgtype.UUID) string {
|
||||
if !u.Valid {
|
||||
return uuid.Nil.String()
|
||||
}
|
||||
|
||||
return u.String()
|
||||
}
|
||||
|
||||
func UUIDFromStr(uuid string) pgtype.UUID {
|
||||
|
||||
Reference in New Issue
Block a user