We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2d03204 commit a9c30daCopy full SHA for a9c30da
sqldb/sqlutils.go
@@ -75,6 +75,15 @@ func SQLStrValid(s string) sql.NullString {
75
}
76
77
78
+// SQLBool turns a boolean into the NullBool that sql/sqlc uses when a boolean
79
+// can be permitted to be NULL.
80
+func SQLBool(b bool) sql.NullBool {
81
+ return sql.NullBool{
82
+ Bool: b,
83
+ Valid: true,
84
+ }
85
+}
86
+
87
// SQLTime turns a time.Time into the NullTime that sql/sqlc uses when a time
88
// can be permitted to be NULL.
89
func SQLTime(t time.Time) sql.NullTime {
0 commit comments