We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I would like to provide my own DataSource, but I need to inject my ConfigService so that I can do things in my DataSource depending on configuration.
ConfigService
DataSource
The most straightforward solution is to provide a dataSourceFactoryInject option.
dataSourceFactoryInject
A bigger change (which I think makes more sense) would be to remove dataSourceFactory and add
dataSourceFactory
dataSourceProviderModify: (provider) => provider entityManagerProviderModify: (provider) => provider
which passes in the default provider, and the user can modify whatever they want, e.g.
dataSourceProviderModify: (provider) => ({ ...provider, useFactory: (typeOrmOptions, configService) => { return new MyDataSource(typeOrmOptions, configService) }, inject: [...provider.inject, ConfigService], })
See solution.
See problem.
The text was updated successfully, but these errors were encountered:
I would like to suggest this feature as well.
Sorry, something went wrong.
No branches or pull requests
Is there an existing issue that is already proposing this?
Is your feature request related to a problem? Please describe it
I would like to provide my own DataSource, but I need to inject my
ConfigService
so that I can do things in myDataSource
depending on configuration.Describe the solution you'd like
The most straightforward solution is to provide a
dataSourceFactoryInject
option.A bigger change (which I think makes more sense) would be to remove
dataSourceFactory
and addwhich passes in the default provider, and the user can modify whatever they want, e.g.
Teachability, documentation, adoption, migration strategy
See solution.
What is the motivation / use case for changing the behavior?
See problem.
The text was updated successfully, but these errors were encountered: