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

Function AsDOid

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

AsDOid attempts to retrieve a DOid from an Expr, returning a DOid and a flag signifying whether the assertion was successful. The function should be used instead of direct type assertions wherever a *DOid wrapped by a *DOidWrapper is possible.

(e Expr)

Source from the content-addressed store, hash-verified

3545// be used instead of direct type assertions wherever a *DOid wrapped by a
3546// *DOidWrapper is possible.
3547func AsDOid(e Expr) (*DOid, bool) {
3548 switch t := e.(type) {
3549 case *DOid:
3550 return t, true
3551 case *DOidWrapper:
3552 return AsDOid(t.Wrapped)
3553 }
3554 return NewDOid(0), false
3555}
3556
3557// MustBeDOid attempts to retrieve a DOid from an Expr, panicking if the
3558// assertion fails.

Callers 1

MustBeDOidFunction · 0.85

Calls 1

NewDOidFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…