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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 353b4b2bdb838ebab93502e2e02ac00729a9c2056c7a7299ae513013f16ca093
4
- data.tar.gz: 7dd91a9b54af25ce2d35f7948bb9be89879301630b6009578c565a635f5997af
3
+ metadata.gz: e7bb074f4d88555ea328860cc08bc1ba72a2299db81fef74ed839e0ca22f3d34
4
+ data.tar.gz: 3cfdd099de0d3f6dc05e7f553e4dc94f5420e3af94552cda2c8f1d9196ad7c4c
5
5
  SHA512:
6
- metadata.gz: 5823b900dea5263daf3e93a9f8a09cedf4bc5e36a73c2b118c179a1696a1419a7e5988319de982dc9f16b39efb2aa294ac54ddd117a3efa36e7c4e7e029d858e
7
- data.tar.gz: 7c4f6c16b311a98fec899d417e25c7b45564df4f5690384c7a0c965b8357bcefe824016688af3cd3e71cbe0ac6872c1c49740d54c5427c64effd0b1ab7dd43b8
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.to_s
129
- raise 'Wrong database name' if s !~ /:database_name=>\"#{Regexp.escape(BlackStack::PostgreSQL::db_name)}\"/i
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.7
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-28 00:00:00.000000000 Z
11
+ date: 2024-03-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: colorize