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

Function boolComparisonRewrite

transpiler/transform/boolpredicates.go:326–341  ·  view source on GitHub ↗
(op string, value bool)

Source from the content-addressed store, hash-verified

324}
325
326func boolComparisonRewrite(op string, value bool) (pg_query.BoolTestType, bool) {
327 switch op {
328 case "=":
329 if value {
330 return pg_query.BoolTestType_IS_TRUE, true
331 }
332 return pg_query.BoolTestType_IS_FALSE, true
333 case "!=", "<>":
334 if value {
335 return pg_query.BoolTestType_IS_FALSE, true
336 }
337 return pg_query.BoolTestType_IS_TRUE, true
338 default:
339 return pg_query.BoolTestType_BOOL_TEST_TYPE_UNDEFINED, false
340 }
341}
342
343func booleanTestNode(expr *pg_query.Node, boolTestType pg_query.BoolTestType, location int32) *pg_query.Node {
344 return &pg_query.Node{

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected