Sha256: 939617acf517b3fc3a5ec5168ec0ed59375b90f32fc2e1ebeb3574cc55c76d87

Contents?: true

Size: 387 Bytes

Versions: 58

Compression:

Stored size: 387 Bytes

Contents

# frozen_string_literal: true

module Sequel
  # Extension for choosing a slave server
  module Slave
    # Turn to slave
    #
    # @example
    #   DB[:users].slave.where(email: "test@test.com") # executes on a slave server
    # @return [Sequel::Dataset] dataset
    def slave
      server(:slave)
    end
  end

  Model.extend(Slave)
  Dataset.register_extension(:slave, Slave)
end

Version data entries

58 entries across 58 versions & 1 rubygems

Version Path
umbrellio-sequel-plugins-0.12.0.159 lib/sequel/extensions/slave.rb
umbrellio-sequel-plugins-0.11.0.143 lib/sequel/extensions/slave.rb
umbrellio-sequel-plugins-0.10.0.101 lib/sequel/extensions/slave.rb
umbrellio-sequel-plugins-0.10.0.100 lib/sequel/extensions/slave.rb
umbrellio-sequel-plugins-0.10.0.86 lib/sequel/extensions/slave.rb
umbrellio-sequel-plugins-0.9.0.79 lib/sequel/extensions/slave.rb
umbrellio-sequel-plugins-0.9.0.76 lib/sequel/extensions/slave.rb
umbrellio-sequel-plugins-0.8.0.73 lib/sequel/extensions/slave.rb
umbrellio-sequel-plugins-0.7.0.52 lib/sequel/extensions/slave.rb
umbrellio-sequel-plugins-0.6.0.46 lib/sequel/extensions/slave.rb
umbrellio-sequel-plugins-0.6.0 lib/sequel/extensions/slave.rb
umbrellio-sequel-plugins-0.6.0.36 lib/sequel/extensions/slave.rb
umbrellio-sequel-plugins-0.5.1.27 lib/sequel/extensions/slave.rb
umbrellio-sequel-plugins-0.5.1.26 lib/sequel/extensions/slave.rb
umbrellio-sequel-plugins-0.5.1.25 lib/sequel/extensions/slave.rb
umbrellio-sequel-plugins-0.5.1.18 lib/sequel/extensions/slave.rb
umbrellio-sequel-plugins-0.5.1.17 lib/sequel/extensions/slave.rb
umbrellio-sequel-plugins-0.5.1 lib/sequel/extensions/slave.rb
umbrellio-sequel-plugins-0.5.0 lib/sequel/extensions/slave.rb
umbrellio-sequel-plugins-0.4.0.164 lib/sequel/extensions/slave.rb