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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e8b1eda40b515240bcaa7be394861f5ad1ef3649
4
- data.tar.gz: 7f80e07b8959230608617c66773030014f582bd8
3
+ metadata.gz: 2cc501e9623ab03b744d5b09b6d65bb6632c3dcb
4
+ data.tar.gz: 5f1a770213edd84b706d826bfb3f143a595a4ea0
5
5
  SHA512:
6
- metadata.gz: cc0b5254311cf5d3f70caa8f92d85fac969257712f199556984e4918faf59903ee4aeebcbed997581f5a1386b3f770759ca7fae55565239e3eb5e7844e3734a6
7
- data.tar.gz: 0ba2ee0e1fd520c1cfbea6dec5a2d53c46ab69d62efc9e6c76201cb080ea450bcd79aa17c39c824a1b3179e27ba01a5803a977ce1033de3d05c460c85d41db0b
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
- select * from
46
- (select *, last_value(occurred_at)
47
- over(partition by fully_qualified_name order by occurred_at
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
- 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
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]
@@ -1,3 +1,3 @@
1
1
  module EventStore
2
- VERSION = '0.5.3'
2
+ VERSION = '0.5.4'
3
3
  end
@@ -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([new_event[:occurred_at].to_i, other_event[:occurred_at].to_i])
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.3
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-19 00:00:00.000000000 Z
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.5
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