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

Add .isCompleted() to transaction #3368

Merged
merged 2 commits into from Jul 23, 2019

Conversation

@thekuom
Copy link
Contributor

commented Jul 23, 2019

Adds .isCompleted() to a transactor, which just calls the underlying .isCompleted() from the transaction. I needed it because in my application, I pass a transaction around as part of a request and as a safeguard, I am rolling back the transaction. However, sometimes the transaction is already complete. This just harmlessly exposes whether I am allowed to commit/rollback or not.

@thekuom thekuom changed the title Add .isComplete() to transaction Add .isCompleted() to transaction Jul 23, 2019

@kibertoad

This comment has been minimized.

Copy link
Collaborator

commented Jul 23, 2019

@thekuom Thank you, this is really useful! Could you please add documentation for it at https://github.com/knex/documentation?

@thekuom

This comment has been minimized.

Copy link
Contributor Author

commented Jul 23, 2019

Here you go: knex/documentation#223

test/unit/knex.js Show resolved Hide resolved
@elhigu
elhigu approved these changes Jul 23, 2019

@kibertoad kibertoad merged commit 054ce36 into tgriesser:master Jul 23, 2019

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
coverage/coveralls Coverage increased (+0.002%) to 88.184%
Details
@kibertoad

This comment has been minimized.

Copy link
Collaborator

commented Jul 23, 2019

Released in 0.19.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.