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

Function AsDArray

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

3312// be used instead of direct type assertions wherever a *DArray wrapped by a
3313// *DOidWrapper is possible.
3314func AsDArray(e Expr) (*DArray, bool) {
3315 switch t := e.(type) {
3316 case *DArray:
3317 return t, true
3318 case *DOidWrapper:
3319 return AsDArray(t.Wrapped)
3320 }
3321 return nil, false
3322}
3323
3324// MustBeDArray attempts to retrieve a *DArray from an Expr, panicking if the
3325// assertion fails.

Callers 2

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