Add support for Update statements.

This commit is contained in:
zer0sub 2019-04-14 17:55:10 +02:00
parent b287521f1a
commit 70d6f84375
12 changed files with 422 additions and 286 deletions

View file

@ -24,7 +24,7 @@ func TestInsertValues(t *testing.T) {
fmt.Println(insertQueryStr)
assert.Equal(t, insertQueryStr, `INSERT INTO test_sample.link (url,name,rel) VALUES ('http://www.postgresqltutorial.com','PostgreSQL Tutorial',DEFAULT), ('http://www.google.com','Google',DEFAULT), ('http://www.yahoo.com','Yahoo',DEFAULT), ('http://www.bing.com','Bing',DEFAULT) RETURNING link.id;`)
assert.Equal(t, insertQueryStr, `INSERT INTO test_sample.link (url,name,rel) VALUES ('http://www.postgresqltutorial.com','PostgreSQL Tutorial',DEFAULT), ('http://www.google.com','Google',DEFAULT), ('http://www.yahoo.com','Yahoo',DEFAULT), ('http://www.bing.com','Bing',DEFAULT) RETURNING link.id AS "link.id";`)
res, err := insertQuery.Execute(db)
assert.NilError(t, err)