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

Function NewTypedColumnAccessExpr

postgres/parser/sem/tree/expr.go:1684–1692  ·  view source on GitHub ↗

NewTypedColumnAccessExpr creates a pre-typed ColumnAccessExpr. A by-index ColumnAccessExpr can be specified by passing an empty string as colName.

(expr TypedExpr, colName string, colIdx int)

Source from the content-addressed store, hash-verified

1682// NewTypedColumnAccessExpr creates a pre-typed ColumnAccessExpr.
1683// A by-index ColumnAccessExpr can be specified by passing an empty string as colName.
1684func NewTypedColumnAccessExpr(expr TypedExpr, colName string, colIdx int) *ColumnAccessExpr {
1685 return &ColumnAccessExpr{
1686 Expr: expr,
1687 ColName: colName,
1688 ByIndex: colName == "",
1689 ColIndex: colIdx,
1690 typeAnnotation: typeAnnotation{typ: expr.ResolvedType().TupleContents()[colIdx]},
1691 }
1692}
1693
1694// Format implements the NodeFormatter interface.
1695func (node *ColumnAccessExpr) Format(ctx *FmtCtx) {

Callers

nothing calls this directly

Calls 2

TupleContentsMethod · 0.80
ResolvedTypeMethod · 0.65

Tested by

no test coverage detected