sandthorn_driver_sequel 1.0.5 → 1.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.autotest +3 -0
- data/.travis.yml +4 -0
- data/README.md +4 -2
- data/Rakefile +4 -1
- data/lib/sandthorn_driver_sequel/event_store.rb +4 -7
- data/lib/sandthorn_driver_sequel/version.rb +1 -1
- data/sandthorn_driver_sequel.gemspec +1 -0
- data/spec/benchmark_spec.rb +1 -1
- data/spec/db/.keep +0 -0
- data/spec/get_events_spec.rb +3 -3
- data/spec/spec_helper.rb +5 -0
- metadata +20 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1afb165a1182b4ca32503c6cd50e457dc3a463ec
|
4
|
+
data.tar.gz: 0564b8de514327e5216d9e5c40b9afeee4cd013d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 709c4d3a672d0b9c796ad635929d538137e67117c333724a6aec5d423a62d0fc7a48512e351a65cee3a268b3ef8749efc2eeb201819b2799bc930e5a850defa1
|
7
|
+
data.tar.gz: 37136fed39a9701ddbaf558e4f188321f5078f943f7233153ffe69265ac8daac425e3862f553c5055ff36eb1f62a0cd326ae1fdf974c744e22b79f9576be0a8c
|
data/.autotest
ADDED
data/.travis.yml
ADDED
data/README.md
CHANGED
@@ -1,6 +1,8 @@
|
|
1
|
-
|
1
|
+
[![Code Climate](https://codeclimate.com/github/Sandthorn/sandthorn_driver_sequel.png)](https://codeclimate.com/github/Sandthorn/sandthorn_driver_sequel)
|
2
2
|
|
3
|
-
|
3
|
+
# Sandthorn Sequel-driver
|
4
|
+
|
5
|
+
A SQL database driver for [Sandthorn](https://github.com/Sandthorn/sandthorn), made with [Sequel](http://sequel.jeremyevans.net/).
|
4
6
|
|
5
7
|
## Installation
|
6
8
|
|
data/Rakefile
CHANGED
@@ -116,13 +116,10 @@ module SandthornDriverSequel
|
|
116
116
|
return query.order(:sequence_number).all
|
117
117
|
end
|
118
118
|
end
|
119
|
-
def get_events
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
include_events = args.fetch(:include_events, []).collect { |e| e.to_s }
|
124
|
-
exclude_events = args.fetch(:exclude_events, []).collect { |e| e.to_s }
|
125
|
-
aggregate_types = classes.collect { |e| e.to_s }
|
119
|
+
def get_events aggregate_types: [], take: 0, after_sequence_number: 0, include_events: [], exclude_events: []
|
120
|
+
include_events = include_events.map { |e| e.to_s }
|
121
|
+
exclude_events = exclude_events.map { |e| e.to_s }
|
122
|
+
aggregate_types = aggregate_types.map { |e| e.to_s }
|
126
123
|
driver.execute do |db|
|
127
124
|
if aggregate_types.empty?
|
128
125
|
query = db[events_table_name].join(aggregates_table_name, id: :aggregate_table_id)
|
@@ -22,6 +22,7 @@ Gem::Specification.new do |spec|
|
|
22
22
|
spec.add_development_dependency "rake"
|
23
23
|
|
24
24
|
spec.add_development_dependency "rspec"
|
25
|
+
spec.add_development_dependency "coveralls"
|
25
26
|
spec.add_development_dependency "gem-release"
|
26
27
|
spec.add_development_dependency "sqlite3"
|
27
28
|
spec.add_development_dependency "pry"
|
data/spec/benchmark_spec.rb
CHANGED
data/spec/db/.keep
ADDED
File without changes
|
data/spec/get_events_spec.rb
CHANGED
@@ -71,7 +71,7 @@ module SandthornDriverSequel
|
|
71
71
|
end
|
72
72
|
end
|
73
73
|
context "and getting events of type :new and foo" do
|
74
|
-
let(:events) {event_store.get_events after_sequence_number: 0,
|
74
|
+
let(:events) {event_store.get_events after_sequence_number: 0, aggregate_types: ["String", SandthornDriverSequel::EventStore], include_events: [:new, "foo"]}
|
75
75
|
it "should find 3 events" do
|
76
76
|
events.length.should eql 3
|
77
77
|
end
|
@@ -80,7 +80,7 @@ module SandthornDriverSequel
|
|
80
80
|
end
|
81
81
|
end
|
82
82
|
context "and getting events for SandthornDriverSequel::EventStore, and String after 0" do
|
83
|
-
let(:events) {event_store.get_events after_sequence_number: 0,
|
83
|
+
let(:events) {event_store.get_events after_sequence_number: 0, aggregate_types: [SandthornDriverSequel::EventStore, String]}
|
84
84
|
it "should find 5 events" do
|
85
85
|
events.length.should eql 5
|
86
86
|
end
|
@@ -93,7 +93,7 @@ module SandthornDriverSequel
|
|
93
93
|
end
|
94
94
|
end
|
95
95
|
context "and getting events for SandthornDriverSequel::EventStore after 0" do
|
96
|
-
let(:events) {event_store.get_events after_sequence_number: 0,
|
96
|
+
let(:events) {event_store.get_events after_sequence_number: 0, aggregate_types: [SandthornDriverSequel::EventStore]}
|
97
97
|
it "should find 3 events" do
|
98
98
|
events.length.should eql 3
|
99
99
|
end
|
data/spec/spec_helper.rb
CHANGED
@@ -1,7 +1,11 @@
|
|
1
|
+
require 'coveralls'
|
1
2
|
require 'sandthorn_driver_sequel'
|
2
3
|
require 'sandthorn_driver_sequel/migration'
|
3
4
|
require 'ap'
|
4
5
|
require 'uuidtools'
|
6
|
+
|
7
|
+
Bundler.require
|
8
|
+
Coveralls.wear!
|
5
9
|
# This file was generated by the `rspec --init` command. Conventionally, all
|
6
10
|
# specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`.
|
7
11
|
# Require this file using `require "spec_helper"` to ensure that it is only
|
@@ -12,6 +16,7 @@ RSpec.configure do |config|
|
|
12
16
|
config.treat_symbols_as_metadata_keys_with_true_values = true
|
13
17
|
config.run_all_when_everything_filtered = true
|
14
18
|
config.filter_run :focus
|
19
|
+
config.filter_run_excluding benchmark: true
|
15
20
|
config.order = 'random'
|
16
21
|
end
|
17
22
|
def prepare_for_test context: :test
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sandthorn_driver_sequel
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Lars Krantz
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-
|
12
|
+
date: 2014-04-08 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|
@@ -53,6 +53,20 @@ dependencies:
|
|
53
53
|
- - ">="
|
54
54
|
- !ruby/object:Gem::Version
|
55
55
|
version: '0'
|
56
|
+
- !ruby/object:Gem::Dependency
|
57
|
+
name: coveralls
|
58
|
+
requirement: !ruby/object:Gem::Requirement
|
59
|
+
requirements:
|
60
|
+
- - ">="
|
61
|
+
- !ruby/object:Gem::Version
|
62
|
+
version: '0'
|
63
|
+
type: :development
|
64
|
+
prerelease: false
|
65
|
+
version_requirements: !ruby/object:Gem::Requirement
|
66
|
+
requirements:
|
67
|
+
- - ">="
|
68
|
+
- !ruby/object:Gem::Version
|
69
|
+
version: '0'
|
56
70
|
- !ruby/object:Gem::Dependency
|
57
71
|
name: gem-release
|
58
72
|
requirement: !ruby/object:Gem::Requirement
|
@@ -229,10 +243,12 @@ executables: []
|
|
229
243
|
extensions: []
|
230
244
|
extra_rdoc_files: []
|
231
245
|
files:
|
246
|
+
- ".autotest"
|
232
247
|
- ".gitignore"
|
233
248
|
- ".rspec"
|
234
249
|
- ".ruby-gemset"
|
235
250
|
- ".ruby-version"
|
251
|
+
- ".travis.yml"
|
236
252
|
- Gemfile
|
237
253
|
- LICENSE.txt
|
238
254
|
- README.md
|
@@ -247,6 +263,7 @@ files:
|
|
247
263
|
- sandthorn_driver_sequel.gemspec
|
248
264
|
- spec/asking_for_aggregates_to_snapshot_spec.rb
|
249
265
|
- spec/benchmark_spec.rb
|
266
|
+
- spec/db/.keep
|
250
267
|
- spec/driver_interface_spec.rb
|
251
268
|
- spec/event_store_with_context_spec.rb
|
252
269
|
- spec/get_events_spec.rb
|
@@ -281,6 +298,7 @@ summary: sequel driver for sandthorn
|
|
281
298
|
test_files:
|
282
299
|
- spec/asking_for_aggregates_to_snapshot_spec.rb
|
283
300
|
- spec/benchmark_spec.rb
|
301
|
+
- spec/db/.keep
|
284
302
|
- spec/driver_interface_spec.rb
|
285
303
|
- spec/event_store_with_context_spec.rb
|
286
304
|
- spec/get_events_spec.rb
|