method
sqlite3_connection
v3.2.8 -
Show latest stable
- Class:
ActiveRecord::Base
sqlite3_connection(config)public
sqlite3 adapter reuses sqlite_connection.
# File activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb, line 9
def self.sqlite3_connection(config) # :nodoc:
# Require database.
unless config[:database]
raise ArgumentError, "No database file specified. Missing argument: database"
end
# Allow database path relative to Rails.root, but only if
# the database path is not the special path that tells
# Sqlite to build a database only in memory.
if defined?(Rails.root) && ':memory:' != config[:database]
config[:database] = File.expand_path(config[:database], Rails.root)
end
unless 'sqlite3' == config[:adapter]
raise ArgumentError, 'adapter name should be "sqlite3"'
end
db = SQLite3::Database.new(
config[:database],
:results_as_hash => true
)
db.busy_timeout(config[:timeout]) if config[:timeout]
ConnectionAdapters::SQLite3Adapter.new(db, logger, config)
end Related methods
- Instance methods
- <=>
- ==
- connection
- dup
- encode_with
- eql?
- freeze
- frozen?
- hash
- init_with
- initialize_dup
- inspect
- readonly!
- readonly?
- to_yaml
- yaml_initialize
- Class methods
- ===
- arel_engine
- arel_table
- clear_active_connections!
- configurations
- connected?
- connection
- connection_config
- connection_handler
- connection_id
- connection_id=
- connection_pool
- default_timezone
- establish_connection
- generated_feature_methods
- inherited
- initialize_generated_modules
- inspect
- logger
- mysql2_connection
- mysql_connection
- new
- postgresql_connection
- remove_connection
- retrieve_connection
- schema_format
- sqlite3_connection
- timestamped_migrations
- Private methods
-
relation -
to_ary