Add support for exporting a ColumnList from a subquery.
This commit is contained in:
parent
13ad686ac4
commit
85ea908285
3 changed files with 124 additions and 7 deletions
|
|
@ -51,6 +51,18 @@ func (cl ColumnList) As(tableAlias string) ProjectionList {
|
|||
return ret
|
||||
}
|
||||
|
||||
// From creates a new ColumnList that references the specified subquery.
|
||||
// This method is typically used to project columns from a subquery into the surrounding query.
|
||||
func (cl ColumnList) From(subQuery SelectTable) ColumnList {
|
||||
var ret ColumnList
|
||||
|
||||
for _, column := range cl {
|
||||
ret = append(ret, column.fromImpl(subQuery).(ColumnExpression))
|
||||
}
|
||||
|
||||
return ret
|
||||
}
|
||||
|
||||
func (cl ColumnList) fromImpl(subQuery SelectTable) Projection {
|
||||
newProjectionList := ProjectionList{}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue