go-sqlmock icon indicating copy to clipboard operation
go-sqlmock copied to clipboard

Sql mock driver for golang to test database interactions

Results 95 go-sqlmock issues
Sort by recently updated
recently updated
newest added
trafficstars

Added new "times" method which can set expectation to run same query multiple number of times. eg. ` mock.ExpectExec("DELETE FROM users"). WillReturnResult(NewResult(1, 1)).Times(3)` will expect same query 3 times

While strict mock is very valuable, it's also very restrictive in how we can use this library. strict mocks force all expectation to be met, and also that anything that...

Hi. I want to change return value (error) of some methods such as `(sql.DB).Query()` when they are called in tests. For example, some DBs return error when `(sql.DB).Query()` is called...

- Hello, when I exec one sql many times, I got the error: --- FAIL: TestMysqlProxy_getItemByID (0.00s) --- FAIL: TestMysqlProxy_getItemByID/getItemByID_OK (0.00s) main_test.go:49: err: all expectations were already fulfilled, call to...

Hello! I think it would be great to make a method Len() for sqlmock.Rows. It will be useful for cases, where we comparing length of resulting rows and mocked rows....

Hi, This is a small change, but it will send a PR. In the String function of expectations.go, there is a place where it initializes a variable called margs. I...

``` db, mock, err := sqlmock.New() is.NoErr(err) rowSet := sqlmock. NewRows([]string{"col1", "col2", "col3"}). AddRow("expected", "result", "set") mock.ExpectQuery(selectSQL). WithArgs("1"). WillReturnRows(rowSet). WillReturnError(errors.New("some error")) ``` I expected this to return my result set...

Hello there! I have rather question than an issue. I have code similar to this one: ```go func (a *Smt) Bar() (string, error) { f, err := a.foo(id) if err...

Hi Here is my contribution to your code, its working good on powersystems. Thanks for the code, its working good. ## What do these changes do? Added Architecture "ppc64le" ##...

Travis-ci: Disable version 1.2.x, 1.3.x, 1.4, 1.5.x, 1.6.x, 1.7.x, 1.8.x, 1.9.x, 1.10.x & 1.11.x Signed-off-by: Devendranath Thadi Added power support for the travis.yml file with ppc64le. This is part of...