MCPcopy Create free account
hub / github.com/francoispqt/gojay / SQLNullString

Method SQLNullString

decode_sqlnull.go:85–97  ·  view source on GitHub ↗

SQLNullString decodes the JSON value within an object or an array to an *sql.NullString

(v *sql.NullString)

Source from the content-addressed store, hash-verified

83
84// SQLNullString decodes the JSON value within an object or an array to an *sql.NullString
85func (dec *Decoder) SQLNullString(v *sql.NullString) error {
86 var b *string
87 if err := dec.StringNull(&b); err != nil {
88 return err
89 }
90 if b == nil {
91 v.Valid = false
92 } else {
93 v.String = *b
94 v.Valid = true
95 }
96 return nil
97}
98
99// AddSQLNullInt64 decodes the JSON value within an object or an array to qn *sql.NullInt64
100func (dec *Decoder) AddSQLNullInt64(v *sql.NullInt64) error {

Callers 1

AddSQLNullStringMethod · 0.95

Calls 1

StringNullMethod · 0.95

Tested by

no test coverage detected