ductr-sqlite 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +5 -6
- data/ductr-sqlite.gemspec +1 -2
- data/lib/ductr/sqlite/basic_destination.rb +2 -2
- data/lib/ductr/sqlite/basic_lookup.rb +2 -2
- data/lib/ductr/sqlite/buffered_destination.rb +2 -2
- data/lib/ductr/sqlite/buffered_upsert_destination.rb +2 -2
- data/lib/ductr/sqlite/polling_trigger.rb +3 -3
- data/lib/ductr/sqlite/version.rb +1 -1
- metadata +7 -21
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b20f6f5d8519e762abed2f3670190bf090c5815cecac3fc5dfbd6b4ee8a453be
|
4
|
+
data.tar.gz: 3c420bcf4af7b56a6cda43acffb89fedabfcd1201967e38874bef29117fcec06
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2e6700133efa6e340f5fb425044dd131c3bf8413a71ac6406f45ac23589adc4f89e314a05aa952c573ab76462383e73edbd949140b8038403e55c2124a35c95b
|
7
|
+
data.tar.gz: cc4db5ca5dbc1ddb55e1d55827e7519f3b7dcae8850dc15389af6e1cd29d50bacf43d4f9cdbf0ce59911623cbfe4604b8357f67762d798099f57c8eafdc48e3c
|
data/Gemfile.lock
CHANGED
@@ -1,8 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
ductr-sqlite (0.1.
|
5
|
-
annotable (~> 0.1)
|
4
|
+
ductr-sqlite (0.1.2)
|
6
5
|
ductr (~> 0.1)
|
7
6
|
sequel (~> 5.66)
|
8
7
|
sqlite3 (~> 1.6)
|
@@ -26,7 +25,7 @@ GEM
|
|
26
25
|
concurrent-ruby (1.2.2)
|
27
26
|
diff-lcs (1.5.0)
|
28
27
|
docile (1.4.0)
|
29
|
-
ductr (0.1.
|
28
|
+
ductr (0.1.2)
|
30
29
|
activejob (~> 7.0)
|
31
30
|
annotable (~> 0.1)
|
32
31
|
colorize (~> 0.8)
|
@@ -84,7 +83,7 @@ GEM
|
|
84
83
|
rubocop-ast (>= 1.26.0, < 2.0)
|
85
84
|
ruby-progressbar (~> 1.7)
|
86
85
|
unicode-display_width (>= 2.4.0, < 3.0)
|
87
|
-
rubocop-ast (1.
|
86
|
+
rubocop-ast (1.28.0)
|
88
87
|
parser (>= 3.2.1.0)
|
89
88
|
rubocop-capybara (2.17.1)
|
90
89
|
rubocop (~> 1.41)
|
@@ -101,7 +100,7 @@ GEM
|
|
101
100
|
simplecov_json_formatter (~> 0.1)
|
102
101
|
simplecov-html (0.12.3)
|
103
102
|
simplecov_json_formatter (0.1.4)
|
104
|
-
sorbet-runtime (0.5.
|
103
|
+
sorbet-runtime (0.5.10736)
|
105
104
|
sord (4.0.0)
|
106
105
|
commander (~> 4.5)
|
107
106
|
parlour (~> 5.0)
|
@@ -132,4 +131,4 @@ DEPENDENCIES
|
|
132
131
|
yard (~> 0.9)
|
133
132
|
|
134
133
|
BUNDLED WITH
|
135
|
-
2.
|
134
|
+
2.4.8
|
data/ductr-sqlite.gemspec
CHANGED
@@ -10,7 +10,7 @@ Gem::Specification.new do |spec|
|
|
10
10
|
spec.licenses = ["LGPL-3.0-or-later"]
|
11
11
|
|
12
12
|
spec.summary = "SQLite adapter for Ductr using the `sequel` gem"
|
13
|
-
spec.description = "Allows
|
13
|
+
spec.description = "Allows ductr to interact with SQLite DMBS."
|
14
14
|
spec.homepage = "https://github.com/ductr-io/ductr"
|
15
15
|
spec.required_ruby_version = ">= 3.1.0"
|
16
16
|
|
@@ -32,7 +32,6 @@ Gem::Specification.new do |spec|
|
|
32
32
|
spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
|
33
33
|
spec.require_paths = ["lib"]
|
34
34
|
|
35
|
-
spec.add_dependency "annotable", "~> 0.1"
|
36
35
|
spec.add_dependency "ductr", "~> 0.1"
|
37
36
|
spec.add_dependency "sequel", "~> 5.66"
|
38
37
|
spec.add_dependency "sqlite3", "~> 1.6"
|
@@ -6,7 +6,7 @@ module Ductr
|
|
6
6
|
# A destination control that write rows one by one, registered as `:basic`:
|
7
7
|
#
|
8
8
|
# destination :some_sqlite_database, :basic
|
9
|
-
# def my_destination(
|
9
|
+
# def my_destination(db, row)
|
10
10
|
# db[:items].insert(row)
|
11
11
|
# end
|
12
12
|
#
|
@@ -21,7 +21,7 @@ module Ductr
|
|
21
21
|
# @return [void]
|
22
22
|
#
|
23
23
|
def write(row)
|
24
|
-
call_method(
|
24
|
+
call_method(adapter.db, row)
|
25
25
|
end
|
26
26
|
end
|
27
27
|
end
|
@@ -7,7 +7,7 @@ module Ductr
|
|
7
7
|
# The job's method must return a row which will merged with the current row:
|
8
8
|
#
|
9
9
|
# lookup :some_sqlite_database, :basic
|
10
|
-
# def my_lookup(
|
10
|
+
# def my_lookup(db, row)
|
11
11
|
# db[:items_bis].where(item: row[:id]).limit(1)
|
12
12
|
# end
|
13
13
|
#
|
@@ -27,7 +27,7 @@ module Ductr
|
|
27
27
|
# @return [Hash<Symbol, Object>] The row merged with looked up row or the untouched row if nothing was found
|
28
28
|
#
|
29
29
|
def process(row)
|
30
|
-
matching_row = call_method(
|
30
|
+
matching_row = call_method(adapter.db, row).first
|
31
31
|
return row unless matching_row
|
32
32
|
|
33
33
|
row.merge matching_row
|
@@ -7,7 +7,7 @@ module Ductr
|
|
7
7
|
# Accept the `:buffer_size` option, default value is 10 000:
|
8
8
|
#
|
9
9
|
# destination :some_sqlite_database, :buffered, buffer_size: 42
|
10
|
-
# def my_destination(
|
10
|
+
# def my_destination(db, buffer)
|
11
11
|
# db[:items].multi_insert(buffer)
|
12
12
|
# end
|
13
13
|
#
|
@@ -22,7 +22,7 @@ module Ductr
|
|
22
22
|
# @return [void]
|
23
23
|
#
|
24
24
|
def on_flush
|
25
|
-
call_method(
|
25
|
+
call_method(adapter.db, buffer)
|
26
26
|
end
|
27
27
|
end
|
28
28
|
end
|
@@ -7,7 +7,7 @@ module Ductr
|
|
7
7
|
# Accept the `:buffer_size` option, default value is 10 000:
|
8
8
|
#
|
9
9
|
# destination :some_sqlite_database, :buffered_upsert, buffer_size: 42
|
10
|
-
# def my_destination(
|
10
|
+
# def my_destination(db, excluded, buffer)
|
11
11
|
# db[:items].insert_conflict(target: :id, update: excluded).multi_insert(buffer)
|
12
12
|
# end
|
13
13
|
#
|
@@ -22,7 +22,7 @@ module Ductr
|
|
22
22
|
# @return [void]
|
23
23
|
#
|
24
24
|
def on_flush
|
25
|
-
call_method(
|
25
|
+
call_method(adapter.db, excluded, buffer)
|
26
26
|
end
|
27
27
|
|
28
28
|
private
|
@@ -33,13 +33,13 @@ module Ductr
|
|
33
33
|
# Returns a callable object, allowing rufus-scheduler to call it.
|
34
34
|
#
|
35
35
|
# @param [Ductr::Scheduler] scheduler The scheduler instance
|
36
|
-
# @param [
|
36
|
+
# @param [Method] method The scheduler's method
|
37
37
|
# @param [Hash] ** The option passed to the trigger annotation
|
38
38
|
#
|
39
39
|
# @return [#call] A callable object
|
40
40
|
#
|
41
|
-
def callable(
|
42
|
-
PollingHandler.new(
|
41
|
+
def callable(method, **)
|
42
|
+
PollingHandler.new(method, adapter)
|
43
43
|
end
|
44
44
|
end
|
45
45
|
end
|
data/lib/ductr/sqlite/version.rb
CHANGED
metadata
CHANGED
@@ -1,29 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ductr-sqlite
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mathieu MOREL
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-03-
|
11
|
+
date: 2023-03-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
|
-
- !ruby/object:Gem::Dependency
|
14
|
-
name: annotable
|
15
|
-
requirement: !ruby/object:Gem::Requirement
|
16
|
-
requirements:
|
17
|
-
- - "~>"
|
18
|
-
- !ruby/object:Gem::Version
|
19
|
-
version: '0.1'
|
20
|
-
type: :runtime
|
21
|
-
prerelease: false
|
22
|
-
version_requirements: !ruby/object:Gem::Requirement
|
23
|
-
requirements:
|
24
|
-
- - "~>"
|
25
|
-
- !ruby/object:Gem::Version
|
26
|
-
version: '0.1'
|
27
13
|
- !ruby/object:Gem::Dependency
|
28
14
|
name: ductr
|
29
15
|
requirement: !ruby/object:Gem::Requirement
|
@@ -178,7 +164,7 @@ dependencies:
|
|
178
164
|
- - "~>"
|
179
165
|
- !ruby/object:Gem::Version
|
180
166
|
version: '0.9'
|
181
|
-
description: Allows
|
167
|
+
description: Allows ductr to interact with SQLite DMBS.
|
182
168
|
email:
|
183
169
|
- mathieu@lamanufacture.dev
|
184
170
|
executables: []
|
@@ -220,7 +206,7 @@ metadata:
|
|
220
206
|
homepage_uri: https://github.com/ductr-io/ductr
|
221
207
|
source_code_uri: https://github.com/ductr-io/ductr
|
222
208
|
changelog_uri: https://github.com/ductr-io/ductr/releases
|
223
|
-
post_install_message:
|
209
|
+
post_install_message:
|
224
210
|
rdoc_options: []
|
225
211
|
require_paths:
|
226
212
|
- lib
|
@@ -235,8 +221,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
235
221
|
- !ruby/object:Gem::Version
|
236
222
|
version: '0'
|
237
223
|
requirements: []
|
238
|
-
rubygems_version: 3.
|
239
|
-
signing_key:
|
224
|
+
rubygems_version: 3.4.8
|
225
|
+
signing_key:
|
240
226
|
specification_version: 4
|
241
227
|
summary: SQLite adapter for Ductr using the `sequel` gem
|
242
228
|
test_files: []
|