MCPcopy Create free account
hub / github.com/auxten/postgresql-parser / GetBool

Function GetBool

pkg/sql/sem/tree/datum.go:361–369  ·  view source on GitHub ↗

GetBool gets DBool or an error (also treats NULL as false, not an error).

(d Datum)

Source from the content-addressed store, hash-verified

359
360// GetBool gets DBool or an error (also treats NULL as false, not an error).
361func GetBool(d Datum) (DBool, error) {
362 if v, ok := d.(*DBool); ok {
363 return *v, nil
364 }
365 if d == DNull {
366 return DBool(false), nil
367 }
368 return false, errors.AssertionFailedf("cannot convert %s to type %s", d.ResolvedType(), types.Bool)
369}
370
371// ResolvedType implements the TypedExpr interface.
372func (*DBool) ResolvedType() *types.T {

Callers 7

normalizeMethod · 0.85
normalizeMethod · 0.85
normalizeMethod · 0.85
EvalMethod · 0.85
EvalMethod · 0.85
EvalMethod · 0.85
EvalMethod · 0.85

Calls 2

DBoolTypeAlias · 0.85
ResolvedTypeMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…