// AddSQLNullInt64 decodes the JSON value within an object or an array to qn *sql.NullInt64
169685
func (dec *Decoder) AddSQLNullInt64(v *sql.NullInt64) error {
	return dec.SQLNullInt64(v)
}
976003
func (enc *Encoder) AddUint64KeyNullEmpty(key string, v uint64) {
	enc.Uint64KeyNullEmpty(key, v)
}
367767
func Uint64EncodeSql(b encoding2.BinaryWriter, num uint64) {
	numVal, _ := BuildValue(num)
	numVal.EncodeSql(b)
}
215208
func (enc *Encoder) AddFloat64KeyOmitEmpty(key string, v float64) {
	enc.FloatKeyOmitEmpty(key, v)
}
341160
func (f *Queries) Uint64(key string) (uint64, error) {
	s, err := f.String(key)
	if err != nil {
		return 0, err
	}
	return strconv.ParseUint(s, 10, 64)
}
103847
func (enc *Encoder) AddSQLNullBool(v *sql.NullBool) {
	enc.Bool(v.Bool)
}
772355
func (enc *Encoder) AddSQLNullFloat64OmitEmpty(v *sql.NullFloat64) {
	if v != nil && v.Valid && v.Float64 != 0 {
		enc.Float64OmitEmpty(v.Float64)
	}
}
1162092
func (enc *Encoder) SQLNullFloat64KeyNullEmpty(key string, v *sql.NullFloat64) {
	if v != nil && v.Valid {
		enc.Float64KeyNullEmpty(key, v.Float64)
	}
}
123253
func (dec *Decoder) DecodeSQLNullString(v *sql.NullString) error {
	if dec.isPooled == 1 {
		panic(InvalidUsagePooledDecoderError("Invalid usage of pooled decoder"))
	}
	return dec.decodeSQLNullString(v)
}
75115
func NewInt64(v int64) Value {
	return MakeTrusted(Int64, strconv.AppendInt(nil, v, 10))
}
921798
func (enc *Encoder) AddFloat32KeyNullEmpty(key string, v float32) {
	enc.Float32KeyNullEmpty(key, v)
}
1371602
func AddString64(h uint64, s string) uint64 {
	/*
		This is an implementation of the jody hashing algorithm as found here:

		- https://github.com/jbruchon/jodyhash

		It was revisited a bit and only the 64 bit version is available for now,
		but it's indeed really fast:

		- BenchmarkHash64/jody/algorithm-4   100000000   11.8 ns/op   3050.83 MB/s   0 B/op   0 allocs/op

		Here's what the reference implementation looks like:

		hash_t hash = start_hash;
		hash_t element;
		hash_t partial_salt;
		size_t len;

		len = count / sizeof(hash_t);
		for (; len > 0; len--) {
			element = *data;
			hash += element;
			hash += constant;
			hash = (hash << shift) | hash >> (sizeof(hash_t) * 8 - shift);
			hash ^= element;
			hash = (hash << shift) | hash >> (sizeof(hash_t) * 8 - shift);
			hash ^= constant;
			hash += element;
			data++;
		}

		len = count & (sizeof(hash_t) - 1);
		if (len) {
			partial_salt = constant & tail_mask[len];
			element = *data & tail_mask[len];
			hash += element;
			hash += partial_salt;
			hash = (hash << shift) | hash >> (sizeof(hash_t) * 8 - shift);
			hash ^= element;
			hash = (hash << shift) | hash >> (sizeof(hash_t) * 8 - shift);
			hash ^= partial_salt;
			hash += element;
		}

		return hash;
	*/

	r := *(*reflect.StringHeader)(unsafe.Pointer(&s))
	p := unsafe.Pointer((*reflect.StringHeader)(unsafe.Pointer(&s)).Data)

	for n := r.Len / 8; n != 0; n-- {
		v := *(*uint64)(p)

		h = h + v + constant
		h = (h<<shift | h>>(64-shift)) ^ v
		h = ((h<<shift | h>>(64-shift)) ^ constant) + v

		p = unsafe.Pointer(uintptr(p) + 8)
	}

	if n := (r.Len & 7); n != 0 {
		m := mask64[n]
		c := constant & m
		v := *(*uint64)(p) & m // risk of segfault here?

		h = h + v + c
		h = (h<<shift | h>>(64-shift)) ^ v
		h = ((h<<shift | h>>(64-shift)) ^ c) + v
	}

	return h
}
1052306
func (enc *Encoder) AddSQLNullInt64KeyOmitEmpty(key string, v *sql.NullInt64) {
	if v != nil && v.Valid && v.Int64 != 0 {
		enc.Int64KeyOmitEmpty(key, v.Int64)
	}
}
590115
func (enc *Encoder) AddUint32KeyOmitEmpty(key string, v uint32) {
	enc.Uint64KeyOmitEmpty(key, uint64(v))
}
659573
func (nn NullNumber) Int64() (int64, error) {
	if nn.IsNil() {
		return 0, errors.New("NullNumber is nil")
	}
	return strconv.ParseInt(nn.value.(string), 10, 64)
}
247828
func (enc *Encoder) AddInt8KeyOmitEmpty(key string, v int8) {
	enc.Int64KeyOmitEmpty(key, int64(v))
}
4027
func (enc *Encoder) AddInt16KeyOmitEmpty(key string, v int16) {
	enc.Int64KeyOmitEmpty(key, int64(v))
}