Sha256: 7fec65dad23b02361ab28a75367a6544530454f36a5bfabacb0b9b0c0f63e2f6

Contents?: true

Size: 1.84 KB

Versions: 16

Compression:

Stored size: 1.84 KB

Contents

# frozen_string_literal: true
module Valkyrie
  # This is a namespacing module for metadata persisters as per the DataMapper pattern
  #  https://en.wikipedia.org/wiki/Data_mapper_pattern
  #
  # @note These persisters do not store binary content.
  #       See Valkyrie::Storage for persisting binary content (files).
  #
  # @example Register persisters in an initializer using Valkyrie::MetadataAdapter.register
  #   Valkyrie::MetadataAdapter.register(
  #     Valkyrie::Persistence::Memory::MetadataAdapter.new,
  #     :memory
  #   )
  #
  # @example Retrieve a registered persister using Valkyrie::MetadataAdapter.find
  #   Valkyrie::MetadataAdapter.find(:memory)
  #   => <Valkyrie::Persistence::Memory::MetadataAdapter:0x007fa6ec031bd8>
  #
  # @example Saving an object
  #
  #   object1 = MyModel.new title: 'My Cool Object', authors: ['Jones, Alice', 'Smith, Bob']
  #   object1 = Valkyrie.config.metadata_adapter.persister.save(model: object1)
  #
  # @see https://github.com/samvera-labs/valkyrie/wiki/Persistence
  # @see lib/valkyrie/specs/shared_specs/persister.rb
  #
  module Persistence
    require 'valkyrie/persistence/optimistic_lock_token'
    require 'valkyrie/persistence/custom_query_container'
    require 'valkyrie/persistence/memory'
    require 'valkyrie/persistence/composite_persister'
    require 'valkyrie/persistence/delete_tracking_buffer'
    require 'valkyrie/persistence/buffered_persister'
    require 'valkyrie/persistence/shared'
    autoload :Postgres, 'valkyrie/persistence/postgres'
    autoload :Solr, 'valkyrie/persistence/solr'
    autoload :Fedora, 'valkyrie/persistence/fedora'
    class ObjectNotFoundError < StandardError
    end

    class UnsupportedDatatype < StandardError
    end

    class StaleObjectError < StandardError
    end

    module Attributes
      OPTIMISTIC_LOCK = :optimistic_lock_token
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
valkyrie-3.5.0 lib/valkyrie/persistence.rb
valkyrie-3.4.0 lib/valkyrie/persistence.rb
valkyrie-3.3.0 lib/valkyrie/persistence.rb
valkyrie-3.1.5 lib/valkyrie/persistence.rb
valkyrie-3.1.4 lib/valkyrie/persistence.rb
valkyrie-3.1.3 lib/valkyrie/persistence.rb
valkyrie-3.1.2 lib/valkyrie/persistence.rb
valkyrie-3.1.1 lib/valkyrie/persistence.rb
valkyrie-3.1.0 lib/valkyrie/persistence.rb
valkyrie-3.0.3 lib/valkyrie/persistence.rb
valkyrie-3.0.2 lib/valkyrie/persistence.rb
valkyrie-3.0.1 lib/valkyrie/persistence.rb
valkyrie-3.0.0 lib/valkyrie/persistence.rb
valkyrie-3.0.0.pre.rc.1 lib/valkyrie/persistence.rb
valkyrie-3.0.0.pre.beta.3 lib/valkyrie/persistence.rb
valkyrie-3.0.0.pre.beta.2 lib/valkyrie/persistence.rb