module Sequel::Plugins::Sharding::ClassMethods

def create_using_server(s, values={}, &block)

Create a new object on the given shard s.
def create_using_server(s, values={}, &block)
  new_using_server(s, values, &block).save
end

def eager_graph_dataset(opts, eager_options)

unless the graphed dataset already has a server set.
Set the server for each graphed dataset to the current server
def eager_graph_dataset(opts, eager_options)
  ds = super
  if s = eager_options[:self].opts[:server]
    ds = ds.server(s) unless ds.opts[:server]
  end
  ds
end

def eager_loading_dataset(opts, ds, select, associations, eager_options={})

use the current dataset's shard for the associated dataset.
dataset that you will be using to get the associated records does not,
When eagerly loading, if the current dataset has a defined shard and the
def eager_loading_dataset(opts, ds, select, associations, eager_options={})
  ds = super(opts, ds, select, associations, eager_options)
  if !ds.opts[:server] and s = eager_options[:self] and server = s.opts[:server]
    ds = ds.server(server)
  end
  ds
end

def new_using_server(s, values={}, &block)

on shard s.
shard s. When the object is saved, a record will be inserted
Return a newly instantiated object that is tied to the given
def new_using_server(s, values={}, &block)
  new(values, &block).set_server(s)
end