func (c *expressionCompiler) Literal(e *criteria.LiteralExpression) interface{} {
	json := isInJSONContext(e)
	if json {
		stringVal, err := c.convertToString(e.Value)
		if err == nil {
			return stringVal + "}'"
		}
		if stringArr, ok := e.Value.([]string); ok {
			return "[" + c.wrapStrings(stringArr) + "]}'"
		}
		c.err = append(c.err, err)
		return nil
	}
	c.parameters = append(c.parameters, e.Value)
	return "?"
}
// literal values need to be converted differently depending on whether they are
// used in a JSON context or a regular SQL expression. JSON values are always
// strings (delimited with "'"), but operators can be used depending on the
// dynamic type. For example, you can write "a->'foo' < '5'" and it will return
// true for the json object { "a": 40 }.
literal values need to be converted differently depending on whether they are
used in a JSON context or a regular SQL expression. JSON values are always
strings (delimited with "'"), but operators can be used depending on the
dynamic type. For example, you can write "a->'foo' < '5'" and it will return
true for the json object { "a": 40 }.
// literal values need to be converted differently depending on whether they are // used in a JSON context or a regular SQL expression . JSON values are always // strings ( delimited with " ' " ) but operators can be used depending on the // dynamic type . For example you can write " a - > ' foo ' < ' 5 ' " and it will return // true for the json object { " a " : 40 } .
func (c *expressionCompiler) Literal(e *criteria.LiteralExpression) interface{} {
	json := isInJSONContext(e)
	if json {
		stringVal, err := c.convertToString(e.Value)
		if err == nil {
			return stringVal + "}'"
		}
		if stringArr, ok := e.Value.([]string); ok {
			return "[" + c.wrapStrings(stringArr) + "]}'"
		}
		c.err = append(c.err, err)
		return nil
	}
	c.parameters = append(c.parameters, e.Value)
	return "?"
}
func ( c * expressionCompiler ) Literal ( e * criteria . LiteralExpression ) interface { } { json := isInJSONContext ( e ) if json { stringVal , err := c . convertToString ( e . Value ) if err == nil { return stringVal + " " } if stringArr , ok := e . Value . ( [ ] string ) ; ok { return " " + c . wrapStrings ( stringArr ) + " " } c . err = append ( c . err , err ) return nil } c . parameters = append ( c . parameters , e . Value ) return " " }
literal values need to be converted differently depending on whether they are
used in a JSON context or a regular SQL expression.
literal values need to be converted differently depending on whether they are used in a JSON context or a regular SQL expression .