module Sequel::Plugins::Sharding::DatasetMethods

Public Instance Methods

server(s) click to toggle source

If a row proc exists on the dataset, replace it with one that calls the previous row_proc, but calls set_server on the output of that row_proc, ensuring that objects retrieved by a specific shard know which shard they are tied to.

Calls superclass method
    # File lib/sequel/plugins/sharding.rb
110 def server(s)
111   ds = super
112   if rp = row_proc
113     ds = ds.with_row_proc(proc{|r| rp.call(r).set_server(s)})
114   end
115   ds
116 end