CAST refactor.
This commit is contained in:
parent
cd1d033ffb
commit
db43f471ec
11 changed files with 187 additions and 308 deletions
|
|
@ -25,60 +25,6 @@ func TestExpressionIS_NOT_DISTINCT_FROM(t *testing.T) {
|
|||
assertClauseSerialize(t, table2Col3.ADD(table2Col3).IS_NOT_DISTINCT_FROM(Int(23)), "((table2.col3 + table2.col3) IS NOT DISTINCT FROM $1)", int64(23))
|
||||
}
|
||||
|
||||
func TestExpressionCAST_TO_BOOL(t *testing.T) {
|
||||
assertClauseSerialize(t, table2Col3.TO_BOOL(), "table2.col3::boolean")
|
||||
assertClauseSerialize(t, table2Col3.ADD(table2Col3).TO_BOOL(), "(table2.col3 + table2.col3)::boolean")
|
||||
}
|
||||
|
||||
func TestExpressionCAST_TO_SMALLINT(t *testing.T) {
|
||||
assertClauseSerialize(t, table2Col3.TO_SMALLINT(), "table2.col3::smallint")
|
||||
}
|
||||
|
||||
func TestExpressionCAST_TO_INTEGER(t *testing.T) {
|
||||
assertClauseSerialize(t, table2Col3.TO_INTEGER(), "table2.col3::integer")
|
||||
}
|
||||
|
||||
func TestExpressionCAST_TO_BIGINT(t *testing.T) {
|
||||
assertClauseSerialize(t, table2Col3.TO_BIGINT(), "table2.col3::bigint")
|
||||
}
|
||||
|
||||
func TestExpressionCAST_TO_NUMERIC(t *testing.T) {
|
||||
assertClauseSerialize(t, table2Col3.TO_NUMERIC(11, 11), "table2.col3::numeric(11, 11)")
|
||||
assertClauseSerialize(t, table2Col3.TO_NUMERIC(11), "table2.col3::numeric(11)")
|
||||
}
|
||||
|
||||
func TestExpressionCAST_TO_REAL(t *testing.T) {
|
||||
assertClauseSerialize(t, table2Col3.TO_REAL(), "table2.col3::real")
|
||||
}
|
||||
|
||||
func TestExpressionCAST_TO_DOUBLE(t *testing.T) {
|
||||
assertClauseSerialize(t, table2Col3.TO_DOUBLE(), "table2.col3::double precision")
|
||||
}
|
||||
|
||||
func TestExpressionCAST_TO_TEXT(t *testing.T) {
|
||||
assertClauseSerialize(t, table2Col3.TO_TEXT(), "table2.col3::text")
|
||||
}
|
||||
|
||||
func TestExpressionCAST_TO_DATE(t *testing.T) {
|
||||
assertClauseSerialize(t, table2Col3.TO_DATE(), "table2.col3::date")
|
||||
}
|
||||
|
||||
func TestExpressionCAST_TO_TIME(t *testing.T) {
|
||||
assertClauseSerialize(t, table2Col3.TO_TIME(), "table2.col3::time without time zone")
|
||||
}
|
||||
|
||||
func TestExpressionCAST_TO_TIMEZ(t *testing.T) {
|
||||
assertClauseSerialize(t, table2Col3.TO_TIMEZ(), "table2.col3::time with time zone")
|
||||
}
|
||||
|
||||
func TestExpressionCAST_TO_TIMESTAMP(t *testing.T) {
|
||||
assertClauseSerialize(t, table2Col3.TO_TIMESTAMP(), "table2.col3::timestamp without time zone")
|
||||
}
|
||||
|
||||
func TestExpressionCAST_TO_TIMESTAMPZ(t *testing.T) {
|
||||
assertClauseSerialize(t, table2Col3.TO_TIMESTAMPZ(), "table2.col3::timestamp with time zone")
|
||||
}
|
||||
|
||||
func TestIN(t *testing.T) {
|
||||
|
||||
assertClauseSerialize(t, Float(1.11).IN(table1.SELECT(table1Col1)),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue