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
Merged

Add .isCompleted() to transaction #3368

merged 2 commits into from Jul 23, 2019

Conversation

thekuom
Copy link
Contributor

@thekuom thekuom 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
Copy link
Collaborator

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

@thekuom
Copy link
Contributor Author

thekuom commented Jul 23, 2019

Here you go: knex/documentation#223

test/unit/knex.js Show resolved Hide resolved
@kibertoad kibertoad merged commit 054ce36 into knex:master Jul 23, 2019
@kibertoad
Copy link
Collaborator

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
Development

Successfully merging this pull request may close these issues.

None yet

3 participants