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

Function AsDInt

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

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

(e Expr)

Source from the content-addressed store, hash-verified

625// be used instead of direct type assertions wherever a *DInt wrapped by a
626// *DOidWrapper is possible.
627func AsDInt(e Expr) (DInt, bool) {
628 switch t := e.(type) {
629 case *DInt:
630 return *t, true
631 case *DOidWrapper:
632 return AsDInt(t.Wrapped)
633 }
634 return 0, false
635}
636
637// MustBeDInt attempts to retrieve a DInt from an Expr, panicking if the
638// assertion fails.

Callers 1

MustBeDIntFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…