uc3-dmp-rds 0.0.3 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/uc3-dmp-rds/adapter.rb +2 -7
- data/lib/uc3-dmp-rds/version.rb +1 -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: a3b92897b9f3bd68bd920725e13c46d9b04bb4f5c210ffa353091000ac68f445
|
4
|
+
data.tar.gz: f2136fb308e575f9bb875be65d602be6eced6773a78f8ecad797d0d569721193
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3ef489cd7947182aa1f75dfcdf6afbf44325769e41f83989be41ce2e96bc73244dfe08c010239e7a43813920bd042aa2e9bab9e9782956197d9f7c90695d6e69
|
7
|
+
data.tar.gz: 96fbb73012933fde71ab2bc4f523c68ce5c7d4d007c7e4b9a0ee1e8b65ac51920e64b318f30d3a23d39bdfd5595ff25805161ad76a5498b5c02134a0c1d6acb6
|
data/lib/uc3-dmp-rds/adapter.rb
CHANGED
@@ -26,11 +26,6 @@ module Uc3DmpRds
|
|
26
26
|
# Connect to the RDS instance
|
27
27
|
def connect(debug: false)
|
28
28
|
creds = _credentials
|
29
|
-
|
30
|
-
puts "DB stuff:"
|
31
|
-
puts "HOST: #{ENV['DATABASE_HOST']}, PORT: #{ENV['DATABASE_HOST']}, NAME: #{ENV['DATABASE_HOST']}"
|
32
|
-
pp creds
|
33
|
-
|
34
29
|
ActiveRecord::Base.establish_connection(
|
35
30
|
adapter: 'mysql2',
|
36
31
|
host: ENV.fetch('DATABASE_HOST', nil),
|
@@ -40,12 +35,12 @@ pp creds
|
|
40
35
|
password: creds[:password],
|
41
36
|
encoding: 'utf8mb4'
|
42
37
|
)
|
43
|
-
|
38
|
+
ActiveRecord::Base.connected?
|
44
39
|
end
|
45
40
|
|
46
41
|
# Execute the specified query using ActiveRecord's helpers to sanitize the input
|
47
42
|
def execute_query(sql:, **params)
|
48
|
-
|
43
|
+
raise StandardError, MSG_NO_CONNECTION unless ActiveRecord::Base.connected?
|
49
44
|
return [] unless sql.is_a?(String) && !sql.strip.empty? && (params.nil? || params.is_a?(Hash))
|
50
45
|
# Verify that all of the kewords are accounted for and that values were supplied
|
51
46
|
raise StandardError, MSG_KEYWORDS_INVALID unless _verify_params(sql: sql, params: params)
|
data/lib/uc3-dmp-rds/version.rb
CHANGED