go-sqlmock
go-sqlmock copied to clipboard
Sql mock driver for golang to test database interactions
just a test file
Hello, I think it would be great to be able to reuse mock instead of creating a new instance for every test case. Something like: ```go func TestSomething(t *testing.T) {...
String
Is there any way compare any string like anytime in go-sqlmock
Hello, I'm working on a package that wraps an sql.Driver and adds functionality. To test it, I'm trying to use go-sqlmock. I'm running into the issue that if I wrap...
I have a function with ```golang func (r *repository) Update(ctx context.Context, book *models.Book) error { now := time.Now() _, err := r.db.ExecContext(ctx, UPDATE books set title = $1, description =...
call to ExecQuery 'INSERT INTO "users" ("id","user_name","pass_word","email","role","name","created_at","updated_at") VALUES ($1,$2,$3,$4,$5,$6,$7,$8)' with args [{Name: Ordinal:1 Value:a8813f4a-bd82-4dd2-bdd9-fbcf0aa7787f} {Name: Ordinal:2 Value:test} {Name: Ordinal:3 Value:12345} {Name: Ordinal:4 Value:testemail} {Name: Ordinal:5 Value:admin} {Name: Ordinal:6 Value:test} {Name:...
Hi, I'm trying to run an unit test that executes an INSERT into DB, so I mocked exactly the same query string that the gorm log displays with the same...
how i can use go-sqlmock for newer version of gorm in my project
I've found a case where calling `db.Close()` in different ways only sometimes satisfies `mock.ExpectClose()`. For example, if I call `sqlmock.New()` and then call `defer db.Close()` on the DB handle that...