jet/projection.go

30 lines
725 B
Go
Raw Normal View History

2019-06-21 13:56:57 +02:00
package jet
2019-05-07 19:06:21 +02:00
type projection interface {
2019-07-08 10:48:03 +02:00
serializeForProjection(statement statementType, out *sqlBuilder) error
2019-07-18 17:43:11 +02:00
from(subQuery SelectTable) projection
}
2019-07-18 17:43:11 +02:00
// ProjectionList is a redefined type, so that ProjectionList can be used as a projection.
type ProjectionList []projection
2019-07-18 17:43:11 +02:00
func (cl ProjectionList) from(subQuery SelectTable) projection {
newProjectionList := ProjectionList{}
for _, projection := range cl {
newProjectionList = append(newProjectionList, projection.from(subQuery))
}
return newProjectionList
}
2019-07-08 10:48:03 +02:00
func (cl ProjectionList) serializeForProjection(statement statementType, out *sqlBuilder) error {
err := serializeProjectionList(statement, cl, out)
if err != nil {
return err
}
return nil
}