2019-06-21 13:56:57 +02:00
|
|
|
package jet
|
2019-04-03 11:03:07 +02:00
|
|
|
|
2019-05-07 19:06:21 +02:00
|
|
|
type projection interface {
|
2019-05-08 13:47:01 +02:00
|
|
|
serializeForProjection(statement statementType, out *queryData) error
|
2019-06-18 14:35:32 +02:00
|
|
|
from(subQuery ExpressionTable) projection
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//------------------------------------------------------//
|
|
|
|
|
// Dummy type for projection list
|
|
|
|
|
type ProjectionList []projection
|
|
|
|
|
|
|
|
|
|
func (cl ProjectionList) from(subQuery ExpressionTable) projection {
|
|
|
|
|
newProjectionList := ProjectionList{}
|
|
|
|
|
|
|
|
|
|
for _, projection := range cl {
|
|
|
|
|
newProjectionList = append(newProjectionList, projection.from(subQuery))
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return newProjectionList
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (cl ProjectionList) serializeForProjection(statement statementType, out *queryData) error {
|
|
|
|
|
err := serializeProjectionList(statement, cl, out)
|
|
|
|
|
|
|
|
|
|
if err != nil {
|
|
|
|
|
return err
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return nil
|
2019-04-03 11:03:07 +02:00
|
|
|
}
|