MCPcopy Create free account
hub / github.com/PostHog/duckgres / jsonTypeEquals

Function jsonTypeEquals

transpiler/transform/operators.go:825–834  ·  view source on GitHub ↗

jsonTypeEquals builds `json_type( ) = ' '`.

(operand *pg_query.Node, typ string)

Source from the content-addressed store, hash-verified

823
824// jsonTypeEquals builds `json_type(<operand clone>) = '<typ>'`.
825func jsonTypeEquals(operand *pg_query.Node, typ string) *pg_query.Node {
826 return &pg_query.Node{Node: &pg_query.Node_AExpr{AExpr: &pg_query.A_Expr{
827 Kind: pg_query.A_Expr_Kind_AEXPR_OP,
828 Name: []*pg_query.Node{
829 {Node: &pg_query.Node_String_{String_: &pg_query.String{Sval: "="}}},
830 },
831 Lexpr: jsonFuncCall("json_type", cloneNode(operand)),
832 Rexpr: strConst(typ),
833 }}}
834}
835
836// isNullTest builds `<operand clone> IS NULL`.
837func isNullTest(operand *pg_query.Node) *pg_query.Node {

Callers 1

createJSONConcatExprMethod · 0.85

Calls 3

jsonFuncCallFunction · 0.85
cloneNodeFunction · 0.85
strConstFunction · 0.85

Tested by

no test coverage detected