Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

sqlite3 adapter should not raise exception when table does not exist

#1603

The other connection adapters I've seen allow columns to return null, but in SQLite3Adapter#table_structure an exception is raised.n This prevents any descendants from ActiveRecord::Base from being initialized without a table existing.

Here is where the exception is raised: http://github.com/rails/rails/tr...

For reference, note the MySQL adapter allows columns to return an empty array: http://github.com/rails/rails/tr...

If there's a good reason for this design decision, then I'm happy to hear it, but right now it's preventing me from running unit tests that create temporary models (tests that pass on a SQL Server adapter) on SQLite.

Noting Jeremy just because github has him as the last one to touch the file.

Reported by Paul Hinze · December 19th, 2008 @ 04:21 PM

State: invalid
Milestone: 2.x
Assigned to: Pratik Pratik
Importance: none

Activity

  1. Pratik
    Pratik
    • State changed from new to invalid
    • Assigned user changed from Jeremy Kemper to Pratik

    The table_structure() method is just an internal method used by connection#columns(). connection#columns() raises an exception in MySQL when the table is missing.

    I think it's a good design to fail early in such cases rather than silently ignoring failures.

    March 13th, 2009 @ 02:23 PM