guides icon indicating copy to clipboard operation
guides copied to clipboard

DatabaseCleaner setup doesn't work with SQLite

Open janko opened this issue 3 years ago • 1 comments

When following persistence setup with ROM in the getting started guide, the database cleaner setup shown doesn't automatically work with SQLite. I know the guides are showing instructions for Postgres, but for simplicity I wanted to use SQLite, and it would be great if everything still worked 👌🏻

Concretely, I have the database URL set to sqlite://db/test.sqlite3 in tests, and I'm getting the following error:

DatabaseCleaner::Safeguard::Error::RemoteDatabaseUrl:
  ENV['DATABASE_URL'] is set to a remote URL. Please refer to https://github.com/DatabaseCleaner/database_cleaner#safeguards

It appears that DatabaseCleaner is falsely detecting the SQLite database URL as "remote", because it doesn't see any localhost or 127.0.0.1, even though it's in fact local.

janko avatar Nov 27 '22 15:11 janko

See the relevant documentation for DatabaseCleaner.

komidore64 avatar Oct 12 '23 13:10 komidore64