[Question] Possible to initialize with configuration (or any other injected service) and how are environment variables parsed? #94
Description
As far as I can tell, there are two options to initialize Drivine:
- From environment variables
- From values set using a fluent API
From this, I get two questions:
-
How are environment variables parsed?
In the docs, it shows the methodDatabaseRegistry.buildOrResolveFromEnv('NEO')
. What is'NEO'
in this case?
EDIT:
After digging through the Drivine code, I found that the environment variables are hardcoded and prefixed with the name given (NEO
, in this case), resulting in environment variables being forced to take the nameNAME_DATABASE_TYPE
.
Using a configuration package which uses environment variables could conflict with this naming (as it does in my case).
Specifying howbuildOrResolveFromEnv
works in the docs might clear things up a bit. I can submit a PR later if you would like me to. -
Is there a way to inject configuration (or anything in Nest's DI tree) into the module initialization?
Nest provides dynamic modules, being able to use DI. Is there a way to use that with Drivine as well?