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

Return error in driver.BeginTx if options aren't used/required or incorrect. #266

Open
SimonRichardson opened this issue Aug 18, 2023 · 0 comments

Comments

@SimonRichardson
Copy link
Member

According to the docs https://pkg.go.dev/database/sql#IsolationLevel

Various isolation levels that drivers may support in BeginTx. If a driver does not support a given isolation level an error may be returned

It would be good if the code return an error if any of the options are not supported. Looking at the driver code, we don't verify the options, but the documentation states that we may return an error. For consistency, it would be ideal to validate those options, so if new changes do arrive then code can be tested when they become valid.

https://github.com/canonical/go-dqlite/blob/f54a1528102399f99af4c1a8ebdbe14db2c68fda/driver/driver.go#L482C16-L493

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

No branches or pull requests

1 participant