ruby_event_store-rom 0.33.0 → 0.34.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: cf7fcd100ff0863664f590d9ef69af407eed14c9585feb968f9f5500d37e0a8b
4
- data.tar.gz: 5f4cc0861cdccd36e5111eefb3142f28dcb6a340e0b9d3de41a2c99fb87b78c3
3
+ metadata.gz: b97f2d7af4c76d5a8ead68d3e0de13706ee3eef22aff89b00f893bc5eeb567e8
4
+ data.tar.gz: 866cb7371d871e67f6ec64ec95c1f43472f507821e65747edd7eccd12e7a1a90
5
5
  SHA512:
6
- metadata.gz: 0fa33ce4ece74345cb3a4efd2b31d270cb0ef569b0991d20f3be492ee892d9ef1bc52958509fb4968df2555a6b80195111a2cd5fc78c2d578e8ae876fae10484
7
- data.tar.gz: 612de166e303aa23350f86d6af73eea4c5c04dc921ab627817a07f56c640ef48987edfb60f6e6f649411e2d03ce3c5591c748147b5e5e81bb1843a95689713e2
6
+ metadata.gz: 8a1b09063c49c1fa846cbbf689096be665d863d7ac2f6ab4405cbc29033cdd19096be542db6bacb8f03f9a9733c83e05a7477473177e7b901695f66862b6b78a
7
+ data.tar.gz: 2e66057a6f000e66322a7085ae9e55e9b138200326c8860cabfdec53f0ebb0ed9301130dd3f3a252fab223ceedb7e6d621381835476c63a0dc001ed1f1c5faee
@@ -0,0 +1,9 @@
1
+ require 'rom/sql'
2
+
3
+ ::ROM::SQL.migration do
4
+ change do
5
+ alter_table(:event_store_events) do
6
+ add_index :event_type
7
+ end
8
+ end
9
+ end
@@ -15,6 +15,10 @@ module RubyEventStore
15
15
  end
16
16
  end
17
17
 
18
+ def for_events(events)
19
+ restrict(event_id: events.map { |e| e[:id] })
20
+ end
21
+
18
22
  auto_struct true
19
23
 
20
24
  SERIALIZED_GLOBAL_STREAM_NAME = 'all'.freeze
@@ -44,6 +48,10 @@ module RubyEventStore
44
48
  restrict(event_id: event_id)
45
49
  end
46
50
 
51
+ def by_event_type(types)
52
+ for_events(events.restrict(event_type: Array(types)))
53
+ end
54
+
47
55
  def by_stream_and_event_id(stream, event_id)
48
56
  restrict(stream: normalize_stream_name(stream), event_id: event_id).one!
49
57
  end
@@ -23,6 +23,10 @@ module RubyEventStore
23
23
  where(event_id: event_id)
24
24
  end
25
25
 
26
+ def by_event_type(types)
27
+ join(:events).where(event_type: types)
28
+ end
29
+
26
30
  def by_stream_and_event_id(stream, event_id)
27
31
  where(stream: normalize_stream_name(stream), event_id: event_id).one!
28
32
  end
@@ -57,6 +57,7 @@ module RubyEventStore
57
57
  query = stream_entries.ordered(direction, specification.stream, offset_entry_id)
58
58
 
59
59
  query = query.by_event_id(specification.with_ids) if specification.with_ids
60
+ query = query.by_event_type(specification.with_types) if specification.with_types?
60
61
 
61
62
  if specification.batched?
62
63
  reader = ->(offset, limit) do
@@ -1,5 +1,5 @@
1
1
  module RubyEventStore
2
2
  module ROM
3
- VERSION = "0.33.0"
3
+ VERSION = "0.34.0"
4
4
  end
5
5
  end
@@ -36,7 +36,7 @@ Gem::Specification.new do |spec|
36
36
  spec.add_development_dependency 'childprocess'
37
37
  spec.add_development_dependency 'google-protobuf', '~> 3.5.1.2'
38
38
 
39
- spec.add_dependency 'ruby_event_store', '= 0.33.0'
39
+ spec.add_dependency 'ruby_event_store', '= 0.34.0'
40
40
  spec.add_dependency 'sequel', '>= 4.49'
41
41
  spec.add_dependency 'dry-types', '~> 0.12.2'
42
42
  spec.add_dependency 'dry-initializer', '= 2.5.0'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby_event_store-rom
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.33.0
4
+ version: 0.34.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joel Van Horn
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-10-12 00:00:00.000000000 Z
11
+ date: 2018-11-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -156,14 +156,14 @@ dependencies:
156
156
  requirements:
157
157
  - - '='
158
158
  - !ruby/object:Gem::Version
159
- version: 0.33.0
159
+ version: 0.34.0
160
160
  type: :runtime
161
161
  prerelease: false
162
162
  version_requirements: !ruby/object:Gem::Requirement
163
163
  requirements:
164
164
  - - '='
165
165
  - !ruby/object:Gem::Version
166
- version: 0.33.0
166
+ version: 0.34.0
167
167
  - !ruby/object:Gem::Dependency
168
168
  name: sequel
169
169
  requirement: !ruby/object:Gem::Requirement
@@ -261,6 +261,7 @@ files:
261
261
  - README.md
262
262
  - Rakefile
263
263
  - db/migrate/20180327044629_create_ruby_event_store_tables.rb
264
+ - db/migrate/20181026152045_index_by_event_type.rb
264
265
  - lib/ruby_event_store-rom.rb
265
266
  - lib/ruby_event_store/rom.rb
266
267
  - lib/ruby_event_store/rom/adapters/memory/relations/events.rb
@@ -312,7 +313,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
312
313
  version: '0'
313
314
  requirements: []
314
315
  rubyforge_project:
315
- rubygems_version: 3.0.0.beta1
316
+ rubygems_version: 2.7.6
316
317
  signing_key:
317
318
  specification_version: 4
318
319
  summary: ROM events repository for Ruby Event Store