Add statements debug sql support.
This commit is contained in:
parent
439c9f1ef9
commit
240ddd65e6
27 changed files with 1013 additions and 426 deletions
|
|
@ -1,6 +1,7 @@
|
|||
package sqlbuilder
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"gotest.tools/assert"
|
||||
"testing"
|
||||
)
|
||||
|
|
@ -14,5 +15,10 @@ func TestDeleteWithWhere(t *testing.T) {
|
|||
sql, _, err := table1.DELETE().WHERE(table1Col1.EqL(1)).Sql()
|
||||
assert.NilError(t, err)
|
||||
|
||||
assert.Equal(t, sql, "DELETE FROM db.table1 WHERE table1.col1 = $1;")
|
||||
fmt.Println(sql)
|
||||
expectedSql := `
|
||||
DELETE FROM db.table1
|
||||
WHERE table1.col1 = $1;
|
||||
`
|
||||
assert.Equal(t, sql, expectedSql)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue