This commit is contained in:
Dan Sosedoff 2022-12-05 21:01:08 -06:00
parent 450badfbbb
commit e3d69d3cfa
No known key found for this signature in database
GPG Key ID: 26186197D282B164

View File

@ -361,6 +361,7 @@ func testUpdateQuery(t *testing.T) {
t.Run("updating data", func(t *testing.T) {
// Add new row
_, err := testClient.db.Exec("INSERT INTO books (id, title) VALUES (8888, 'Test Book'), (8889, 'Test Book 2')")
assert.NoError(t, err)
// Update without return values
res, err := testClient.Query("UPDATE books SET title = 'Foo' WHERE id >= 8888 AND id <= 8889")
@ -379,6 +380,7 @@ func testUpdateQuery(t *testing.T) {
t.Run("deleting data", func(t *testing.T) {
// Add new row
_, err := testClient.db.Exec("INSERT INTO books (id, title) VALUES (9999, 'Test Book')")
assert.NoError(t, err)
// Delete the existing row
res, err := testClient.Query("DELETE FROM books WHERE id = 9999")