Skip to content

[Question] Possible to initialize with configuration (or any other injected service) and how are environment variables parsed? #94

Open
@NilsMoller

Description

As far as I can tell, there are two options to initialize Drivine:

  1. From environment variables
  2. From values set using a fluent API

From this, I get two questions:

  1. How are environment variables parsed?
    In the docs, it shows the method DatabaseRegistry.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 name NAME_DATABASE_TYPE.
    Using a configuration package which uses environment variables could conflict with this naming (as it does in my case).
    Specifying how buildOrResolveFromEnv works in the docs might clear things up a bit. I can submit a PR later if you would like me to.

  2. 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?

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions