MCPcopy Index your code
hub / github.com/Masterminds/squirrel / Alias

Function Alias

expr.go:124–126  ·  view source on GitHub ↗

Alias allows to define alias for column in SelectBuilder. Useful when column is defined as complex expression like IF or CASE Ex: .Column(Alias(caseStmt, "case_column"))

(expr Sqlizer, alias string)

Source from the content-addressed store, hash-verified

122// Ex:
123// .Column(Alias(caseStmt, "case_column"))
124func Alias(expr Sqlizer, alias string) aliasExpr {
125 return aliasExpr{expr, alias}
126}
127
128func (e aliasExpr) ToSql() (sql string, args []interface{}, err error) {
129 sql, args, err = e.expr.ToSql()

Callers 5

FromSelectMethod · 0.85
TestSelectBuilderToSqlFunction · 0.85
TestCaseWithComplexValFunction · 0.85
TestMultipleCaseFunction · 0.85
FromSelectMethod · 0.85

Calls

no outgoing calls

Tested by 3

TestSelectBuilderToSqlFunction · 0.68
TestCaseWithComplexValFunction · 0.68
TestMultipleCaseFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…