Skip to content
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

DatabaseCleaner setup doesn't work with SQLite #157

Open
janko opened this issue Nov 27, 2022 · 1 comment
Open

DatabaseCleaner setup doesn't work with SQLite #157

janko opened this issue Nov 27, 2022 · 1 comment

Comments

@janko
Copy link

janko commented Nov 27, 2022

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.

@komidore64
Copy link

See the relevant documentation for DatabaseCleaner.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants