blackstack-db 1.0.8 → 1.0.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/blackstack-db/crdb.rb +1 -3
- data/lib/blackstack-db/postgresql.rb +5 -6
- data/lib/blackstack-db.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: bbd6c260dad3244665d28642c195ac7c30c4e793618a63a3d9b5e8d20a0d5222
|
4
|
+
data.tar.gz: 235c9e11c1dfd0095ae7d0c426a4960499d899c13e5f621c4d55b4048e481f9e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8d1e697ab4f75d02f900fc5a095840306ba58170eb7965e6ef2634701e25b7c9ddaf6fa9f68bc91f2e5e28b071d5801af6ac9adfbcdbd04f99c4ecef2a7e4fb1
|
7
|
+
data.tar.gz: 623ec3594481d480dfa2c015f7b3ef1659c7d25c9eca0f820e9075ff997daef76514c14b8e63064b10e386484c3023a0e62148427317eb25f89baa6511642614
|
data/lib/blackstack-db/crdb.rb
CHANGED
@@ -130,9 +130,7 @@ module BlackStack
|
|
130
130
|
|
131
131
|
l.logs "Testing connection... "
|
132
132
|
begin
|
133
|
-
@db = BlackStack::
|
134
|
-
BlackStack::CRDB::connection_string # use the connection parameters setting in ./config.rb
|
135
|
-
)
|
133
|
+
@db = BlackStack::CRDB::connect
|
136
134
|
l.logf "success".green
|
137
135
|
rescue => e
|
138
136
|
l.logf "failed".red
|
@@ -80,7 +80,8 @@ module BlackStack
|
|
80
80
|
# create database connection
|
81
81
|
def self.connect
|
82
82
|
BlackStack::set_db_type(BlackStack::TYPE_POSTGRESQL)
|
83
|
-
|
83
|
+
s = BlackStack::PostgreSQL.connection_string
|
84
|
+
Sequel.connect(s)
|
84
85
|
end
|
85
86
|
|
86
87
|
# return a postgresql uuid
|
@@ -112,9 +113,7 @@ module BlackStack
|
|
112
113
|
|
113
114
|
l.logs "Testing connection... "
|
114
115
|
begin
|
115
|
-
@db = BlackStack::
|
116
|
-
BlackStack::PostgreSQL::connection_string # use the connection parameters setting in ./config.rb
|
117
|
-
)
|
116
|
+
@db = BlackStack::PostgreSQL::connect
|
118
117
|
l.logf "success".green
|
119
118
|
rescue => e
|
120
119
|
l.logf "failed".red
|
@@ -125,8 +124,8 @@ module BlackStack
|
|
125
124
|
# This validation checks the connection to the correct database.
|
126
125
|
begin
|
127
126
|
l.logs "Verify database name... "
|
128
|
-
s = @db["SELECT datname FROM pg_database"].first
|
129
|
-
raise 'Wrong database name' if s
|
127
|
+
s = @db["SELECT datname FROM pg_database WHERE datname='#{BlackStack::PostgreSQL::db_name}'"].first
|
128
|
+
raise 'Wrong database name' if s.nil?
|
130
129
|
l.logf "success".green
|
131
130
|
rescue => e
|
132
131
|
l.logf "failed".red
|
data/lib/blackstack-db.rb
CHANGED