Class ActiveRecord::ConnectionAdapters::SQLiteAdapter
In: vendor/rails/activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb
Parent: AbstractAdapter

The SQLite adapter works with both the 2.x and 3.x series of SQLite with the sqlite-ruby drivers (available both as gems and from rubyforge.org/projects/sqlite-ruby/).

Options:

  • :database — Path to the database file.

Methods

Public Instance methods

[Source]

     # File vendor/rails/activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb, line 233
233:       def rename_table(name, new_name)
234:         execute "ALTER TABLE #{name} RENAME TO #{new_name}"
235:       end

[Source]

     # File vendor/rails/activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb, line 105
105:       def requires_reloading?
106:         true
107:       end

Protected Instance methods

[Source]

     # File vendor/rails/activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb, line 345
345:         def catch_schema_changes
346:           return yield
347:         rescue ActiveRecord::StatementInvalid => exception
348:           if exception.message =~ /database schema has changed/
349:             reconnect!
350:             retry
351:           else
352:             raise
353:           end
354:         end

[Source]

     # File vendor/rails/activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb, line 272
272:         def table_structure(table_name)
273:           returning structure = execute("PRAGMA table_info(#{table_name})") do
274:             raise ActiveRecord::StatementInvalid if structure.empty?
275:           end
276:         end

[Validate]