Sha256: 5155373537984f4ea0692324818d134396c2f0dc3afc141ead6700cfc1a4e40f

Contents?: true

Size: 985 Bytes

Versions: 50

Compression:

Stored size: 985 Bytes

Contents

require 'active_record/connection_adapters/sqlite_adapter'

module ActiveRecord
  class Base
    # sqlite3 adapter reuses sqlite_connection.
    def self.sqlite3_connection(config) # :nodoc:
      parse_sqlite_config!(config)

      unless self.class.const_defined?(:SQLite3)
        require_library_or_gem(config[:adapter])
      end

      db = SQLite3::Database.new(
        config[:database],
        :results_as_hash => true,
        :type_translation => false
      )

      db.busy_timeout(config[:timeout]) unless config[:timeout].nil?

      ConnectionAdapters::SQLite3Adapter.new(db, logger, config)
    end
  end

  module ConnectionAdapters #:nodoc:
    class SQLite3Adapter < SQLiteAdapter # :nodoc:
      def table_structure(table_name)
        returning structure = @connection.table_info(quote_table_name(table_name)) do
          raise(ActiveRecord::StatementInvalid, "Could not find table '#{table_name}'") if structure.empty?
        end
      end
    end
  end
end

Version data entries

50 entries across 49 versions & 10 rubygems

Version Path
activerecord_csi-2.3.5.p8 lib/active_record/connection_adapters/sqlite3_adapter.rb
activerecord_csi-2.3.5.p7 lib/active_record/connection_adapters/sqlite3_adapter.rb
activerecord_csi-2.3.5.p6 lib/active_record/connection_adapters/sqlite3_adapter.rb
webroar-0.5.0 src/admin_panel/vendor/rails/activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb
radiantcms-couchrest_model-0.2.4 vendor/rails/activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb
radiantcms-couchrest_model-0.2.2 vendor/rails/activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb
radiantcms-couchrest_model-0.2.1 vendor/rails/activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb
radiantcms-couchrest_model-0.2 vendor/rails/activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb
radiantcms-couchrest_model-0.1.9 vendor/rails/activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb
radiantcms-couchrest_model-0.1.8 vendor/rails/activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb
radiantcms-couchrest_model-0.1.7 vendor/rails/activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb
radiantcms-couchrest_model-0.1.6 vendor/rails/activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb
radiantcms-couchrest_model-0.1.5 vendor/rails/activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb
radiantcms-couchrest_model-0.1.4 vendor/rails/activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb
radiantcms-couchrest_model-0.1.3 vendor/rails/activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb
radiantcms-couchrest_model-0.1.2 vendor/rails/activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb
radiantcms-couchrest_model-0.1.1 vendor/rails/activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb
radiantcms-couchrest_model-0.1 vendor/rails/activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb
webroar-0.4.0 src/admin_panel/vendor/rails/activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb
radiant-0.9.1 vendor/rails/activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb