// SQLNullString decodes the JSON value within an object or an array to an *sql.NullString
483307
func (dec *Decoder) SQLNullString(v *sql.NullString) error {
	var b *string
	if err := dec.StringNull(&b); err != nil {
		return err
	}
	if b == nil {
		v.Valid = false
	} else {
		v.String = *b
		v.Valid = true
	}
	return nil
}
640095
func (r *Reader) ReadNullTermString(encoding byte) (string, error) {
	atIndex, afterIndex := nullIndex(r.data[r.index:], encoding)
	b, err := r.ReadNumBytes(afterIndex)
	if err != nil {
		return "", err
	}

	return Decoders[encoding].ConvertString(string(b[:atIndex]))
}
754424
func builtinIsNull(args []types.Datum, _ context.Context) (d types.Datum, err error) {
	if args[0].IsNull() {
		d.SetInt64(1)
	} else {
		d.SetInt64(0)
	}
	return d, nil
}
757429
func (t *Transaction) SelectNullInt(query string, args ...interface{}) (sql.NullInt64, error) {
	if t.dbmap.ExpandSliceArgs {
		expandSliceArgs(&query, args...)
	}

	return SelectNullInt(t, query, args...)
}
456809
func (me *DefaultAdapter) LiteralString(buf *SqlBuilder, s string) error {
	if buf.IsPrepared {
		return me.PlaceHolderSql(buf, s)
	}
	buf.WriteRune(me.StringQuote)
	for _, char := range s {
		if e, ok := me.EscapedRunes[char]; ok {
			buf.Write(e)
		} else {
			buf.WriteRune(char)
		}
	}

	buf.WriteRune(me.StringQuote)
	return nil
}
386720
func NullDataScript(data []byte) ([]byte, error) {
	if len(data) > MaxDataCarrierSize {
		str := fmt.Sprintf("data size %d is larger than max "+
			"allowed size %d", len(data), MaxDataCarrierSize)
		return nil, scriptError(ErrTooMuchNullData, str)
	}

	return NewScriptBuilder().AddOp(OP_RETURN).AddData(data).Script()
}
982560
func (enc *Encoder) SQLNullInt64OmitEmpty(v *sql.NullInt64) {
	if v != nil && v.Valid && v.Int64 != 0 {
		enc.Int64(v.Int64)
	}
}
23501
func StrColumn(
	name string,
	charset Charset,
	collation Collation,
	nullable NullableColumn) NonAliasColumn {

	if !validIdentifierName(name) {
		panic("Invalid column name in str column")
	}
	sc := &stringColumn{charset: charset, collation: collation}
	sc.name = name
	sc.nullable = nullable
	return sc
}
196578
func (m *DbMap) SelectNullFloat(query string, args ...interface{}) (sql.NullFloat64, error) {
	if m.ExpandSliceArgs {
		expandSliceArgs(&query, args...)
	}

	return SelectNullFloat(m, query, args...)
}
1363684
func (enc *Encoder) AddStringKeyNullEmpty(key, v string) {
	enc.StringKeyNullEmpty(key, v)
}
561257
func ParseString(s string) (*Query, error) {
	return NewParser(strings.NewReader(s)).Parse()
}
142927
func (enc *Encoder) SQLNullStringNullEmpty(v *sql.NullString) {
	if v != nil && v.Valid {
		enc.StringNullEmpty(v.String)
	}
}
550722
func String(s string) NullString {
	return NullString{
		sql.NullString{
			String: s,
			Valid:  true,
		},
	}
}
141649
func (enc *Encoder) SQLNullFloat64KeyOmitEmpty(key string, v *sql.NullFloat64) {
	if v != nil && v.Valid && v.Float64 != 0 {
		enc.Float64KeyOmitEmpty(key, v.Float64)
	}
}
813723
func (n *NullUint64) ParseStringValue(val string) error {
	if val == "" {
		return nil
	}

	uint64Val, err := strconv.ParseUint(val, 10, 64)
	if err != nil {
		return err
	}

	n.Value = uint64Val
	n.IsSet = true

	return nil
}
585316
func (enc *Encoder) SQLNullInt64KeyNullEmpty(key string, v *sql.NullInt64) {
	if v != nil && v.Valid {
		enc.Int64KeyNullEmpty(key, v.Int64)
	}
}
212771
func (engine *Engine) QueryString(sqlorArgs ...interface{}) ([]map[string]string, error) {
	session := engine.NewSession()
	defer session.Close()
	return session.QueryString(sqlorArgs...)
}