1
0
mirror of https://github.com/zhashkevych/go-sqlxmock.git synced 2025-07-12 22:11:03 +02:00
Files
go-sqlxmock/README.md

11 lines
423 B
Markdown
Raw Normal View History

2014-02-05 16:21:07 +02:00
db = mock.Open("test", "")
db.ExpectTransactionBegin()
db.ExpectTransactionBegin().WillReturnError("some error")
db.ExpectQuery("SELECT bla").With(5, 8, "stat").WillReturnNone()
db.ExpectExec("UPDATE tbl SET").With(5, "val").WillReturnResult(res /* sql.Result */)
db.ExpectExec("INSERT INTO bla").With(5, 8, "stat").WillReturnResult(res /* sql.Result */)
db.ExpectQuery("SELECT bla").With(5, 8, "stat").WillReturnRows()