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.4.0.152 lib/sequel/extensions/slave.rb
umbrellio-sequel-plugins-0.4.0.145 lib/sequel/extensions/slave.rb
umbrellio-sequel-plugins-0.4.0.134 lib/sequel/extensions/slave.rb
umbrellio-sequel-plugins-0.4.0.121 lib/sequel/extensions/slave.rb
umbrellio-sequel-plugins-0.4.0.114 lib/sequel/extensions/slave.rb
umbrellio-sequel-plugins-0.4.0.112 lib/sequel/extensions/slave.rb
umbrellio-sequel-plugins-0.4.0.107 lib/sequel/extensions/slave.rb
umbrellio-sequel-plugins-0.4.0.81 lib/sequel/extensions/slave.rb
umbrellio-sequel-plugins-0.3.1.77 lib/sequel/extensions/slave.rb
umbrellio-sequel-plugins-0.3.1.69 lib/sequel/extensions/slave.rb
umbrellio-sequel-plugins-0.3.1.68 lib/sequel/extensions/slave.rb
umbrellio-sequel-plugins-0.3.0.67 lib/sequel/extensions/slave.rb
umbrellio-sequel-plugins-0.3.0.62 lib/sequel/extensions/slave.rb
umbrellio-sequel-plugins-0.3.0 lib/sequel/extensions/slave.rb
umbrellio-sequel-plugins-0.2.0 lib/sequel/extensions/slave.rb
umbrellio-sequel-plugins-0.1.2 lib/sequel/extensions/slave.rb
umbrellio-sequel-plugins-0.1.1 lib/sequel/extensions/slave.rb
umbrellio-sequel-plugins-0.1.0 lib/sequel/extensions/slave.rb