2022-10-04 04:27:29 +00:00
|
|
|
package postgresql
|
2022-10-04 04:19:25 +00:00
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/volatiletech/null/v8"
|
|
|
|
"time"
|
|
|
|
)
|
|
|
|
|
|
|
|
func SetString(val string) null.String {
|
|
|
|
return null.String{
|
|
|
|
String: val,
|
|
|
|
Valid: true,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
func SetInt(val int) null.Int {
|
|
|
|
return null.Int{
|
|
|
|
Int: val,
|
|
|
|
Valid: true,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
func SetBool(val bool) null.Bool {
|
|
|
|
return null.Bool{
|
|
|
|
Bool: val,
|
|
|
|
Valid: true,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
func SetTime(val time.Time) null.Time {
|
|
|
|
return null.Time{
|
|
|
|
Time: val,
|
|
|
|
Valid: true,
|
|
|
|
}
|
|
|
|
}
|
2022-10-04 04:42:43 +00:00
|
|
|
|
|
|
|
func SetJSON(val []byte) null.JSON {
|
|
|
|
return null.JSON{
|
|
|
|
JSON: val,
|
|
|
|
Valid: true,
|
|
|
|
}
|
|
|
|
}
|