acro5piano / kysely-migration-cli

A thin library to create a migration script using Kysely
https://www.npmjs.com/package/kysely-migration-cli
MIT License
66 stars 3 forks source link

Abillity to set .env file for testing purpose #18

Closed thoriqadillah closed 6 months ago

thoriqadillah commented 7 months ago

Can you please add .env option for the cli to choose the location of the .env? I have a case where i want to test it with .env.test

acro5piano commented 7 months ago

Do you mean something like this?

env DOTENV_FILE=.env.test DATABASE_URL=postgres://postgres:postgres@127.0.0.1:27253/postgres \
  npm run kysely-migration-cli

I think you can do it without the option, just cp .env.test .env before running migration.

Feel free to re-open if you need discussion! Thanks

thoriqadillah commented 7 months ago

No, but I don't want to edit my .env. i just want it to use to different path. This is for testing purposes, like using different env for testing. I use postgres with docker in testing, but i use my local database for development. I just don't see myself editing my .env everytime i ran the migration

acro5piano commented 6 months ago

Sorry for my slow response. I implemented in v0.4.0: https://github.com/acro5piano/kysely-migration-cli/releases/tag/v0.4.0

tl;dr DOTENV_CONFIG_PATH=.env.test npm run kysely-migration-cli

If you have further issues, please re-open.