Skip to content

Remove SQLite production warning but leave production config disabled#50463

Merged
byroot merged 1 commit into
rails:mainfrom
Shopify:remove-sqlite3-production-warning
Dec 27, 2023
Merged

Remove SQLite production warning but leave production config disabled#50463
byroot merged 1 commit into
rails:mainfrom
Shopify:remove-sqlite3-production-warning

Conversation

@byroot
Copy link
Copy Markdown
Member

@byroot byroot commented Dec 27, 2023

Fix: #49715

There are valid use cases for running SQLite in production, however it must be done with care, so instead of a warning most users won't see anyway, it's preferable to leave the configuration commented out to force them to think about having the database on a persistent volume etc.

Co-Authored-By: @intrip

production:
<<: *default
database: storage/production.sqlite3
# database: path/to/persistent/storage/production.sqlite3
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# database: path/to/persistent/storage/production.sqlite3
# database: storage/production.sqlite3

I think just commenting it out is fine since most would probably use the default storage folder anyway, but persisted with something like Docker volumes.

@dhh
Copy link
Copy Markdown
Member

dhh commented Dec 27, 2023

This feels like a good compromise. But also wonder if we should support passing in a path using DATABASE_URL in production?

@byroot
Copy link
Copy Markdown
Member Author

byroot commented Dec 27, 2023

if we should support passing in a path using DATABASE_URL in production?

Makes sense to me but is orthogonal. Best handled in another PR.

@dhh
Copy link
Copy Markdown
Member

dhh commented Dec 27, 2023

Yeah I guess DATABASE_URL overwrites in any case. Looks good to me then 👍

@skipkayhil
Copy link
Copy Markdown
Member

Looks like rails-new-docker is correctly failing because it uses a sqlite3 db and now has no production configuration. Maybe it should be changed to one of the others?

@byroot
Copy link
Copy Markdown
Member Author

byroot commented Dec 27, 2023

I think I'll squeeze the DATABASE_URL support to fix it...

There are valid use cases for running SQLite in production, however it must be done
with care, so instead of a warning most users won't see anyway, it's preferable to
leave the configuration commented out to force them to think about having the database
on a persistent volume etc.

Co-Authored-By: Jacopo Beschi <beschi.jacopo@gmail.com>
@casperisfine casperisfine force-pushed the remove-sqlite3-production-warning branch from 11795be to 6b446be Compare December 27, 2023 22:32
@byroot
Copy link
Copy Markdown
Member Author

byroot commented Dec 27, 2023

Actually it's already supported.

@byroot byroot merged commit 354d1c4 into rails:main Dec 27, 2023
tagliala added a commit to activeadmin/demo.activeadmin.info that referenced this pull request Jun 1, 2025
- Update to Rails 8 and run `rails app:update`
- Advise to install Node 22
- Improve dependabot
- Remove sqlite production warning suppression as per rails/rails#50463
tagliala added a commit to activeadmin/demo.activeadmin.info that referenced this pull request Jun 1, 2025
- Update to Rails 8 and run `rails app:update`
- Advise to install Node 22
- Improve dependabot
- Remove sqlite production warning suppression as per rails/rails#50463
- Use example domain for email in specs
- Move some assertions on the current path below text assertions to
  give time to the server to persist the new resource
tagliala added a commit to activeadmin/demo.activeadmin.info that referenced this pull request Jun 1, 2025
- Update to Rails 8 and run `rails app:update`
- Advise to install Node 22
- Improve dependabot
- Remove sqlite production warning suppression as per rails/rails#50463
- Use example domain for email in specs
- Move some assertions on the current path below text assertions to
  give time to the server to persist the new resource
tagliala added a commit to activeadmin/demo.activeadmin.info that referenced this pull request Jun 1, 2025
- Bump Rails to version 8.0 and execute `rails app:update` for
  configuration alignment
- Recommend Node.js 22 for development and runtime compatibility
- Enhance Dependabot configuration for improved dependency management
- Remove suppression of SQLite production warning, addressing
  rails/rails#50463
- Use an example domain for email addresses in test suites
- Reorder certain path assertions after text assertions in specs to
  ensure server state is persisted
- Add the frozen string literal magic comment to Ruby files
- Switch to Rails 8’s built-in rate limiter for request throttling

Closes #637
tagliala added a commit to activeadmin/demo.activeadmin.info that referenced this pull request Jun 1, 2025
- Bump Rails to version 8.0 and execute `rails app:update` for
  configuration alignment
- Recommend Node.js 22 for development and runtime compatibility
- Enhance Dependabot configuration for improved dependency management
- Remove suppression of SQLite production warning, addressing
  rails/rails#50463
- Use an example domain for email addresses in test suites
- Reorder certain path assertions after text assertions in specs to
  ensure server state is persisted
- Add the frozen string literal magic comment to Ruby files
- Switch to Rails 8’s built-in rate limiter for request throttling

Closes #637
tagliala added a commit to activeadmin/demo.activeadmin.info that referenced this pull request Jun 2, 2025
* Upgrade to Rails 8.0 and adopt new features

- Bump Rails to version 8.0 and execute `rails app:update` for
  configuration alignment
- Recommend Node.js 22 for development and runtime compatibility
- Enhance Dependabot configuration for improved dependency management
- Remove suppression of SQLite production warning, addressing
  rails/rails#50463
- Use an example domain for email addresses in test suites
- Reorder certain path assertions after text assertions in specs to
  ensure server state is persisted
- Add the frozen string literal magic comment to Ruby files
- Switch to Rails 8’s built-in rate limiter for request throttling

Closes #637

* Update app/controllers/application_controller.rb

Co-authored-by: Javier Julio <JJfutbol@gmail.com>

---------

Co-authored-by: Javier Julio <JJfutbol@gmail.com>
aidewoode added a commit to blackcandy-org/blackcandy that referenced this pull request Jul 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants