w3tecch / typeorm-seeding

🌱 A delightful way to seed test data into your database.
https://www.npmjs.com/package/typeorm-seeding
MIT License
877 stars 131 forks source link

Question: Loading connection information from .ENV instead of ormconfig #199

Open RobertCharron opened 2 years ago

RobertCharron commented 2 years ago

I am wondering if it is possible to run a command that loads the configuration for the connection from a .env file instead of from the ormconfig. This way I can keep it consistent with my NestJS project.

Thanks

jorgebodega commented 2 years ago

Hi! If i'm not wrong, typeorm is able to read all info from environment variables, so if this library cannot, is a problem.

I'm going to release a new version soon and that part is already changed, so please stay tuned.

exipnus commented 2 years ago

Any news on this?

seanowenhayes commented 3 weeks ago

@exipnus I think there are already environment variables set up. However it doesn't seem well documented.

See this code

You can see TYPEORM_SEEDING_FACTORIES and TYPEORM_SEEDING_SEEDS are read.