Rollback some of the deleted postgres unsigned integer constructors.
This commit is contained in:
parent
f8f2f75a0d
commit
cf0923fdd3
2 changed files with 30 additions and 0 deletions
|
|
@ -34,6 +34,21 @@ func Int64(value int64) IntegerExpression {
|
||||||
return CAST(jet.Int(value)).AS_BIGINT()
|
return CAST(jet.Int(value)).AS_BIGINT()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Uint8 is constructor for 8 bit unsigned integer expressions literals.
|
||||||
|
func Uint8(value uint8) IntegerExpression {
|
||||||
|
return CAST(jet.Uint8(value)).AS_SMALLINT()
|
||||||
|
}
|
||||||
|
|
||||||
|
// Uint16 is constructor for 16 bit unsigned integer expressions literals.
|
||||||
|
func Uint16(value uint16) IntegerExpression {
|
||||||
|
return CAST(jet.Uint16(value)).AS_INTEGER()
|
||||||
|
}
|
||||||
|
|
||||||
|
// Uint32 is constructor for 32 bit unsigned integer expressions literals.
|
||||||
|
func Uint32(value uint32) IntegerExpression {
|
||||||
|
return CAST(jet.Uint32(value)).AS_BIGINT()
|
||||||
|
}
|
||||||
|
|
||||||
// Float creates new float literal expression
|
// Float creates new float literal expression
|
||||||
var Float = jet.Float
|
var Float = jet.Float
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -34,6 +34,21 @@ func TestInt64(t *testing.T) {
|
||||||
assertSerialize(t, Int64(val), `$1::bigint`, val)
|
assertSerialize(t, Int64(val), `$1::bigint`, val)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestUint8(t *testing.T) {
|
||||||
|
val := uint8(math.MaxUint8)
|
||||||
|
assertSerialize(t, Uint8(val), `$1::smallint`, val)
|
||||||
|
}
|
||||||
|
|
||||||
|
func TestUint16(t *testing.T) {
|
||||||
|
val := uint16(math.MaxUint16)
|
||||||
|
assertSerialize(t, Uint16(val), `$1::integer`, val)
|
||||||
|
}
|
||||||
|
|
||||||
|
func TestUint32(t *testing.T) {
|
||||||
|
val := uint32(math.MaxUint32)
|
||||||
|
assertSerialize(t, Uint32(val), `$1::bigint`, val)
|
||||||
|
}
|
||||||
|
|
||||||
func TestFloat(t *testing.T) {
|
func TestFloat(t *testing.T) {
|
||||||
assertSerialize(t, Float(12.34), `$1`, float64(12.34))
|
assertSerialize(t, Float(12.34), `$1`, float64(12.34))
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue