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

Function MakeColumnItem

pkg/sql/sem/tree/var_name.go:175–191  ·  view source on GitHub ↗

MakeColumnItem constructs a column item from an already valid TableName. This can be used for e.g. pretty-printing.

(tn *TableName, colName Name)

Source from the content-addressed store, hash-verified

173// MakeColumnItem constructs a column item from an already valid
174// TableName. This can be used for e.g. pretty-printing.
175func MakeColumnItem(tn *TableName, colName Name) ColumnItem {
176 c := ColumnItem{ColumnName: colName}
177 if tn.Table() != "" {
178 numParts := 1
179 if tn.ExplicitCatalog {
180 numParts = 3
181 } else if tn.ExplicitSchema {
182 numParts = 2
183 }
184
185 c.TableName = &UnresolvedObjectName{
186 NumParts: numParts,
187 Parts: [3]string{tn.Table(), tn.Schema(), tn.Catalog()},
188 }
189 }
190 return c
191}

Callers 1

NewColumnItemFunction · 0.85

Calls 3

TableMethod · 0.80
SchemaMethod · 0.80
CatalogMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…