What would it take to use under SQLite3?
I'd be interested in running this gem with SQLite3 instead of PG. Backing up the database in a single file would be so very interesting!
I tried setting up Appraisal (and removing MySQL and MSSQL as I don't have that installed), but when I ran, I got the following:
$ bundle exec appraisal rails-7_1-sqlite3 rspec
>> BUNDLE_GEMFILE=/Users/francois/Projects/scoutges/active_storage_db/gemfiles/rails_7_1_sqlite3.gemfile bundle exec rspec
An error occurred while loading rails_helper.
Failure/Error: require File.expand_path("dummy#{app_ver}/config/environment.rb", __dir__)
LoadError:
cannot load such file -- /Users/francois/Projects/scoutges/active_storage_db/spec/dummy/config/environment.rb
# ./spec/rails_helper.rb:37:in `<top (required)>'
No examples found.
Finished in 0.00003 seconds (files took 0.21598 seconds to load)
0 examples, 0 failures, 1 error occurred outside of examples
I suspect the environment isn't correctly setup.
I would be interested in making this gem work. What would it take?
Hey @francois
The error that you receive is probably related to the environment variables needed to setup the test config. For example for Postgres and Rails 7.x I use:
DB_TEST=postgres RAILS=7.0 be appraisal rails-7_1-postgres rspec
Honestly I should evaluate carefully what it would be required to make the gem work with SQLite, but it seems a very specific use case to me because ActiveStorage can store the attachments on the filesystem on its own...
@blocknotes, I'm interested in storing data to a SQLite because then I will have a single file backup, and all data will be consistent with each other. Thanks for the pointer. I'll try that.
Hey @francois
I prepared an experimental PR to add SQLite support: https://github.com/blocknotes/active_storage_db/pull/51
The branch is: feat/sqlite-support
If you have a chance to make some tests, please share the results.