MCPcopy
hub / github.com/Masterminds/squirrel / Column

Method Column

select.go:276–278  ·  view source on GitHub ↗

Column adds a result column to the query. Unlike Columns, Column accepts args which will be bound to placeholders in the columns string, for example: Column("IF(col IN ("+squirrel.Placeholders(3)+"), 1, 0) as col", 1, 2, 3)

(column interface{}, args ...interface{})

Source from the content-addressed store, hash-verified

274// the columns string, for example:
275// Column("IF(col IN ("+squirrel.Placeholders(3)+"), 1, 0) as col", 1, 2, 3)
276func (b SelectBuilder) Column(column interface{}, args ...interface{}) SelectBuilder {
277 return builder.Append(b, "Columns", newPart(column, args...)).(SelectBuilder)
278}
279
280// From sets the FROM clause of the query.
281func (b SelectBuilder) From(from string) SelectBuilder {

Callers 7

TestSelectBuilderToSqlFunction · 0.80
TestCaseWithValFunction · 0.80
TestCaseWithComplexValFunction · 0.80
TestCaseWithNoValFunction · 0.80
TestCaseWithExprFunction · 0.80
TestMultipleCaseFunction · 0.80
TestCaseWithNoWhenClauseFunction · 0.80

Calls 1

newPartFunction · 0.85

Tested by 7

TestSelectBuilderToSqlFunction · 0.64
TestCaseWithValFunction · 0.64
TestCaseWithComplexValFunction · 0.64
TestCaseWithNoValFunction · 0.64
TestCaseWithExprFunction · 0.64
TestMultipleCaseFunction · 0.64
TestCaseWithNoWhenClauseFunction · 0.64