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.17.0 lib/sequel/extensions/slave.rb
umbrellio-sequel-plugins-0.16.1 lib/sequel/extensions/slave.rb
umbrellio-sequel-plugins-0.16.0.239 lib/sequel/extensions/slave.rb
umbrellio-sequel-plugins-0.16.0.238 lib/sequel/extensions/slave.rb
umbrellio-sequel-plugins-0.16.0.235 lib/sequel/extensions/slave.rb
umbrellio-sequel-plugins-0.16.0.234 lib/sequel/extensions/slave.rb
umbrellio-sequel-plugins-0.16.0.233 lib/sequel/extensions/slave.rb
umbrellio-sequel-plugins-0.16.0 lib/sequel/extensions/slave.rb
umbrellio-sequel-plugins-0.16.0.211 lib/sequel/extensions/slave.rb
umbrellio-sequel-plugins-0.15.0.198 lib/sequel/extensions/slave.rb
umbrellio-sequel-plugins-0.14.0.192 lib/sequel/extensions/slave.rb
umbrellio-sequel-plugins-0.14.0.189 lib/sequel/extensions/slave.rb
umbrellio-sequel-plugins-0.14.0.188 lib/sequel/extensions/slave.rb
umbrellio-sequel-plugins-0.14.0.187 lib/sequel/extensions/slave.rb
umbrellio-sequel-plugins-0.14.0 lib/sequel/extensions/slave.rb
umbrellio-sequel-plugins-0.13.0.185 lib/sequel/extensions/slave.rb
umbrellio-sequel-plugins-0.13.0.172 lib/sequel/extensions/slave.rb
umbrellio-sequel-plugins-0.13.0 lib/sequel/extensions/slave.rb
umbrellio-sequel-plugins-0.12.0.169 lib/sequel/extensions/slave.rb
umbrellio-sequel-plugins-0.12.0 lib/sequel/extensions/slave.rb