Fix ident
This commit is contained in:
parent
34f84c7170
commit
8eed0e209a
4 changed files with 44 additions and 36 deletions
|
|
@ -102,10 +102,11 @@ func TestDeleteWithUsing(t *testing.T) {
|
|||
table.Rental.
|
||||
INNER_JOIN(table.Staff, table.Rental.StaffID.EQ(table.Staff.StaffID)),
|
||||
table.Actor,
|
||||
).WHERE(
|
||||
table.Staff.StaffID.EQ(Int(2)).
|
||||
AND(table.Rental.RentalID.LT(Int(10))),
|
||||
)
|
||||
).
|
||||
WHERE(
|
||||
table.Staff.StaffID.EQ(Int(2)).
|
||||
AND(table.Rental.RentalID.LT(Int(10))),
|
||||
)
|
||||
|
||||
testutils.AssertStatementSql(t, stmt, `
|
||||
DELETE FROM dvds.rental
|
||||
|
|
@ -115,6 +116,5 @@ USING dvds.rental
|
|||
WHERE (staff.staff_id = ?) AND (rental.rental_id < ?);
|
||||
`)
|
||||
|
||||
_, err := stmt.Exec(tx)
|
||||
require.NoError(t, err)
|
||||
testutils.AssertExec(t, stmt, db, 3)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -122,14 +122,16 @@ func TestDeleteFrom(t *testing.T) {
|
|||
table.Staff.
|
||||
INNER_JOIN(table.Store, table.Store.StoreID.EQ(table.Staff.StaffID)),
|
||||
table.Actor,
|
||||
).WHERE(
|
||||
table.Staff.StaffID.EQ(table.Rental.StaffID).
|
||||
AND(table.Staff.StaffID.EQ(Int(2))).
|
||||
AND(table.Rental.RentalID.LT(Int(10))),
|
||||
).RETURNING(
|
||||
table.Rental.AllColumns,
|
||||
table.Store.AllColumns,
|
||||
)
|
||||
).
|
||||
WHERE(
|
||||
table.Staff.StaffID.EQ(table.Rental.StaffID).
|
||||
AND(table.Staff.StaffID.EQ(Int(2))).
|
||||
AND(table.Rental.RentalID.LT(Int(10))),
|
||||
).
|
||||
RETURNING(
|
||||
table.Rental.AllColumns,
|
||||
table.Store.AllColumns,
|
||||
)
|
||||
|
||||
testutils.AssertStatementSql(t, stmt, `
|
||||
DELETE FROM dvds.rental
|
||||
|
|
|
|||
|
|
@ -382,18 +382,21 @@ func TestUpdateFrom(t *testing.T) {
|
|||
stmt := table.Rental.UPDATE().
|
||||
SET(
|
||||
table.Rental.RentalDate.SET(Timestamp(2020, 2, 2, 0, 0, 0)),
|
||||
).FROM(
|
||||
table.Staff.
|
||||
INNER_JOIN(table.Store, table.Store.StoreID.EQ(table.Staff.StaffID)),
|
||||
table.Actor,
|
||||
).WHERE(
|
||||
table.Staff.StaffID.EQ(table.Rental.StaffID).
|
||||
AND(table.Staff.StaffID.EQ(Int(2))).
|
||||
AND(table.Rental.RentalID.LT(Int(10))),
|
||||
).RETURNING(
|
||||
table.Rental.AllColumns.Except(table.Rental.LastUpdate),
|
||||
table.Store.AllColumns.Except(table.Store.LastUpdate),
|
||||
)
|
||||
).
|
||||
FROM(
|
||||
table.Staff.
|
||||
INNER_JOIN(table.Store, table.Store.StoreID.EQ(table.Staff.StaffID)),
|
||||
table.Actor,
|
||||
).
|
||||
WHERE(
|
||||
table.Staff.StaffID.EQ(table.Rental.StaffID).
|
||||
AND(table.Staff.StaffID.EQ(Int(2))).
|
||||
AND(table.Rental.RentalID.LT(Int(10))),
|
||||
).
|
||||
RETURNING(
|
||||
table.Rental.AllColumns.Except(table.Rental.LastUpdate),
|
||||
table.Store.AllColumns.Except(table.Store.LastUpdate),
|
||||
)
|
||||
|
||||
testutils.AssertStatementSql(t, stmt, `
|
||||
UPDATE dvds.rental
|
||||
|
|
|
|||
|
|
@ -298,16 +298,19 @@ func TestUpdateFrom(t *testing.T) {
|
|||
stmt := table.Rental.UPDATE().
|
||||
SET(
|
||||
table.Rental.RentalDate.SET(DateTime(2020, 2, 2, 0, 0, 0)),
|
||||
).FROM(
|
||||
table.Staff.
|
||||
INNER_JOIN(table.Store, table.Store.StoreID.EQ(table.Staff.StaffID)),
|
||||
).WHERE(
|
||||
table.Staff.StaffID.EQ(table.Rental.StaffID).
|
||||
AND(table.Staff.StaffID.EQ(Int(2))).
|
||||
AND(table.Rental.RentalID.LT(Int(10))),
|
||||
).RETURNING(
|
||||
table.Rental.AllColumns.Except(table.Rental.LastUpdate),
|
||||
)
|
||||
).
|
||||
FROM(
|
||||
table.Staff.
|
||||
INNER_JOIN(table.Store, table.Store.StoreID.EQ(table.Staff.StaffID)),
|
||||
).
|
||||
WHERE(
|
||||
table.Staff.StaffID.EQ(table.Rental.StaffID).
|
||||
AND(table.Staff.StaffID.EQ(Int(2))).
|
||||
AND(table.Rental.RentalID.LT(Int(10))),
|
||||
).
|
||||
RETURNING(
|
||||
table.Rental.AllColumns.Except(table.Rental.LastUpdate),
|
||||
)
|
||||
|
||||
testutils.AssertDebugStatementSql(t, stmt, `
|
||||
UPDATE rental
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue