mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-09-20 13:04:28 +02:00
sqldb: add helper for type boolean
This commit is contained in:
@@ -75,6 +75,15 @@ func SQLStrValid(s string) sql.NullString {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// SQLBool turns a boolean into the NullBool that sql/sqlc uses when a boolean
|
||||||
|
// can be permitted to be NULL.
|
||||||
|
func SQLBool(b bool) sql.NullBool {
|
||||||
|
return sql.NullBool{
|
||||||
|
Bool: b,
|
||||||
|
Valid: true,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// SQLTime turns a time.Time into the NullTime that sql/sqlc uses when a time
|
// SQLTime turns a time.Time into the NullTime that sql/sqlc uses when a time
|
||||||
// can be permitted to be NULL.
|
// can be permitted to be NULL.
|
||||||
func SQLTime(t time.Time) sql.NullTime {
|
func SQLTime(t time.Time) sql.NullTime {
|
||||||
|
Reference in New Issue
Block a user