/
githubmirror
/
sqlc
Обзор
Документация
Войти
/
githubmirror
/
sqlc
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
internal/sql/ast/column_ref.go
38 строк
611 B
Kyle Gray
refactor(ast): rename Formatter interface to Dialect (#4208)
01 дек 2025, 04:49
Не верифицирован
01 дек 2025, 04:49
ebd32cf
Код
Авторство
О чём код?
package ast import ( "strings" "github.com/sqlc-dev/sqlc/internal/sql/format" ) type ColumnRef struct { Name string // From pg.ColumnRef Fields *List Location int } func (n *ColumnRef) Pos() int { return n.Location } func (n *ColumnRef) Format(buf *TrackedBuffer, d format.Dialect) { if n == nil { return } if n.Fields != nil { var items []string for _, item := range n.Fields.Items { switch nn := item.(type) { case *String: items = append(items, d.QuoteIdent(nn.Str)) case *A_Star: items = append(items, "*") } } buf.WriteString(strings.Join(items, ".")) } }