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

Function GetBool

pkg/sql/sem/tree/datum.go:410–418  ·  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

408
409// GetBool gets DBool or an error (also treats NULL as false, not an error).
410func GetBool(d Datum) (DBool, error) {
411 if v, ok := d.(*DBool); ok {
412 return *v, nil
413 }
414 if d == DNull {
415 return DBool(false), nil
416 }
417 return false, errors.AssertionFailedf("cannot convert %s to type %s", d.ResolvedType().SQLStringForError(), types.Bool)
418}
419
420// ResolvedType implements the TypedExpr interface.
421func (*DBool) ResolvedType() *types.T {

Callers

nothing calls this directly

Calls 3

DBoolTypeAlias · 0.85
SQLStringForErrorMethod · 0.80
ResolvedTypeMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…