Sha256: d185f833fc878362e22e683699417f9851de30a0f194383f8316147b281b6b96

Contents?: true

Size: 1.06 KB

Versions: 1

Compression:

Stored size: 1.06 KB

Contents

module DataMapper
  module Adapters
    module Tokyo

      # A DataMapper Tokyo Tyrant table store adapter.
      #
      # http://tokyocabinet.sourceforge.net/tyrantdoc/
      # http://tokyocabinet.sourceforge.net/spex-en.html#features_tctdb
      #
      # The Tokyo Cabinet table storage engine doesn't require a predefined schema and as such properties in your
      # resource are only used by the adapter for typecasting. There is no need to migrate your resource when you
      # create, update or delete properties.
      #
      # == See
      #
      # DataMapper::Adapters::Tokyo::Query:: Table Query.
      class TyrantAdapter < Tokyo::CabinetAdapter
        protected

          #--
          # TODO: Default port to 1978?
          def create_connection(model)
            credentials = [@options[:socket] || @options.values_at(:host, :port)]
            Rufus::Tokyo::TyrantTable.new(*credentials.flatten)
          end
      end # TyrantAdapter
    end # Tokyo

    TokyoTyrantAdapter = Tokyo::TyrantAdapter
    const_added(:TokyoTyrantAdapter)
  end # Adapters
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
dm-tokyo-adapter-0.4.1 lib/dm-tokyo-adapter/tyrant.rb