feat: establish Orbit models, migrations and development baseline
This commit is contained in:
16
model/digest.go
Normal file
16
model/digest.go
Normal file
@@ -0,0 +1,16 @@
|
||||
package model
|
||||
|
||||
import (
|
||||
"database/sql/driver"
|
||||
"errors"
|
||||
)
|
||||
|
||||
func (d Digest) Value() (driver.Value, error) { return d[:], nil }
|
||||
func (d *Digest) Scan(src any) error {
|
||||
b, ok := src.([]byte)
|
||||
if !ok || len(b) != len(d) {
|
||||
return errors.New("digest: expected BINARY(32)")
|
||||
}
|
||||
copy(d[:], b)
|
||||
return nil
|
||||
}
|
||||
Reference in New Issue
Block a user