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

Function NewTypedColumnAccessExpr

pkg/sql/sem/tree/expr.go:1719–1727  ·  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

1717// NewTypedColumnAccessExpr creates a pre-typed ColumnAccessExpr.
1718// A by-index ColumnAccessExpr can be specified by passing an empty string as colName.
1719func NewTypedColumnAccessExpr(expr TypedExpr, colName string, colIdx int) *ColumnAccessExpr {
1720 return &ColumnAccessExpr{
1721 Expr: expr,
1722 ColName: colName,
1723 ByIndex: colName == "",
1724 ColIndex: colIdx,
1725 typeAnnotation: typeAnnotation{typ: &expr.ResolvedType().TupleContents()[colIdx]},
1726 }
1727}
1728
1729// Format implements the NodeFormatter interface.
1730func (node *ColumnAccessExpr) Format(ctx *FmtCtx) {

Callers

nothing calls this directly

Calls 2

TupleContentsMethod · 0.80
ResolvedTypeMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…