aboutsummaryrefslogtreecommitdiff
path: root/lib/uuidv7/uuidv7.go
diff options
context:
space:
mode:
Diffstat (limited to 'lib/uuidv7/uuidv7.go')
-rw-r--r--lib/uuidv7/uuidv7.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/uuidv7/uuidv7.go b/lib/uuidv7/uuidv7.go
index e35e684b..21277e55 100644
--- a/lib/uuidv7/uuidv7.go
+++ b/lib/uuidv7/uuidv7.go
@@ -165,6 +165,7 @@ func (id *UUIDv7) UnmarshalText(data []byte) (err error) {
// Scan scans the raw database value into id.
// This method implement [database/sql.Scanner] interface.
+// Column with NULL value will returns no error but zero UUID.
func (id *UUIDv7) Scan(src any) (err error) {
switch v := src.(type) {
case []byte:
@@ -172,6 +173,8 @@ func (id *UUIDv7) Scan(src any) (err error) {
if err != nil {
return err
}
+ case nil:
+ return nil
default:
return fmt.Errorf(`uuidv7: Scan: invalid type %T`, src)
}