Explicit sqlbuilder cast.

This commit is contained in:
zer0sub 2019-06-07 14:23:14 +02:00
parent 4d7fbf8f49
commit 3c5553b3dc
21 changed files with 293 additions and 104 deletions

View file

@ -39,8 +39,8 @@ type integerCast struct {
cast
}
func newIntegerCast(expression Expression) IntegerExpression {
integerCast := &integerCast{cast: *newCast(expression, "integer")}
func newIntegerCast(expression Expression, intType string) IntegerExpression {
integerCast := &integerCast{cast: *newCast(expression, intType)}
integerCast.integerInterfaceImpl.parent = integerCast
integerCast.expressionInterfaceImpl.parent = integerCast
@ -54,8 +54,8 @@ type floatCast struct {
cast
}
func newDoubleCast(expression Expression) FloatExpression {
floatCast := &floatCast{cast: *newCast(expression, "double precision")}
func newFloatCast(expression Expression, floatType string) FloatExpression {
floatCast := &floatCast{cast: *newCast(expression, floatType)}
floatCast.floatInterfaceImpl.parent = floatCast
floatCast.expressionInterfaceImpl.parent = floatCast