contracts/base/res_field_sql_defined.go
2023-04-12 16:56:55 +08:00

15 lines
218 B
Go

package base
import (
"github.com/google/uuid"
"git.fsdpf.net/go/db"
)
func Uuid(driver string) db.Expression {
if driver == "sqlite" {
return db.Raw("'" + uuid.NewString() + "'")
}
return db.Raw("uuid()")
}