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

feat: expose connection transactions with context and options #719

Merged
merged 1 commit into from
May 24, 2022

Conversation

zepatrik
Copy link
Contributor

Currently one can only use conn.Store.TransactionContextOptions() which means one does not get a connection that is part of the transaction.

Copy link
Member

@sio4 sio4 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is reasonable. Could we have test cases for the changes too?

@zepatrik zepatrik force-pushed the feat/expose-tx-opts branch from ce05da9 to 9b946de Compare May 23, 2022 10:12
connection.go Show resolved Hide resolved
r.Equal(nctx, tx.Context())

r.NoError(tx.TX.Rollback())
})
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no test for NewTransactionContextOptions because that one is quite hard to test in general (we just pass down the options), and sqlite neither supports readOnly transactions, nor any other isolation level than serializable.

@zepatrik zepatrik requested a review from sio4 May 23, 2022 10:19
@aeneasr aeneasr enabled auto-merge (squash) May 24, 2022 08:15
@aeneasr aeneasr disabled auto-merge May 24, 2022 08:15
@aeneasr aeneasr enabled auto-merge (rebase) May 24, 2022 08:15
@sio4
Copy link
Member

sio4 commented May 24, 2022

I think this change is well aligned with #497 and #594, and it seems like we already moved to use context for all transactions which is a good thing, even though it could be (mostly useless) context.Background().

I think this change is reasonable. What do you think @paganotoni ?

@aeneasr aeneasr merged commit 012ea29 into gobuffalo:development May 24, 2022
@zepatrik zepatrik deleted the feat/expose-tx-opts branch May 24, 2022 11:38
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 this pull request may close these issues.

3 participants