marshal database value to byte slice

This commit is contained in:
2025-07-23 10:59:03 -07:00
parent ae00160469
commit 6ecb12c98c
2 changed files with 21 additions and 2 deletions
+2 -2
View File
@@ -129,9 +129,9 @@ func (t *ClockTime) UnmarshalGQL(value any) error {
}
// Value implements the database/sql/driver.Valuer interface for ClockTime.
// Marshals the ClockTime to a time.Time for database storage.
// Marshals the ClockTime to a byte slice for database storage.
func (t ClockTime) Value() (driver.Value, error) {
return t.Time(), nil
return []byte(t.String()), nil
}
// Scan implements the database/sql.Scanner interface for ClockTime.