15 lines
218 B
Go
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()")
|
|
}
|