RobinBlomberg / kysely-codegen

Generate Kysely type definitions from your database.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to specify different .env variable for DATABASE_URL

srapport opened this issue · comments

We have multiple databases in the same project that have different connection strings. Is there a way to specify the .env variable to use in the kysely-codegen command line?

For example:

kysely-codegen --env-var CORE_PRODUCT_DB_URL ...
kysely-codegen --env-var LICENSING_DB_URL ...

Upvote & Fund

  • We're using Polar.sh so you can upvote and help fund this issue.
  • We receive the funding once the issue is completed & confirmed by you.
  • Thank you in advance for helping prioritize & fund our backlog.
Fund with Polar

Hey!

You can use kysely-codegen --url=env(CORE_PRODUCT_DB_URL). 😊

If you need to specify the environment file, you can use --env-file as well.

Hope that helps!