Class: ActiveRecord::ConnectionAdapters::MakaraAbstractAdapter
- Inherits:
-
Makara::Proxy
- Object
- SimpleDelegator
- Makara::Proxy
- ActiveRecord::ConnectionAdapters::MakaraAbstractAdapter
- Defined in:
- lib/active_record/connection_adapters/makara_abstract_adapter.rb
Direct Known Subclasses
Defined Under Namespace
Classes: ErrorHandler
Constant Summary collapse
- SQL_MASTER_MATCHERS =
[/\A\s*select.+for update\Z/i, /select.+lock in share mode\Z/i].map(&:freeze).freeze
- SQL_SLAVE_MATCHERS =
[/\A\s*select\s/i].map(&:freeze).freeze
- SQL_ALL_MATCHERS =
[/\A\s*set\s/i].map(&:freeze).freeze
- SQL_SKIP_STICKINESS_MATCHERS =
[/\A\s*show\s([\w]+\s)?(field|table|database|schema|view|index)(es|s)?/i, /\A\s*(set|describe|explain|pragma)\s/i].map(&:freeze).freeze
Constants inherited from Makara::Proxy
Makara::Proxy::METHOD_MISSING_SKIP
Instance Attribute Summary
Attributes inherited from Makara::Proxy
#config_parser, #error_handler, #sticky
Instance Method Summary collapse
-
#initialize(config) ⇒ MakaraAbstractAdapter
constructor
A new instance of MakaraAbstractAdapter.
- #sql_all_matchers ⇒ Object
- #sql_master_matchers ⇒ Object
- #sql_skip_stickiness_matchers ⇒ Object
- #sql_slave_matchers ⇒ Object
Methods inherited from Makara::Proxy
#disconnect!, #graceful_connection_for, hijack_method, #hijacked?, #method_missing, send_to_all, #stick_to_master!, #strategy_for, #without_sticking
Constructor Details
#initialize(config) ⇒ MakaraAbstractAdapter
Returns a new instance of MakaraAbstractAdapter.
137 138 139 140 |
# File 'lib/active_record/connection_adapters/makara_abstract_adapter.rb', line 137 def initialize(config) @error_handler = ::ActiveRecord::ConnectionAdapters::MakaraAbstractAdapter::ErrorHandler.new super(config) end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Makara::Proxy
Instance Method Details
#sql_all_matchers ⇒ Object
127 128 129 |
# File 'lib/active_record/connection_adapters/makara_abstract_adapter.rb', line 127 def sql_all_matchers SQL_ALL_MATCHERS end |
#sql_master_matchers ⇒ Object
117 118 119 |
# File 'lib/active_record/connection_adapters/makara_abstract_adapter.rb', line 117 def sql_master_matchers SQL_MASTER_MATCHERS end |
#sql_skip_stickiness_matchers ⇒ Object
132 133 134 |
# File 'lib/active_record/connection_adapters/makara_abstract_adapter.rb', line 132 def sql_skip_stickiness_matchers SQL_SKIP_STICKINESS_MATCHERS end |
#sql_slave_matchers ⇒ Object
122 123 124 |
# File 'lib/active_record/connection_adapters/makara_abstract_adapter.rb', line 122 def sql_slave_matchers SQL_SLAVE_MATCHERS end |