blackstack-db 1.0.5 → 1.0.6

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: d09e6d2f5af17a813d5c536f864de997551a9194448902d6c461f4c534b89cea
4
- data.tar.gz: 5516cc43d2b141c373f80fcd1140fd32771edb7ddc2592698ed70719bede0ff1
3
+ metadata.gz: 25578f16a2bc64d70e9070f80d4db0670defdf81d6676c04692f6037a3c0f45a
4
+ data.tar.gz: 98ec2ee0b7e35cddb34785b45d1d08dde7ced218ee3ebb1088ad53ed2473cca7
5
5
  SHA512:
6
- metadata.gz: 2834217481c0801578b04fe9d0b85517cbb4e38f1a8a148ab7e91650700a0b9d6fb4de9ce4b4de73c308b6c0288fe03903b1b7011c174d38152f8f05283d59af
7
- data.tar.gz: b55847daa76635ac4df18db153343a286b4dd8ad9858986c70479a01442beeff46cb4f4ba829ea1300fa189a93c0c87b2daaee007538fcff629283d14e48663a
6
+ metadata.gz: 94048636735c829dddb4c80875f069b4f356c6a1752d3ad1e487f9f8bf3efe3dfb6c43516ed1ca07439a93ffa984bca9d06ffedb256574e0772facbaf7134f28
7
+ data.tar.gz: 051eb7d1f310bce9fb52f44ed9e25f0e308cd762ed7daa60eb4af1edb1485a6c422cc6c62b5ad3e3ce6fba9436d4eaaca854b0f23e05ec181230b19f087b5b9a
@@ -93,6 +93,9 @@ module BlackStack
93
93
  # validate: the :db_password key must be a string
94
94
  raise 'The key :db_password must be a string' unless h[:db_password].is_a?(String)
95
95
 
96
+ # set type
97
+ BlackStack::set_db_type(BlackStack::TYPE_CRDB)
98
+
96
99
  # map values
97
100
  @@db_url = h[:db_url]
98
101
  @@db_port = h[:db_port].to_i
@@ -66,6 +66,9 @@ module BlackStack
66
66
  # validate: the :db_password key must be a string
67
67
  raise 'The key :db_password must be a string' unless h[:db_password].is_a?(String)
68
68
 
69
+ # set type
70
+ BlackStack::set_db_type(BlackStack::TYPE_POSTGRESQL)
71
+
69
72
  # map values
70
73
  @@db_url = h[:db_url]
71
74
  @@db_port = h[:db_port].to_i
data/lib/blackstack-db.rb CHANGED
@@ -16,6 +16,17 @@ module BlackStack
16
16
  def self.db_type
17
17
  @@db_type
18
18
  end # db_type
19
+
20
+ def self.db_connect
21
+ if @@db_type == TYPE_POSTGRESQL
22
+ return BlackStack::PostgreSQL.connect
23
+ elsif @@db_type == TYPE_CRDB
24
+ return BlackStack::CRDB.connect
25
+ else
26
+ raise "Unknown database type"
27
+ end
28
+ end
29
+
19
30
  end # BlackStack
20
31
 
21
32
  # 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.5
4
+ version: 1.0.6
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: 2023-10-29 00:00:00.000000000 Z
11
+ date: 2024-03-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: colorize