Class: ActiveRecord::ConnectionAdapters::SQLite3Adapter
- Inherits:
-
AbstractAdapter
- Object
- AbstractAdapter
- ActiveRecord::ConnectionAdapters::SQLite3Adapter
- Includes:
- ArJdbc::Abstract::Core, ArJdbc::Abstract::DatabaseStatements, ArJdbc::Abstract::StatementCache, ArJdbc::Abstract::TransactionSupport, ArJdbc::SQLite3
- Defined in:
- lib/arjdbc/sqlite3/adapter.rb
Overview
Currently our adapter is named the same as what AR5 names its adapter. We will need to get this changed at some point so this can be a unique name and we can extend activerecord ActiveRecord::ConnectionAdapters::SQLite3Adapter. Once we can do that we can remove the module SQLite3 above and remove a majority of this file.
Constant Summary
Constants included from ArJdbc::Abstract::DatabaseStatements
ArJdbc::Abstract::DatabaseStatements::NO_BINDS
Constants included from ArJdbc::SQLite3
ArJdbc::SQLite3::ADAPTER_NAME, ArJdbc::SQLite3::ConnectionAdapters, ArJdbc::SQLite3::IndexDefinition, ArJdbc::SQLite3::NATIVE_DATABASE_TYPES, ArJdbc::SQLite3::Quoting, ArJdbc::SQLite3::RecordNotUnique, ArJdbc::SQLite3::SQLite3Adapter, ArJdbc::SQLite3::SchemaCreation
Instance Attribute Summary
Attributes included from ArJdbc::Abstract::Core
Class Method Summary collapse
Instance Method Summary collapse
- #begin_isolated_db_transaction(isolation) ⇒ Object
-
#exec_insert(sql, name = nil, binds = [], pk = nil, sequence_name = nil) ⇒ Object
SQLite driver doesn't support all types of insert statements with executeUpdate so make it act like a regular query and the ids will be returned from #last_inserted_id example: INSERT INTO "aircraft" DEFAULT VALUES.
- #jdbc_column_class ⇒ Object
- #jdbc_connection_class(spec) ⇒ Object
Methods included from ArJdbc::Abstract::TransactionSupport
#begin_db_transaction, #commit_db_transaction, #create_savepoint, #exec_rollback_db_transaction, #exec_rollback_to_savepoint, #release_savepoint, #supports_savepoints?, #supports_transaction_isolation?
Methods included from ArJdbc::Abstract::StatementCache
#clear_cache!, #delete_cached_statement, #fetch_cached_statement, #initialize, #supports_statement_cache?
Methods included from ArJdbc::Abstract::DatabaseStatements
#exec_query, #exec_update, #execute, #select_all
Methods included from ArJdbc::SQLite3
#active?, #add_column, #allowed_index_name_length, #alter_table, #arel_visitor, #begin_db_transaction, #change_column, #change_column_default, #change_column_null, #clear_cache!, #columns, #commit_db_transaction, #copy_table, #copy_table_contents, #copy_table_indexes, #data_source_exists?, #data_sources, #disconnect!, #encoding, #exec_delete, #exec_query, #exec_rollback_db_transaction, #execute, #explain, #indexes, #initialize, #last_inserted_id, #move_table, #native_database_types, #primary_keys, #remove_column, #remove_index, #rename_column, #rename_table, #requires_reloading?, #schema_creation, #sqlite_version, #supports_datetime_with_precision?, #supports_ddl_transactions?, #supports_explain?, #supports_index_sort_order?, #supports_migrations?, #supports_multi_insert?, #supports_partial_index?, #supports_primary_key?, #supports_savepoints?, #supports_statement_cache?, #supports_views?, #table_exists?, #table_structure, #tables, #translate_exception, #valid_alter_table_type?, #valid_type?, #view_exists?, #views
Methods included from ArJdbc::Abstract::Core
#initialize, #jdbc_connection, #translate_exception, #translate_exception_class
Class Method Details
.jdbc_connection_class ⇒ Object
675 676 677 |
# File 'lib/arjdbc/sqlite3/adapter.rb', line 675 def self.jdbc_connection_class ::ActiveRecord::ConnectionAdapters::SQLite3JdbcConnection end |
Instance Method Details
#begin_isolated_db_transaction(isolation) ⇒ Object
655 656 657 |
# File 'lib/arjdbc/sqlite3/adapter.rb', line 655 def begin_isolated_db_transaction(isolation) raise ActiveRecord::TransactionIsolationError, 'adapter does not support setting transaction isolation' end |
#exec_insert(sql, name = nil, binds = [], pk = nil, sequence_name = nil) ⇒ Object
SQLite driver doesn't support all types of insert statements with executeUpdate so make it act like a regular query and the ids will be returned from #last_inserted_id example: INSERT INTO "aircraft" DEFAULT VALUES
662 663 664 |
# File 'lib/arjdbc/sqlite3/adapter.rb', line 662 def exec_insert(sql, name = nil, binds = [], pk = nil, sequence_name = nil) exec_query(sql, name, binds) end |
#jdbc_column_class ⇒ Object
666 667 668 |
# File 'lib/arjdbc/sqlite3/adapter.rb', line 666 def jdbc_column_class ::ActiveRecord::ConnectionAdapters::SQLite3Column end |
#jdbc_connection_class(spec) ⇒ Object
670 671 672 |
# File 'lib/arjdbc/sqlite3/adapter.rb', line 670 def jdbc_connection_class(spec) self.class.jdbc_connection_class end |