ductr-postgres 0.2.2 → 0.2.3
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 +4 -4
- data/lib/ductr/postgres/adapter.rb +15 -6
- data/lib/ductr/postgres/basic_destination.rb +1 -1
- data/lib/ductr/postgres/version.rb +1 -1
- data/sig/ductr/postgres.rbs +7 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6520956f9b414c8d7d5160d2372a918d3049eb6e2e77253ca452508873d2be53
|
4
|
+
data.tar.gz: ea1a31f688bac96edb6086979cb8971801d4627aee0f388ca446e7eba8146382
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a266df884d476d6959462c84163db5b4845b2b2f6bb410f0b787a9c87c22fb4312c3d281a646adc3c6a806710d3b95869da037992a1a33224742ece1a7a7ea57
|
7
|
+
data.tar.gz: b378256691dec18c7bf1cf037f616e75335bbb1bbe0eb99d9e08cd180974b5fd85f508472078142eb0a3967e56d39e20923bd8b2bd45428657cdc8c07acc562c
|
@@ -31,12 +31,7 @@ module Ductr
|
|
31
31
|
# @return [Sequel::Database] The database connection instance
|
32
32
|
#
|
33
33
|
def open!
|
34
|
-
@db =
|
35
|
-
|
36
|
-
@db.extension(:pg_streaming)
|
37
|
-
@db.stream_all_queries = true
|
38
|
-
|
39
|
-
@db
|
34
|
+
@db = new_connection
|
40
35
|
end
|
41
36
|
|
42
37
|
#
|
@@ -47,6 +42,20 @@ module Ductr
|
|
47
42
|
def close!
|
48
43
|
@db.disconnect
|
49
44
|
end
|
45
|
+
|
46
|
+
#
|
47
|
+
# Open a new connection, ensure to close it with the #disconnect method.
|
48
|
+
#
|
49
|
+
# @return [Sequel::Database] The database connection instance
|
50
|
+
#
|
51
|
+
def new_connection
|
52
|
+
db = Sequel.postgres(**config)
|
53
|
+
|
54
|
+
db.extension(:pg_streaming)
|
55
|
+
db.stream_all_queries = true
|
56
|
+
|
57
|
+
db
|
58
|
+
end
|
50
59
|
end
|
51
60
|
end
|
52
61
|
end
|
data/sig/ductr/postgres.rbs
CHANGED
@@ -49,6 +49,12 @@ module Ductr
|
|
49
49
|
|
50
50
|
# Closes the database connection.
|
51
51
|
def close!: () -> void
|
52
|
+
|
53
|
+
# sord warn - Sequel::Database wasn't able to be resolved to a constant in this project
|
54
|
+
# Open a new connection, ensure to close it with the #disconnect method.
|
55
|
+
#
|
56
|
+
# _@return_ — The database connection instance
|
57
|
+
def new_connection: () -> Sequel::Database
|
52
58
|
end
|
53
59
|
|
54
60
|
#
|
@@ -135,7 +141,7 @@ module Ductr
|
|
135
141
|
#
|
136
142
|
# destination :some_postgres_database, :basic
|
137
143
|
# def select_some_stuff(db, row)
|
138
|
-
# db[:items].update(row)
|
144
|
+
# db[:items].where(id: row[:id]).update(**row)
|
139
145
|
# end
|
140
146
|
class BasicDestination < Ductr::SequelBase::BasicDestination
|
141
147
|
end
|