Package structure refactor.
This commit is contained in:
parent
3d8e872336
commit
23fd973699
125 changed files with 2401 additions and 1818 deletions
|
|
@ -1,35 +0,0 @@
|
|||
package jet
|
||||
|
||||
import "errors"
|
||||
|
||||
// OrderByClause
|
||||
type orderByClause interface {
|
||||
serializeForOrderBy(statement statementType, out *sqlBuilder) error
|
||||
}
|
||||
|
||||
type orderByClauseImpl struct {
|
||||
expression Expression
|
||||
ascent bool
|
||||
}
|
||||
|
||||
func (o *orderByClauseImpl) serializeForOrderBy(statement statementType, out *sqlBuilder) error {
|
||||
if o.expression == nil {
|
||||
return errors.New("jet: nil orderBy by clause")
|
||||
}
|
||||
|
||||
if err := o.expression.serializeForOrderBy(statement, out); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if o.ascent {
|
||||
out.writeString("ASC")
|
||||
} else {
|
||||
out.writeString("DESC")
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func newOrderByClause(expression Expression, ascent bool) orderByClause {
|
||||
return &orderByClauseImpl{expression: expression, ascent: ascent}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue