Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for DATABASE_URL? #381

Closed
msakrejda opened this issue Jan 12, 2022 · 4 comments
Closed

Support for DATABASE_URL? #381

msakrejda opened this issue Jan 12, 2022 · 4 comments

Comments

@msakrejda
Copy link
Contributor

Hi,

Just started with pgtyped and really enjoying it so far. Would you consider a PR to add DATABASE_URL support as an alias for PGURI? Many tools already support this.

Thanks,
Maciek

@msakrejda
Copy link
Contributor Author

Also, any chance pgtyped could support .env files? Right now it's hard to use dotenv for this with pgtyped, since pgtyped is its own CLI. Loading a .env file with a --envfile flag to specify a different one could be really useful.

@tbo
Copy link

tbo commented Jan 15, 2022

@uhoh-itsmaciek You can handle the .env use case with a script entry inside your package.json:

    "pgtyped": "node -r dotenv/config ./node_modules/.bin/pgtyped -wc config.json",

@msakrejda
Copy link
Contributor Author

@tbo oh that's great, thanks! I looked at using dotenv, but I missed you can use it like a wrapper like env.

I'd still love to have pgtyped fall back to DATABASE_URL if PGURI is not set. Happy to contribute a patch.

@adelsz
Copy link
Owner

adelsz commented Apr 27, 2022

@uhoh-itsmaciek A PR to use DATABASE_URL as an alias for PGURI would be welcome.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants