Understanding Heroku's Postgresql Configuration

Asked 2 years ago, Updated 2 years ago, 36 views

In the Rails tutorial, the only configuration to use postgresql in heroku was to add the following to Gemfile:

 group:production do
  gem 'pg', '0.20.0'
end

The config/database.yml did not remain the default as follows:

default:&default
  adapter —sqlite3
  pool:<%=ENV.fetch("RAILS_MAX_THREADS"){5}%>
  timeout —5000

development:
  <<:* default
  database —db/development.sqlite3

test:
  <<:* default
  database —db/test.sqlite3

production:
  <<:* default
  database —db/production.sqlite3

Why can I connect to postgresql properly on heroku even though the production setting in database.yml remains configured using sqlite3?

ruby-on-rails ruby

2022-09-30 19:28

1 Answers

If this setting worked fine, I think it probably works with sqlite3 in the production environment (heroku).

Personally, I think it would be better to use the same adapter for the database used for development and the database used for production.


2022-09-30 19:28

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.