-
Notifications
You must be signed in to change notification settings - Fork 33
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
PgPromise adapter: add default tx options #136
PgPromise adapter: add default tx options #136
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the PR, I left some suggestions. Could you also add some tests for the default options?
...tional-adapters/transactional-adapter-pg-promise/src/lib/transactional-adapter-pg-promise.ts
Outdated
Show resolved
Hide resolved
docs/docs/06_plugins/01_available-plugins/01-transactional/04-pg-promise-adapter.md
Outdated
Show resolved
Hide resolved
...tional-adapters/transactional-adapter-pg-promise/src/lib/transactional-adapter-pg-promise.ts
Show resolved
Hide resolved
Thanks for your comments. I should have realized myself I needed to merge the default options, but that's what happens when you code while drinking beer... On a more serious note, I need help. The tests for
|
Additionally, TypeScript is complaining about lines 3, 4 and 126 of |
Oh damn, I updated typescript recently, but all tests were passing for me, so I thought all is fine. No new version has been released since then, so there's no immediate danger. I'll investigate. |
@sam-artuso Make sure you run And run |
db8a739
to
a63db74
Compare
@Papooch this is now read to review 🙏🏼 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR, I'll go ahead and merge it.
On the other hand, I was thinking and I don't really like this implementation (and in turn how the tests work). The default options feature should be moved up one level and the options should be merged in the TransactionHost
instance (for example here) and passed to the adapter from there. This way it would be easier to implement default options for all adapters.
You don't have to fix that if you don't feel like it. Once I find some more free time, I'll have a go at it.
This PR adds the ability to specify default options for the
@Transactional
decorator, so that they don't need to be specified repeatedly.