We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
It would be really handy if sqlmock.ExpectBegin() allowed the user to verify the options passed to BeginTx().
sqlmock.ExpectBegin()
BeginTx()
txOptions *TxOptions
ExpectedBegin
go-sqlmock/expectations.go
Line 54 in 3476f31
ExpectedBegin.txOptions
(*ExpectedBegin).WithTxOptions(sql.TxOptions)
go-sqlmock/sqlmock_go18.go
Line 68 in 3476f31
Verifying transaction isolation level:
db, mock, err := sqlmock.New() defer mock.ExpectationsWereMet() txOpts := sql.TxOptions{Isolation: sql.LevelReadUncommitted} mock.ExpectBegin().WithTxOptions(txOpts) tx, err := db.BeginTx(context.TODO(), &txOpts)
Verifying read-only transactions:
db, mock, err := sqlmock.New() defer mock.ExpectationsWereMet() txOpts := sql.TxOptions{ReadOnly: true} mock.ExpectBegin().WithTxOptions(txOpts) tx, err := db.BeginTx(context.TODO(), &txOpts)
The text was updated successfully, but these errors were encountered:
No branches or pull requests
It would be really handy if
sqlmock.ExpectBegin()
allowed the user to verify the options passed toBeginTx()
.Proposal
txOptions *TxOptions
field toExpectedBegin
:go-sqlmock/expectations.go
Line 54 in 3476f31
ExpectedBegin.txOptions
in new method(*ExpectedBegin).WithTxOptions(sql.TxOptions)
BeginTx()
:go-sqlmock/sqlmock_go18.go
Line 68 in 3476f31
Use-cases
Verifying transaction isolation level:
Verifying read-only transactions:
The text was updated successfully, but these errors were encountered: