/
githubmirror
/
pop
Обзор
Документация
Войти
/
githubmirror
/
pop
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
columns/column.go
28 строк
684 B
Stanislas Michalak
Quote identifiers (#383)
15 авг 2019, 14:59
Не верифицирован
15 авг 2019, 14:59
79000c1
Код
Авторство
О чём код?
package columns import "fmt" // Column represents a SQL table column. type Column struct { Name string Writeable bool Readable bool SelectSQL string } // UpdateString returns the SQL statement to UPDATE the column. func (c Column) UpdateString() string { return fmt.Sprintf("%s = :%s", c.Name, c.Name) } // QuotedUpdateString returns quoted the SQL statement to UPDATE the column. func (c Column) QuotedUpdateString(quoter quoter) string { return fmt.Sprintf("%s = :%s", quoter.Quote(c.Name), c.Name) } // SetSelectSQL sets a custom SELECT statement for the column. func (c *Column) SetSelectSQL(s string) { c.SelectSQL = s c.Writeable = false c.Readable = true }