Package structure refactor.

This commit is contained in:
go-jet 2019-08-03 14:10:47 +02:00
parent 3d8e872336
commit 23fd973699
125 changed files with 2401 additions and 1818 deletions

View file

@ -0,0 +1,33 @@
package jet
type Projection interface {
serializeForProjection(statement StatementType, out *SqlBuilder) error
fromImpl(subQuery SelectTable) Projection
}
func SerializeForProjection(projection Projection, statementType StatementType, out *SqlBuilder) error {
return projection.serializeForProjection(statementType, out)
}
// ProjectionList is a redefined type, so that ProjectionList can be used as a Projection.
type ProjectionList []Projection
func (cl ProjectionList) fromImpl(subQuery SelectTable) Projection {
newProjectionList := ProjectionList{}
for _, projection := range cl {
newProjectionList = append(newProjectionList, projection.fromImpl(subQuery))
}
return newProjectionList
}
func (cl ProjectionList) serializeForProjection(statement StatementType, out *SqlBuilder) error {
err := SerializeProjectionList(statement, cl, out)
if err != nil {
return err
}
return nil
}