How to Use SQLite for Your Test Databases

Posted on January 07, 2008

Creating a new MySQL ‘test_’ database for every Rails app gets to be a pain after a while. SQLite has become stable enough in recent months/years to warrant its due spot at the table next to MySQL, etc. for lightweight database operations.

To use SQLite instead of MySQL for your test environment, drop this into your db/database.yml in place of your existing MySQL ‘test’ environment config:

test:
  adapter: sqlite3
  database: db/test.sqlite3
  timeout: 5000