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)
| 326 | // - table_alias.column_name, |
| 327 | // - table_alias.*. |
| 328 | func (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. |
| 343 | func (q *Query) ColumnExpr(expr string, params ...interface{}) *Query { |
no outgoing calls