Module: ActiveRecord::ShardFor

Defined in:
lib/activerecord/shard_for/all_shards_in_parallel.rb,
lib/activerecord/shard_for.rb,
lib/activerecord/shard_for/sti.rb,
lib/activerecord/shard_for/model.rb,
lib/activerecord/shard_for/patch.rb,
lib/activerecord/shard_for/config.rb,
lib/activerecord/shard_for/errors.rb,
lib/activerecord/shard_for/railtie.rb,
lib/activerecord/shard_for/version.rb,
lib/activerecord/shard_for/cluster_config.rb,
lib/activerecord/shard_for/database_tasks.rb,
lib/activerecord/shard_for/distkey_router.rb,
lib/activerecord/shard_for/shard_repository.rb,
lib/activerecord/shard_for/connection_router.rb,
lib/activerecord/shard_for/hash_modulo_router.rb,
lib/activerecord/shard_for/replication_mapping.rb,
lib/activerecord/shard_for/sti_shard_repository.rb,
lib/activerecord/shard_for/abstract_shard_repository.rb

Overview

Support parallel execution with each shard and deal with AR connection management in parallel execution.

Defined Under Namespace

Modules: DatabaseTasks, Model, Patch, STI Classes: AbstractShardRepository, AllShardsInParallel, ClusterConfig, Config, ConnectionRouter, DistkeyRouter, Error, HashModuloRouter, MissingDistkeyAttribute, Railtie, RecordNotFound, ReplicationMapping, STIShardRepository, ShardRepository

Constant Summary collapse

VERSION =
'0.7.0'.freeze

Class Method Summary collapse

Class Method Details

.configActiverecord::ShardFor::Config

Returns:

  • (Activerecord::ShardFor::Config)


25
26
27
# File 'lib/activerecord/shard_for.rb', line 25

def config
  @config ||= Config.new
end

.configure {|Activerecord::ShardFor::Config| ... } ⇒ Object

Yields:

  • (Activerecord::ShardFor::Config)


30
31
32
# File 'lib/activerecord/shard_for.rb', line 30

def configure(&block)
  config.instance_eval(&block)
end