go-sqlmock
go-sqlmock copied to clipboard
Sql mock driver for golang to test database interactions
### Operating system and Go Version linux, 1.18.4 ### Issue In 2018 this bug already appeared and was fixed in https://github.com/DATA-DOG/go-sqlmock/issues/140 v2 branch only, but last commit of v2 was...
### Operating system and Go Version Linux ### Issue Unchecked type assertion , as per report by synopsys's coverity scan run ### Reproduction steps #### Expected Result #### Actual Result
### Operating system and Go Version Linux ### Issue As part of SAST tool run Coverity scam, we could see the code in the mentioned file could land up in...
This PR changes the behavior in the expectation matching. Previously if no query arg was expected but one was actually passed during query execution the expectations were still met. (Example...
mycode ``` m.ExpectQuery("select name from t").WithArgs(1, 2) db.QueryRow("select name from t where id in ? limit 1", []int{1, 2}) if err := m.ExpectationsWereMet(); err != nil { t.Errorf("there were unfulfilled...
` type Temp struct { SourceType string `json:"SourceKind"` } ` when i mock like this: ` mockRows := sqlmock.NewRows([]string{"source_kind"}) ` it's unusefule, bug when i mock like this: ` mockRows...
Hello sqlmock teams. First of all, thanks to this awesome project. It makes me more easier to implement test code with sql system 👍 But I got an `arguments do...
### Issue Query is created dynamically in the code. Sometimes it will expect an arg and sometimes it won't. I expected that the mock would raise an error if the...
### Request Hello! I'm currently working on a project using GORM for database interaction and have been having difficulty finding any examples for go-sqlmock that involve using the `Preload` method...
hey All mock.ExpectExec("SELECT * FROM permission WHERE roleid = $1").WithArgs(2) this is my mock queey i just compare that one with the original query which one is db.Get(&programinfo, "SELECT *...