Sha256: 739b7056e34b52858a83921250455198563a03f8828c88ec479008c3e718915d

Contents?: true

Size: 424 Bytes

Versions: 3

Compression:

Stored size: 424 Bytes

Contents

module DbCharmer
  module Sharding
    @@sharded_connections = {}

    def self.register_connection(config)
      name = config[:name] or raise ArgumentError, "No :name in connection!"
      @@sharded_connections[name] = DbCharmer::Sharding::Connection.new(config)
    end

    def self.sharded_connection(name)
      @@sharded_connections[name] or raise ArgumentError, "Invalid sharded connection name!"
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
db-charmer-1.7.0.pre3 lib/db_charmer/sharding.rb
db-charmer-1.7.0.pre2 lib/db_charmer/sharding.rb
db-charmer-1.7.0.pre1 lib/db_charmer/sharding.rb