Skip to content

Commit

Permalink
document monotonic_id_batch_reader better
Browse files Browse the repository at this point in the history
WHERE clause is present in the 2nd query
the first query do not need any condition
  • Loading branch information
pjurewicz committed Dec 7, 2023
1 parent 6cfa14f commit a72a3f6
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions ruby_event_store-active_record/spec/event_repository_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ module ActiveRecord

it_behaves_like :event_repository, mk_repository, helper


let(:repository) { mk_repository.call }
let(:specification) do
Specification.new(
Expand Down Expand Up @@ -236,9 +235,12 @@ module ActiveRecord
ExpectedVersion.any
)

expect {
repository.read(specification.in_batches(3).result).to_a
}.to match_query /SELECT.*FROM.*event_store_events.*WHERE.*event_store_events.id >*.*ORDER BY .*event_store_events.*id.* ASC LIMIT.*/
::ActiveRecord::Base.logger = Logger.new(STDOUT)

This comment has been minimized.

Copy link
@mostlyobvious

mostlyobvious Dec 7, 2023

Member

🙃

expect do
expect do
repository.read(specification.in_batches(3).result).to_a
end.to match_query /SELECT.*FROM .event_store_events. ORDER BY .event_store_events.\..id. ASC LIMIT/
end.to match_query /SELECT.*FROM .event_store_events. WHERE .event_store_events\.id >.* ORDER BY .event_store_events.\..id. ASC LIMIT/
end

specify "produces expected query for position in stream call" do
Expand Down

0 comments on commit a72a3f6

Please sign in to comment.