Add ability to change alias of all projections in the ProjectionList.
Add ability to exclude list of columns from ProjectionList.
This commit is contained in:
parent
392ba63bc5
commit
5cbf4aac86
8 changed files with 377 additions and 31 deletions
|
|
@ -13,7 +13,12 @@ func newAlias(expression Expression, aliasName string) Projection {
|
|||
}
|
||||
|
||||
func (a *alias) fromImpl(subQuery SelectTable) Projection {
|
||||
column := NewColumnImpl(a.alias, "", nil)
|
||||
// if alias is in the form "table.column", we break it into two parts so that ProjectionList.As(newAlias) can
|
||||
// overwrite tableName with a new alias. This method is called only for exporting aliased custom columns.
|
||||
// Generated columns have default aliasing.
|
||||
tableName, columnName := extractTableAndColumnName(a.alias)
|
||||
|
||||
column := NewColumnImpl(columnName, tableName, nil)
|
||||
column.subQuery = subQuery
|
||||
|
||||
return &column
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue