ant-storage 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/ant/storage/datasource/sequel.rb +13 -1
- data/lib/ant/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 74fcda92653cc31a0a6cb389e4020c909e1bba7a7faf87fa6d39da80af4a9729
|
4
|
+
data.tar.gz: 70510d3005f06d2bb7c05c818d6e5542c10dd1d0ec12dd1000f3abfc13ce0333
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9f1b8943c8e10058313a21ed9f336a90aaf0148b187515d7055e4fe38deafdfd8b48c7c6ff0b10e928f785f5ada4ceb10c38e9f0ae29b16056425ed401a6bbff
|
7
|
+
data.tar.gz: 8a192fe725fed89b7922a85897f093d90acc97c542d0169e0a510a9dabc0e52697725211b2379421726fae10f2222e94036adab66f71765df605cdb7d38d4367
|
@@ -8,6 +8,18 @@ module Ant
|
|
8
8
|
# Repository that fetch and store objects using a sequel connection
|
9
9
|
# as resource.
|
10
10
|
class Sequel < Repository
|
11
|
+
def self.from_config(conf)
|
12
|
+
conn = ::Sequel.connect(conf['endpoint'], conf)[conf['table'].to_sym]
|
13
|
+
if conf['schema'].nil?
|
14
|
+
# TODO: decouple use of classes
|
15
|
+
new(conn, conf['primary_key'].to_sym,
|
16
|
+
IDGenerators[:id])
|
17
|
+
else
|
18
|
+
# TODO: This line is very high coupled to ant-nanoservice
|
19
|
+
new(conn, conf['schema']::PRIMARY_KEY, IDGenerators[:id])
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
11
23
|
def initialize(sequel_object, id, id_generator)
|
12
24
|
@sequel = sequel_object
|
13
25
|
super(id, id_generator)
|
@@ -33,7 +45,7 @@ module Ant
|
|
33
45
|
end
|
34
46
|
|
35
47
|
def connection
|
36
|
-
@sequel
|
48
|
+
@sequel.db
|
37
49
|
end
|
38
50
|
end
|
39
51
|
end
|
data/lib/ant/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ant-storage
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gilberto Vargas
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-12-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ant-core
|
@@ -202,7 +202,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
202
202
|
- !ruby/object:Gem::Version
|
203
203
|
version: '0'
|
204
204
|
requirements: []
|
205
|
-
rubygems_version: 3.0.
|
205
|
+
rubygems_version: 3.0.1
|
206
206
|
signing_key:
|
207
207
|
specification_version: 4
|
208
208
|
summary: Implements storage modules for ant framework
|