(t *testing.T)
| 249 | } |
| 250 | |
| 251 | func TestUpdate_SQL(t *testing.T) { |
| 252 | u := &Update{ |
| 253 | Table: TableReference{Name: "t"}, |
| 254 | Updates: []UpdateExpression{{Column: &Identifier{Name: "x"}, Value: &LiteralValue{Value: "1"}}}, |
| 255 | Where: &Identifier{Name: "true"}, |
| 256 | ReturningClause: []Expression{&Identifier{Name: "id"}}, |
| 257 | } |
| 258 | sql := u.SQL() |
| 259 | if !strings.Contains(sql, "RETURNING id") { |
| 260 | t.Errorf("got: %s", sql) |
| 261 | } |
| 262 | } |
| 263 | |
| 264 | func TestDelete_SQL(t *testing.T) { |
| 265 | d := &Delete{ |