Module Sequel::Plugins::Sharding::ClassMethods
In: lib/sequel/plugins/sharding.rb

Methods

Public Instance methods

Create a new object on the given shard s.

[Source]

    # File lib/sequel/plugins/sharding.rb, line 22
22:         def create_using_server(s, values={}, &block)
23:           new_using_server(s, values, &block).save
24:         end

When eagerly loading, if the current dataset has a defined shard and the dataset that you will be using to get the associated records does not, use the current dataset‘s shard for the associated dataset.

[Source]

    # File lib/sequel/plugins/sharding.rb, line 29
29:         def eager_loading_dataset(opts, ds, select, associations, eager_options={})
30:           ds = super(opts, ds, select, associations, eager_options)
31:           if !ds.opts[:server] and s = eager_options[:self] and server = s.opts[:server]
32:             ds = ds.server(server)
33:           end
34:           ds
35:         end

Return a newly instantiated object that is tied to the given shard s. When the object is saved, a record will be inserted on shard s.

[Source]

    # File lib/sequel/plugins/sharding.rb, line 40
40:         def new_using_server(s, values={}, &block)
41:           new(values, &block).set_server(s)
42:         end

[Validate]