mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-09-19 12:01:27 +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
|
||||
// can be permitted to be NULL.
|
||||
func SQLTime(t time.Time) sql.NullTime {
|
||||
|
Reference in New Issue
Block a user