Module: RubyEventStore::ROM

Defined in:
lib/ruby_event_store/rom.rb,
lib/ruby_event_store/rom/types.rb,
lib/ruby_event_store/rom/version.rb,
lib/ruby_event_store/rom/unit_of_work.rb,
lib/ruby_event_store/rom/event_repository.rb,
lib/ruby_event_store/rom/relations/events.rb,
lib/ruby_event_store/rom/repositories/events.rb,
lib/ruby_event_store/rom/changesets/create_events.rb,
lib/ruby_event_store/rom/changesets/update_events.rb,
lib/ruby_event_store/rom/index_violation_detector.rb,
lib/ruby_event_store/rom/relations/stream_entries.rb,
lib/ruby_event_store/rom/repositories/stream_entries.rb,
lib/ruby_event_store/rom/changesets/create_stream_entries.rb,
lib/ruby_event_store/rom/mappers/event_to_serialized_record.rb,
lib/ruby_event_store/rom/mappers/stream_entry_to_serialized_record.rb

Defined Under Namespace

Modules: Changesets, Mappers, Relations, Repositories, Types Classes: EventRepository, IndexViolationDetector, UnitOfWork

Constant Summary collapse

VERSION =
"2.2.0"

Class Method Summary collapse

Class Method Details

.rom_container(adapter_name, database_uri, &block) ⇒ Object



34
35
36
37
38
39
40
# File 'lib/ruby_event_store/rom.rb', line 34

def rom_container(adapter_name, database_uri, &block)
  if adapter_name.is_a?(::ROM::Configuration)
    ::ROM.container(adapter_name.tap(&block), &block)
  else
    ::ROM.container(adapter_name, database_uri, &block)
  end
end

.setup(adapter_name, database_uri = ENV["DATABASE_URL"]) ⇒ Object



25
26
27
28
29
30
31
32
# File 'lib/ruby_event_store/rom.rb', line 25

def setup(adapter_name, database_uri = ENV["DATABASE_URL"])
  rom_container(adapter_name, database_uri) do |rom|
    rom.register_mapper Mappers::StreamEntryToSerializedRecord
    rom.register_mapper Mappers::EventToSerializedRecord
    rom.register_relation Relations::Events
    rom.register_relation Relations::StreamEntries
  end
end