ROM::Repository::Root

Parsed documentation:
View on GitHub
A specialized repository type dedicated to work with a root relation

This repository type builds commands and aggregates for its root relation

@example
  class UserRepo < ROM::Repository[:users]
    commands :create, update: :by_pk, delete: :by_pk
  end

  rom = ROM.container(:sql, 'sqlite::memory') do |conf|
    conf.default.create_table(:users) do
      primary_key :id
      column :name, String
    end
  end

  user_repo = UserRepo.new(rom)

  user = user_repo.create(name: "Jane")

  changeset = user_repo.changeset(user.id, name: "Jane Doe")
  user_repo.update(user.id, changeset)

  user_repo.delete(user.id)

@api public
No suggestions.
Please help! Open an issue on GitHub if this assessment is incorrect.