Package structure refactor.
This commit is contained in:
parent
3d8e872336
commit
23fd973699
125 changed files with 2401 additions and 1818 deletions
33
internal/jet/projection.go
Normal file
33
internal/jet/projection.go
Normal 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
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue