Improve serialization error handling.
This commit is contained in:
parent
1fd63b8783
commit
5ed7cf2b1c
8 changed files with 81 additions and 39 deletions
|
|
@ -29,6 +29,10 @@ func newFunc(name string, expressions []expression, parent expression) *funcExpr
|
|||
}
|
||||
|
||||
func (f *funcExpressionImpl) serialize(statement statementType, out *queryData) error {
|
||||
if f == nil {
|
||||
return errors.New("Function expression is nil. ")
|
||||
}
|
||||
|
||||
out.writeString(f.name + "(")
|
||||
|
||||
err := serializeExpressionList(statement, f.expression, ", ", out)
|
||||
|
|
@ -108,6 +112,10 @@ func (c *caseExpression) ELSE(els expression) caseInterface {
|
|||
}
|
||||
|
||||
func (c *caseExpression) serialize(statement statementType, out *queryData) error {
|
||||
if c == nil {
|
||||
return errors.New("Case expression is nil. ")
|
||||
}
|
||||
|
||||
out.writeString("(CASE")
|
||||
|
||||
if c.expression != nil {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue