blackstack-db 1.0.7 → 1.0.8
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/postgresql.rb +2 -2
- data/lib/blackstack-db.rb +10 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e7bb074f4d88555ea328860cc08bc1ba72a2299db81fef74ed839e0ca22f3d34
|
4
|
+
data.tar.gz: 3cfdd099de0d3f6dc05e7f553e4dc94f5420e3af94552cda2c8f1d9196ad7c4c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3edc6fb80fa604ec8c2862df98509398b856bc2e517c97d563e602b757c04066b8365c12d4ea50c37dbaf494ec778fe14dc71a730d53312f0ecc75595f911d15
|
7
|
+
data.tar.gz: 6d18124e13b0cdcc2f64c4c3567d3f57f5968f06d7e75587c9cc7141cd06aec6c433ad42760cb84b3f4808a002e773de8d7419b87784547cc8f9b8721a302303
|
@@ -125,8 +125,8 @@ module BlackStack
|
|
125
125
|
# This validation checks the connection to the correct database.
|
126
126
|
begin
|
127
127
|
l.logs "Verify database name... "
|
128
|
-
s = @db["SELECT datname FROM pg_database"].first
|
129
|
-
raise 'Wrong database name' if s !~
|
128
|
+
s = @db["SELECT datname FROM pg_database"].first[:datname]
|
129
|
+
raise 'Wrong database name' if s !~ /#{Regexp.escape(BlackStack::PostgreSQL::db_name)}/i
|
130
130
|
l.logf "success".green
|
131
131
|
rescue => e
|
132
132
|
l.logf "failed".red
|
data/lib/blackstack-db.rb
CHANGED
@@ -37,6 +37,16 @@ module BlackStack
|
|
37
37
|
end
|
38
38
|
end
|
39
39
|
|
40
|
+
def self.test(l=nil)
|
41
|
+
if @@db_type == TYPE_POSTGRESQL
|
42
|
+
return BlackStack::PostgreSQL.test(l)
|
43
|
+
elsif @@db_type == TYPE_CRDB
|
44
|
+
return BlackStack::CRDB.test(l)
|
45
|
+
else
|
46
|
+
raise "Unknown database type"
|
47
|
+
end
|
48
|
+
end # test
|
49
|
+
|
40
50
|
end # BlackStack
|
41
51
|
|
42
52
|
# return a postgresql uuid
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: blackstack-db
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Leandro Daniel Sardi
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-03-
|
11
|
+
date: 2024-03-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: colorize
|