Sha256: 0aca88d12acb0a1c2e8c584bfcafe69ab0b3fe53efb1caa1905b6395d8844a56

Contents?: true

Size: 602 Bytes

Versions: 15

Compression:

Stored size: 602 Bytes

Contents

module DbCharmer
  module Sharding
    autoload :Connection, 'db_charmer/sharding/connection'
    autoload :StubConnection, 'db_charmer/sharding/stub_connection'
    autoload :Method, 'db_charmer/sharding/method'

    @@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

15 entries across 15 versions & 2 rubygems

Version Path
db-charmer-1.9.1 lib/db_charmer/sharding.rb
db-charmer-1.9.0 lib/db_charmer/sharding.rb
db-charmer-1.8.4 lib/db_charmer/sharding.rb
db-charmer-1.8.3 lib/db_charmer/sharding.rb
db-charmer-1.8.2 lib/db_charmer/sharding.rb
db-charmer-1.8.1 lib/db_charmer/sharding.rb
db-charmer-1.8.0 lib/db_charmer/sharding.rb
db-charmer-1.8.0.pre1 lib/db_charmer/sharding.rb
yam-db-charmer-1.7.01 lib/db_charmer/sharding.rb
db-charmer-1.7.1 lib/db_charmer/sharding.rb
db-charmer-1.7.0 lib/db_charmer/sharding.rb
db-charmer-1.7.0.pre7 lib/db_charmer/sharding.rb
db-charmer-1.7.0.pre6 lib/db_charmer/sharding.rb
db-charmer-1.7.0.pre5 lib/db_charmer/sharding.rb
db-charmer-1.7.0.pre4 lib/db_charmer/sharding.rb