-
-
Notifications
You must be signed in to change notification settings - Fork 528
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
Add support for SQLite #1248
base: main
Are you sure you want to change the base?
Add support for SQLite #1248
Conversation
With increasing interest in SQLite across the Rails community as a whole, it's valuable for us to start exploring it too. This expands the existing checks for PostgreSQL to also include SQLite so that where we want to try out SQLite we're able to. It also adjusts the CI workflow to exclude PostgreSQL when generating a SQLite-based application. https://rubyonrails.org/2024/11/7/rails-8-no-paas-required https://fractaledmind.github.io/tags/sqlite/ Closes #1245
@@ -31,7 +31,7 @@ This approach uses an [application template][] to generate a new Rails | |||
application with Suspenders. | |||
|
|||
We skip the [default test framework][] in favor of [RSpec][], and [prefer | |||
PostgreSQL][] as our database. | |||
PostgreSQL][] as our database, although we do support SQLite. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm being a bit … careful (?) with my README changes here. I want to suggest it's possible, but we're just trying it out, and it's worth evaluating and not that you should necessarily switch away from Postgres.
That said, maybe we need an explicit example?
We are trying to keep Suspenders as close to Rails defaults as possible, but I still expect us to have an opinion. Otherwise, we should run |
I think there are a number of (small?) projects that would benefit from a simpler setup. You just want to try out an idea or build a side project. That shouldn't require you to deploy 2 different servers That being said, should we just run rails db:system:change --to=sqlite3 |
test "database_adapter returns the current database" do | ||
with_database "postgresql" do | ||
assert_equal database_adapter, "postgresql" | ||
end | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this also cover the SQLite case?
@@ -21,7 +21,7 @@ class CiGeneratorTest < Rails::Generators::TestCase | |||
|
|||
test "raises if PostgreSQL is not the adapter" do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-
Should this test description reflect "PostgreSQL or SQLite"?
-
Should this or another test assert that
with_database "sqlite"
does not raise?
@@ -86,6 +86,7 @@ jobs: | |||
runs-on: ubuntu-latest | |||
|
|||
services: | |||
<%- if using_postgres? -%> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this block be tested that it is present for Postgres and absent for SQLite?
With increasing interest in SQLite across the Rails community as a whole, it's valuable for us to start exploring it too. This expands the existing checks for PostgreSQL to also include SQLite so that where we want to try out SQLite we're able to. It also adjusts the CI workflow to exclude PostgreSQL when generating a SQLite-based application.
https://rubyonrails.org/2024/11/7/rails-8-no-paas-required
https://fractaledmind.github.io/tags/sqlite/
Closes #1245