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

Method EncodeSQLNullInt64

encode_sqlnull.go:96–107  ·  view source on GitHub ↗

NullInt64 EncodeSQLNullInt64 encodes a string to

(v *sql.NullInt64)

Source from the content-addressed store, hash-verified

94
95// EncodeSQLNullInt64 encodes a string to
96func (enc *Encoder) EncodeSQLNullInt64(v *sql.NullInt64) error {
97 if enc.isPooled == 1 {
98 panic(InvalidUsagePooledEncoderError("Invalid usage of pooled encoder"))
99 }
100 _, _ = enc.encodeInt64(v.Int64)
101 _, err := enc.Write()
102 if err != nil {
103 enc.err = err
104 return err
105 }
106 return nil
107}
108
109// AddSQLNullInt64 adds a string to be encoded, must be used inside a slice or array encoding (does not encode a key)
110func (enc *Encoder) AddSQLNullInt64(v *sql.NullInt64) {

Callers 1

TestEncoceSQLNullInt64Function · 0.95

Calls 3

encodeInt64Method · 0.95
WriteMethod · 0.95

Tested by 1

TestEncoceSQLNullInt64Function · 0.76