Skip to content

Commit

Permalink
chore(redshift-data): assert that rows affected are available after c…
Browse files Browse the repository at this point in the history
…ommit (#141)

# Description

Extending existing test case 

## Security

- [x] The code changed/added as part of this pull request won't create
any security issues with how the software is being used.
  • Loading branch information
atzoum authored Jul 22, 2024
1 parent e299e2f commit 6b64477
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions sqlconnect/internal/redshift/driver/driver_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,10 @@ func TestRedshiftDriver(t *testing.T) {
err = tx.Commit()
require.NoError(t, err, "it should be able to commit the transaction")

rowsAffected, err := res.RowsAffected()
require.NoError(t, err, "it should be able to get rows affected after commit")
require.EqualValues(t, 1, rowsAffected, "rows affected should be 1")

var countAfter int
err = db.QueryRowContext(ctx, fmt.Sprintf(`SELECT COUNT(*) FROM "%s"."test_table"`, schema)).Scan(&countAfter)
require.NoError(t, err, "it should be able to execute a prepared statement")
Expand Down

0 comments on commit 6b64477

Please sign in to comment.