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

Allow database_host to be specified through ENV var #319

Merged
merged 1 commit into from
Apr 16, 2022

Conversation

robbevp
Copy link
Member

@robbevp robbevp commented Apr 3, 2022

In my local development setup I've been switching to a postgres instance per project, which runs in tmp/postgres.

To easily use this database, I'd like to set the database_host through an ENV variable. (I could also do this with a database_url, but this requires the variable to be URI encoded, where the host can be a regular path. It's just a bit easier to set /path/to/accentor/api/tmp/postgres rather than postgres://%2fpath%2fto%2faccentor%2fapi%2ftmp%2fpostgres/accentor_development)

Since I added the fallback to localhost, this should not cause any difference to other users. Due to the way Rails' connection preference works, this also should not cause a difference for people who currently use the DATABASE_URL ENV var.

@robbevp robbevp added the chore Repository or build maintenance label Apr 3, 2022
@robbevp robbevp requested a review from chvp April 3, 2022 10:12
@robbevp robbevp self-assigned this Apr 3, 2022
config/database.yml Outdated Show resolved Hide resolved
@chvp chvp changed the title Allow database_host to be specified thorugh ENV var Allow database_host to be specified through ENV var Apr 3, 2022
@robbevp robbevp force-pushed the chore/allow-dtabase-host-through-env branch from 3382d42 to 1580b85 Compare April 3, 2022 10:15
@chvp chvp merged commit 87f15e3 into main Apr 16, 2022
@chvp chvp deleted the chore/allow-dtabase-host-through-env branch April 16, 2022 09:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore Repository or build maintenance
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants