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

@ -53,6 +53,7 @@ func TestBinaryBoolExpression(t *testing.T) {
assertClauseSerialize(t, boolExpression.OR(Int(4).EQ(Int(5))),
"(($1 = $2) OR ($3 = $4))", int64(2), int64(3), int64(4), int64(5))
}
func TestBoolLiteral(t *testing.T) {
assertClauseSerialize(t, Bool(true), "$1", true)
assertClauseSerialize(t, Bool(false), "$1", false)
@ -71,3 +72,8 @@ func TestExists(t *testing.T) {
WHERE table1.col1 = table2.col3
)`, int64(1))
}
func TestBoolExp(t *testing.T) {
assertClauseSerialize(t, BoolExp(String("true")), "$1", "true")
assertClauseSerialize(t, BoolExp(String("true")).IS_TRUE(), "$1 IS TRUE", "true")
}