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
C
R
T
Instance Public methods
rename_table(name, new_name)
# File rails/activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb, line 233
def rename_table(name, new_name)
  execute "ALTER TABLE #{name} RENAME TO #{new_name}"
end
requires_reloading?()
# File rails/activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb, line 105
def requires_reloading?
  true
end
Instance Protected methods
catch_schema_changes()
# File rails/activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb, line 345
def catch_schema_changes
  return yield
rescue ActiveRecord::StatementInvalid => exception
  if exception.message =~ %rdatabase schema has changed/
    reconnect!
    retry
  else
    raise
  end
end
table_structure(table_name)
# File rails/activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb, line 272
def table_structure(table_name)
  returning structure = execute("PRAGMA table_info(#{table_name})") do
    raise ActiveRecord::StatementInvalid if structure.empty?
  end
end