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

How to pass transaction to be able to rollback a sequence of actions? #14

Open
gtsamtsouris opened this issue Apr 24, 2023 · 4 comments

Comments

@gtsamtsouris
Copy link

I am using the evtstore library in our app and I need a way to pass transaction in knex provider in order to rollback a sequence of actions in our application. Do you have any advice for it? After a small walkthrough in codebase it seems that I need to pass it only in the append function of the provider (where exists the only insertion in events table)

@gtsamtsouris gtsamtsouris changed the title How to pass transaction transaction to be able to rollback a sequence of actions? How to pass transaction to be able to rollback a sequence of actions? Apr 25, 2023
@Seikho
Copy link
Owner

Seikho commented May 8, 2023

I haven't quite been able to come up with a good/elegant solution for this. I'll keep thinking about it as I think it'd be quite valuable to have.

I assume you are needing to pass an arbitrary transaction while you're invoking commands?

@gtsamtsouris
Copy link
Author

Correct. I have prepared a proof of concept about it on this https://github.com/Seikho/evtstore/pull/15 . Please have a look.

@gtsamtsouris
Copy link
Author

Do you have any feedback about it?

@Seikho
Copy link
Owner

Seikho commented May 15, 2023

Apologies for the slow reply.
Yes, I do. The library functions are intended to be "provider agnostic" so passing through provider-specific objects through the agnostic functions breaks that pattern.

We'll need to come up with a way to maintains the agnosticism of the library code while solving your problem.

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

2 participants