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

Function AsDArray

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

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

(e Expr)

Source from the content-addressed store, hash-verified

4997// be used instead of direct type assertions wherever a *DArray wrapped by a
4998// *DOidWrapper is possible.
4999func AsDArray(e Expr) (*DArray, bool) {
5000 switch t := e.(type) {
5001 case *DArray:
5002 return t, true
5003 case *DOidWrapper:
5004 return AsDArray(t.Wrapped)
5005 }
5006 return nil, false
5007}
5008
5009// MustBeDArray attempts to retrieve a *DArray from an Expr, panicking if the
5010// assertion fails.

Callers 1

MustBeDArrayFunction · 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…