mirror of
https://github.com/zhashkevych/go-sqlxmock.git
synced 2024-11-24 08:12:13 +02:00
11 lines
423 B
Markdown
11 lines
423 B
Markdown
|
|
||
|
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()
|
||
|
|