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 possibility to omit config #42

Merged
merged 1 commit into from
Sep 6, 2021

Conversation

alex-popov-tech
Copy link
Contributor

Hey guys, thank you for the plugin!
I was struggling for 2 days trying to get it working with configuring typeorm through env variables, and discovered that fastify always passing {} to async function typeormConnector (fastify, options) { for options, which makes it call createConnection with that empty object even if user registered plugin without passing it. And typeorm.createConnection({}) seems to trying to find config in object passed and stucks, so basically that plugin does not support env-like setup. I've added couple of guards to check if passed object is empty, treat it as undefined passed to createConnection, added tests for it, updated documentation, and tested locally with my fastify project as well.
Looking forward to merge it, since its blocking my app from using env variables for typeorm with this cool plugin. :)

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.

2 participants