nexia_event_store 0.5.3 → 0.5.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/event_store/event_stream.rb +9 -8
- data/lib/event_store/version.rb +1 -1
- data/spec/event_store/client_spec.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2cc501e9623ab03b744d5b09b6d65bb6632c3dcb
|
4
|
+
data.tar.gz: 5f1a770213edd84b706d826bfb3f143a595a4ea0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e17c78026daaa04b99cbb9c94f4347e068fe2003912a757705432d7c79e67e20eee6987424827031f0ced5ad9802a2b77f8b3d9759d0e8eae38567e4b6695acf
|
7
|
+
data.tar.gz: 68b5d31ff10d7b9ead75cb691c6ad870df1e112afe918946c3cc812e7dc45a682599dc0cbef1326ee593b86f975d8d9d3e0852b4123becec024aa305e28e68bb
|
@@ -42,15 +42,16 @@ module EventStore
|
|
42
42
|
timestampz = start_time.strftime("%Y-%m-%d %H:%M:%S%z")
|
43
43
|
names = fully_qualified_names.map { |n| "'#{n}'" }.join(',')
|
44
44
|
last_event_before_query = <<-EOSQL
|
45
|
-
|
46
|
-
(
|
47
|
-
|
45
|
+
SELECT * FROM
|
46
|
+
(SELECT *, LAST_VALUE(occurred_at)
|
47
|
+
OVER(PARTITION BY fully_qualified_name ORDER BY occurred_at
|
48
48
|
ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) as last
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
49
|
+
FROM #{@event_table}
|
50
|
+
WHERE aggregate_id = '#{@id}'
|
51
|
+
AND fully_qualified_name IN (#{names})
|
52
|
+
AND occurred_at < '#{timestampz}') AS subquery
|
53
|
+
WHERE occurred_at = last
|
54
|
+
ORDER BY occurred_at
|
54
55
|
EOSQL
|
55
56
|
|
56
57
|
query = EventStore.db[last_event_before_query]
|
data/lib/event_store/version.rb
CHANGED
@@ -395,7 +395,7 @@ describe EventStore::Client do
|
|
395
395
|
|
396
396
|
it "returns the latest event before the given time" do
|
397
397
|
last_events = client.last_event_before(newest_event_time, fqns)
|
398
|
-
expect(last_events.map{ |e| e.occurred_at.to_i}).to eq([
|
398
|
+
expect(last_events.map{ |e| e.occurred_at.to_i}).to eq([other_event[:occurred_at].to_i, new_event[:occurred_at].to_i])
|
399
399
|
end
|
400
400
|
end
|
401
401
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: nexia_event_store
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Paul Saieg, John Colvin
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2015-03-
|
12
|
+
date: 2015-03-24 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|
@@ -273,7 +273,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
273
273
|
version: '0'
|
274
274
|
requirements: []
|
275
275
|
rubyforge_project:
|
276
|
-
rubygems_version: 2.4.
|
276
|
+
rubygems_version: 2.4.2
|
277
277
|
signing_key:
|
278
278
|
specification_version: 4
|
279
279
|
summary: Ruby implementation of an EventSource (A+ES) for the Nexia Ecosystem
|