jredshift 0.0.5 → 0.0.6
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.rb +2 -2
- data/lib/jredshift/jdbc_db.rb +5 -1
- data/lib/jredshift/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9775960ba8c96ba246556b4d84088ffeecbe542e
|
4
|
+
data.tar.gz: 4c09261b6f9f345cc0ddd3f8e5ff2aa5b26ec172
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7ac71b47b598ebfcfbc5ec3614ca8697c7d99ddb02b0d7d7a22fa1178df0a8203f9838f13e9f2f1f45782b216630def3fba9047979f2e171d55bac320c07439d
|
7
|
+
data.tar.gz: aaa965b8b5b754a8970eaaba1e48ae1dea63ce584622cd2f8e89c8b9add9fabdc25962ac785a7d8da777d807ef066b61e8ca6b5ca3dd306cc9ca9886059bbb24
|
data/lib/jredshift.rb
CHANGED
@@ -32,14 +32,14 @@ module Jredshift
|
|
32
32
|
|
33
33
|
def drop_table_if_exists(table, options={})
|
34
34
|
cascade = options.fetch(:cascade, false) ? ' CASCADE' : ''
|
35
|
-
err_msg = "ERROR:
|
35
|
+
err_msg = "ERROR: Table \"#{remove_schema(table)}\" does not exist"
|
36
36
|
|
37
37
|
execute("DROP TABLE #{table}#{cascade};", :quiet => true, :errors_to_ignore => [err_msg])
|
38
38
|
end
|
39
39
|
|
40
40
|
def drop_view_if_exists(view, options={})
|
41
41
|
cascade = options.fetch(:cascade, false) ? ' CASCADE' : ''
|
42
|
-
err_msg = "ERROR:
|
42
|
+
err_msg = "ERROR: View \"#{remove_schema(view)}\" does not exist"
|
43
43
|
|
44
44
|
execute("DROP VIEW #{view}#{cascade};", :quiet => true, :errors_to_ignore => [err_msg])
|
45
45
|
end
|
data/lib/jredshift/jdbc_db.rb
CHANGED
@@ -115,7 +115,7 @@ module Jredshift
|
|
115
115
|
return_value
|
116
116
|
|
117
117
|
rescue Exception => e
|
118
|
-
if
|
118
|
+
if should_ignore_error?(e.message, errors_to_ignore)
|
119
119
|
@retry_count = 0
|
120
120
|
|
121
121
|
elsif interpretable_error?(e.message)
|
@@ -141,6 +141,10 @@ module Jredshift
|
|
141
141
|
end
|
142
142
|
end
|
143
143
|
|
144
|
+
def should_ignore_error?(err_msg, errors_to_ignore)
|
145
|
+
errors_to_ignore.map {|err| err.downcase }.include?(err_msg.downcase)
|
146
|
+
end
|
147
|
+
|
144
148
|
def interpretable_error?(err_msg)
|
145
149
|
err_msg =~ ERROR_UPDATE_COUNT_OVERFLOW_REGEX
|
146
150
|
end
|
data/lib/jredshift/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jredshift
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dean Morin
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-10-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jdbc-postgres
|
@@ -107,7 +107,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
107
107
|
version: '0'
|
108
108
|
requirements: []
|
109
109
|
rubyforge_project:
|
110
|
-
rubygems_version: 2.2.
|
110
|
+
rubygems_version: 2.2.2
|
111
111
|
signing_key:
|
112
112
|
specification_version: 4
|
113
113
|
summary: Redshift wrapper for JRuby.
|