/
githubmirror
/
pop
Обзор
Документация
Войти
/
githubmirror
/
pop
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
columns/writeable_columns.go
31 строка
711 B
Stanislas Michalak
Quote identifiers (#383)
15 авг 2019, 14:59
Не верифицирован
15 авг 2019, 14:59
79000c1
Код
Авторство
О чём код?
package columns import ( "sort" "strings" ) // WriteableColumns represents a list of columns Pop is allowed to write. type WriteableColumns struct { Columns } // UpdateString returns the SQL column list part of the UPDATE query. func (c WriteableColumns) UpdateString() string { var xs []string for _, t := range c.Cols { xs = append(xs, t.UpdateString()) } sort.Strings(xs) return strings.Join(xs, ", ") } // QuotedUpdateString returns the quoted SQL column list part of the UPDATE query. func (c Columns) QuotedUpdateString(quoter quoter) string { var xs []string for _, t := range c.Cols { xs = append(xs, t.QuotedUpdateString(quoter)) } sort.Strings(xs) return strings.Join(xs, ", ") }