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

Function ParseDBool

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

ParseDBool parses and returns the *DBool Datum value represented by the provided string, or an error if parsing is unsuccessful. See https://github.com/postgres/postgres/blob/90627cf98a8e7d0531789391fd798c9bfcc3bc1a/src/backend/utils/adt/bool.c#L36

(s string)

Source from the content-addressed store, hash-verified

352// string, or an error if parsing is unsuccessful.
353// See https://github.com/postgres/postgres/blob/90627cf98a8e7d0531789391fd798c9bfcc3bc1a/src/backend/utils/adt/bool.c#L36
354func ParseDBool(s string) (*DBool, error) {
355 v, err := ParseBool(s)
356 if err != nil {
357 return nil, err
358 }
359 if v {
360 return DBoolTrue, nil
361 }
362 return DBoolFalse, nil
363}
364
365// ParseDByte parses a string representation of hex encoded binary
366// data. It supports both the hex format, with "\x" followed by a

Callers 1

ParseAndRequireStringFunction · 0.85

Calls 1

ParseBoolFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…