Skip to content

Instantly share code, notes, and snippets.

@lunks
Created March 19, 2021 21:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lunks/2ee85df8eab18f4a54bd2acb42806ee4 to your computer and use it in GitHub Desktop.
Save lunks/2ee85df8eab18f4a54bd2acb42806ee4 to your computer and use it in GitHub Desktop.
An example of a database.yml configuration I'm currently using.
default: &default
adapter: postgresql
encoding: utf8
pool: <%= ENV.fetch("RAILS_MAX_THREADS", 5) %>
local: &local
<<: *default
host: <%= ENV.fetch("PGHOST", "localhost") %>
username: <%= ENV.fetch("PGUSER", `whoami`.strip) %>
password: <%= ENV.fetch("PGPASSWORD", "") %>
development:
<<: *local
database: app_dev
test:
<<: *local
database: app_test
staging:
<<: *default
url: <%= ENV['DATABASE_URL'] %>
production:
<<: *default
url: <%= ENV['DATABASE_URL'] %>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment