Module: Sequel::Plugins::Sharding
- Defined in:
- lib/sequel/plugins/sharding.rb
Overview
The sharding plugin makes it easy to use Sequel’s sharding features with models. It lets you create model objects on specific shards, and any models retrieved from specific shards are automatically saved back to those shards. It also works with associations, so that model objects retrieved from specific shards will only return associated objects from that shard, and using the add/remove/remove_all association methods will only affect that shard.
Usage:
# Add the sharding support to all model subclasses (called before loading subclasses)
Sequel::Model.plugin :sharding
# Add the sharding support to the Album class
Album.plugin :sharding
Defined Under Namespace
Modules: ClassMethods, DatasetMethods, InstanceMethods