(t *testing.T)
| 1458 | } |
| 1459 | |
| 1460 | func TestDelete(t *testing.T) { |
| 1461 | bt := WithTemplate(&testTemplate) |
| 1462 | assert := assert.New(t) |
| 1463 | |
| 1464 | assert.Equal( |
| 1465 | `DELETE FROM "artist" WHERE (name = $1)`, |
| 1466 | bt.DeleteFrom("artist").Where("name = ?", "Chavela Vargas").String(), |
| 1467 | ) |
| 1468 | |
| 1469 | assert.Equal( |
| 1470 | `DELETE FROM "artist" WHERE (name = $1) RETURNING 1`, |
| 1471 | bt.DeleteFrom("artist").Where("name = ?", "Chavela Vargas").Amend(func(query string) string { |
| 1472 | return fmt.Sprintf("%s RETURNING 1", query) |
| 1473 | }).String(), |
| 1474 | ) |
| 1475 | |
| 1476 | assert.Equal( |
| 1477 | `DELETE FROM "artist" WHERE (id > 5)`, |
| 1478 | bt.DeleteFrom("artist").Where("id > 5").String(), |
| 1479 | ) |
| 1480 | } |
| 1481 | |
| 1482 | func TestPaginate(t *testing.T) { |
| 1483 | b := &sqlBuilder{t: newTemplateWithUtils(&testTemplate)} |
nothing calls this directly
no test coverage detected