MCPcopy Create free account
hub / github.com/go-pg/pg / Column

Method Column

orm/query.go:328–340  ·  view source on GitHub ↗

Column adds a column to the Query quoting it according to PostgreSQL rules. Does not expand params like ?TableAlias etc. ColumnExpr can be used to bypass quoting restriction or for params expansion. Column name can be: - column_name, - table_alias.column_name, - table_alias.*.

(columns ...string)

Source from the content-addressed store, hash-verified

326// - table_alias.column_name,
327// - table_alias.*.
328func (q *Query) Column(columns ...string) *Query {
329 for _, column := range columns {
330 if column == "_" {
331 if q.columns == nil {
332 q.columns = make([]QueryAppender, 0)
333 }
334 continue
335 }
336
337 q.columns = append(q.columns, fieldAppender{column})
338 }
339 return q
340}
341
342// ColumnExpr adds column expression to the Query.
343func (q *Query) ColumnExpr(expr string, params ...interface{}) *Query {

Calls

no outgoing calls