MCPcopy Create free account
hub / github.com/dolthub/doltgresql / AsDArray

Function AsDArray

postgres/parser/sem/tree/datum.go:1632–1640  ·  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

1630// be used instead of direct type assertions wherever a *DArray wrapped by a
1631// *DOidWrapper is possible.
1632func AsDArray(e Expr) (*DArray, bool) {
1633 switch t := e.(type) {
1634 case *DArray:
1635 return t, true
1636 case *DOidWrapper:
1637 return AsDArray(t.Wrapped)
1638 }
1639 return nil, false
1640}
1641
1642// MustBeDArray attempts to retrieve a *DArray from an Expr, panicking if the
1643// assertion fails.

Callers 1

MustBeDArrayFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected