Module: MultiDb::QueryCacheCompat

Included in:
ConnectionProxy
Defined in:
lib/multi_db/query_cache_compat.rb

Overview

Implements the methods expected by the QueryCache module

Instance Method Summary collapse

Instance Method Details

#columns(*a, &b) ⇒ Object



8
9
10
# File 'lib/multi_db/query_cache_compat.rb', line 8

def columns(*a, &b)
  send_to_current(:columns, *a, &b)
end

#delete(*a, &b) ⇒ Object



17
18
19
# File 'lib/multi_db/query_cache_compat.rb', line 17

def delete(*a, &b)
  send_to_master(:delete, *a, &b)
end

#insert(*a, &b) ⇒ Object



11
12
13
# File 'lib/multi_db/query_cache_compat.rb', line 11

def insert(*a, &b)
  send_to_master(:insert, *a, &b)
end

#select_all(*a, &b) ⇒ Object



4
5
6
7
# File 'lib/multi_db/query_cache_compat.rb', line 4

def select_all(*a, &b)
  next_reader! unless ConnectionProxy.sticky_slave
  send_to_current(:select_all, *a, &b)
end

#update(*a, &b) ⇒ Object



14
15
16
# File 'lib/multi_db/query_cache_compat.rb', line 14

def update(*a, &b)
  send_to_master(:update, *a, &b)
end