Class: Sequel::SchemaSharding::DatabaseManager::SchemaIterator

Inherits:
Object
  • Object
show all
Defined in:
lib/sequel/schema-sharding/database_manager/schema_iterator.rb

Instance Method Summary collapse

Instance Method Details

#iterate_on(table_name, &block) ⇒ Object



2
3
4
5
6
7
8
9
# File 'lib/sequel/schema-sharding/database_manager/schema_iterator.rb', line 2

def iterate_on(table_name, &block)
  config.logical_shard_configs(table_name).each_pair do |shard_number, physical_shard|
    schema_name = connection_manager.schema_for(table_name, shard_number)
    connection = connection_manager.master(physical_shard)

    yield connection, schema_name, table_name
  end
end