jredshift 0.0.2 → 0.0.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/jredshift/jdbc_db.rb +10 -1
- data/lib/jredshift/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: db12692389bfe5cda6bc08190d017ee7f33cdefe
|
|
4
|
+
data.tar.gz: bbf2bdcec247bd3b00917833efe587370f1d2b87
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 3f836191c700760f02067bde54291d5cce3ac06596820f42d718100f85e02f178c9b6513f48fb2e779b4298af6aac631a839139bc5d5e2ba8f7e331c7460ac11
|
|
7
|
+
data.tar.gz: 5c30e5fb096f78fae249ef390f85cbd2683716756c89acffc2a9e88f15552e5941e02ee0c8bb264366f5fee14c6c148c9e0ffd1a70a024535829f3c9ed4c9069
|
data/lib/jredshift/jdbc_db.rb
CHANGED
|
@@ -23,10 +23,13 @@ module Jredshift
|
|
|
23
23
|
@password = password
|
|
24
24
|
@error_occurred = false
|
|
25
25
|
@retry_count = 0
|
|
26
|
-
|
|
26
|
+
|
|
27
|
+
validate_connection_credentials
|
|
27
28
|
|
|
28
29
|
secrets = options.fetch(:secrets, [])
|
|
29
30
|
@logger = Logger.new(:secrets => secrets)
|
|
31
|
+
|
|
32
|
+
init_connection
|
|
30
33
|
end
|
|
31
34
|
|
|
32
35
|
def execute(sql, options={})
|
|
@@ -90,6 +93,12 @@ module Jredshift
|
|
|
90
93
|
|
|
91
94
|
private
|
|
92
95
|
|
|
96
|
+
def validate_connection_credentials
|
|
97
|
+
fail ArgumentError, 'jdbc_url needs to be a string' unless @jdbc_url.is_a?(String)
|
|
98
|
+
fail ArgumentError, 'user needs to be a string' unless @user.is_a?(String)
|
|
99
|
+
fail ArgumentError, 'password needs to be a string' unless @password.is_a?(String)
|
|
100
|
+
end
|
|
101
|
+
|
|
93
102
|
def init_connection
|
|
94
103
|
Jdbc::Postgres.load_driver
|
|
95
104
|
with_error_handling do
|
data/lib/jredshift/version.rb
CHANGED