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

Function wrapBooleanTestWithNullCase

transpiler/transform/boolpredicates.go:355–382  ·  view source on GitHub ↗
(expr *pg_query.Node, boolTestType pg_query.BoolTestType, location int32)

Source from the content-addressed store, hash-verified

353}
354
355func wrapBooleanTestWithNullCase(expr *pg_query.Node, boolTestType pg_query.BoolTestType, location int32) *pg_query.Node {
356 return &pg_query.Node{
357 Node: &pg_query.Node_CaseExpr{
358 CaseExpr: &pg_query.CaseExpr{
359 Args: []*pg_query.Node{
360 {
361 Node: &pg_query.Node_CaseWhen{
362 CaseWhen: &pg_query.CaseWhen{
363 Expr: &pg_query.Node{
364 Node: &pg_query.Node_NullTest{
365 NullTest: &pg_query.NullTest{
366 Arg: expr,
367 Nulltesttype: pg_query.NullTestType_IS_NULL,
368 Location: location,
369 },
370 },
371 },
372 Result: nullConstNode(location),
373 },
374 },
375 },
376 },
377 Defresult: booleanTestNode(expr, boolTestType, location),
378 Location: location,
379 },
380 },
381 }
382}
383
384func nullConstNode(location int32) *pg_query.Node {
385 return &pg_query.Node{

Callers 1

Calls 2

nullConstNodeFunction · 0.85
booleanTestNodeFunction · 0.85

Tested by

no test coverage detected