Skip to content
New issue

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

Support sql.IsolationLevel for transactions #428

Open
joeblubaugh opened this issue Dec 4, 2020 · 0 comments · May be fixed by #429
Open

Support sql.IsolationLevel for transactions #428

joeblubaugh opened this issue Dec 4, 2020 · 0 comments · May be fixed by #429

Comments

@joeblubaugh
Copy link

gorp transactions are created with nil options, which means that all Tx use the driver's default isolation level.

For InnoDB, this level is REPEATABLE READ, which is a pretty loose guarantee.

If there was a method to start a transaction with a given isolation level, my team could avoid doing a fair amount of SELECT ... FOR UPDATE and use the included Get() methods within an isolated transaction.

I know gorp supports optimistic locking with a version column, but we don't use this at my job, and supporting the standard library's options could be nice.

Something like:

func (d *DbMap) BeginOption(option *sql.TxOptions) (*Transaction, error) {

}
@joeblubaugh joeblubaugh linked a pull request Dec 4, 2020 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant