views:

17

answers:

1

My development log fills up with

SELECT name FROM sqlite_master WHERE type = 'table' AND NOT name = 'sqlite_sequence'

I'd like to turn off the sqlite_master queries in sqlite3, so that I only see the interesting queries.

+1  A: 

Here's how I fixed it. Perhaps there are better options.

Tested only on Rails 2.3.8.

I added a log_info method to the SQLiteAdapter class in the activerecord gem, which overrides the same method in AbstractAdapter.

      def log_info(sql, name, ms)
        unless sql.match(/sqlite_master/)
          if @logger && @logger.debug?
            name = '%s (%.1fms)' % [name || 'SQL', ms]
            @logger.debug(format_log_entry(name, sql.squeeze(' ')))
          end
        end
      end

so, any sql statement that contains 'sqlite_master' is not logged.

lukewendling