MySQL refactor.
This commit is contained in:
parent
8519ccbdd0
commit
4fbf576370
36 changed files with 1080 additions and 270 deletions
17
mysql/delete_statement_test.go
Normal file
17
mysql/delete_statement_test.go
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
package mysql
|
||||
|
||||
import (
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestDeleteUnconditionally(t *testing.T) {
|
||||
assertStatementErr(t, table1.DELETE(), `jet: WHERE clause not set`)
|
||||
assertStatementErr(t, table1.DELETE().WHERE(nil), `jet: WHERE clause not set`)
|
||||
}
|
||||
|
||||
func TestDeleteWithWhere(t *testing.T) {
|
||||
assertStatement(t, table1.DELETE().WHERE(table1Col1.EQ(Int(1))), `
|
||||
DELETE FROM db.table1
|
||||
WHERE table1.col1 = ?;
|
||||
`, int64(1))
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue