Add DECIMAL constructor for Float literal.
DECIMAL constructor is used to pass a decimal number to the SQL query without precision loss.
This commit is contained in:
parent
08cc316101
commit
92d02fef78
3 changed files with 18 additions and 2 deletions
|
|
@ -140,7 +140,7 @@ type floatLiteral struct {
|
|||
literalExpressionImpl
|
||||
}
|
||||
|
||||
// Float creates new float literal
|
||||
// Float creates new float literal from float64 value
|
||||
func Float(value float64) FloatExpression {
|
||||
floatLiteral := floatLiteral{}
|
||||
floatLiteral.literalExpressionImpl = *literal(value)
|
||||
|
|
@ -150,6 +150,16 @@ func Float(value float64) FloatExpression {
|
|||
return &floatLiteral
|
||||
}
|
||||
|
||||
// Decimal creates new float literal from string value
|
||||
func Decimal(value string) FloatExpression {
|
||||
floatLiteral := floatLiteral{}
|
||||
floatLiteral.literalExpressionImpl = *literal(value)
|
||||
|
||||
floatLiteral.floatInterfaceImpl.parent = &floatLiteral
|
||||
|
||||
return &floatLiteral
|
||||
}
|
||||
|
||||
//---------------------------------------------------//
|
||||
type stringLiteral struct {
|
||||
stringInterfaceImpl
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue