Class: Janus::QueryDirector
- Inherits:
-
Object
- Object
- Janus::QueryDirector
- Defined in:
- lib/janus-ar/query_director.rb
Constant Summary collapse
- ALL =
:all
- REPLICA =
:replica
- PRIMARY =
:primary
- SQL_PRIMARY_MATCHERS =
[ /\A\s*select.+for update\Z/i, /select.+lock in share mode\Z/i, /\A\s*select.+(nextval|currval|lastval|get_lock|release_lock|pg_advisory_lock|pg_advisory_unlock)\(/i, /\A\s*show/i ].freeze
- SQL_REPLICA_MATCHERS =
[/\A\s*(select|with.+\)\s*select)\s/i].freeze
- SQL_ALL_MATCHERS =
[/\A\s*set\s/i].freeze
- SQL_SKIP_ALL_MATCHERS =
[/\A\s*set\s+local\s/i].freeze
- WRITE_PREFIXES =
%w(INSERT UPDATE DELETE LOCK CREATE GRANT DROP ALTER TRUNCATE BEGIN SAVEPOINT FLUSH).freeze
Instance Method Summary collapse
-
#initialize(sql, open_transactions) ⇒ QueryDirector
constructor
A new instance of QueryDirector.
- #where_to_send? ⇒ Boolean
Constructor Details
#initialize(sql, open_transactions) ⇒ QueryDirector
Returns a new instance of QueryDirector.
18 19 20 21 |
# File 'lib/janus-ar/query_director.rb', line 18 def initialize(sql, open_transactions) @_sql = sql @_open_transactions = open_transactions end |