snowflake_rb 0.0.0 → 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/snowflake_rb/configuration.rb +16 -13
- data/lib/snowflake_rb.rb +18 -9
- metadata +3 -17
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 14a0e8c270eb195ebf5d0fbcc60132e81814bee410fb98e5483c68f4f50a3aee
|
4
|
+
data.tar.gz: b67d8ce0fbd1fda9d5fa61f1f3c3c8fef35e644ab6fb664f16cd51b1891db348
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 37b3214d133e4ffd8254416d17f1b55875a817ec7db87acf533e135334871ee03baf82e60457e335badede907c5cf84ca555a24ed6ca2e94e1f07c7816c8f2c8
|
7
|
+
data.tar.gz: b0d8f9b7c5ef46288cb3f797061d2846f93915c756253ea692ec3f42089fd59a1089083469c5bc2028a9715b30d50511e2e49f4dcbc964558455f3e64170e620
|
@@ -1,18 +1,21 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require 'dry-configurable'
|
4
|
-
|
5
3
|
module SnowflakeRB
|
6
|
-
|
7
|
-
|
4
|
+
# Configuration class for snowflake_rb
|
5
|
+
# config = Configuration.new
|
6
|
+
# config.account = <ACCOUNT>
|
7
|
+
# config.warehouse = <WAREHOUSE>
|
8
|
+
# config.database = <DATABASE>
|
9
|
+
# config.schema = <SCHEMA>
|
10
|
+
# config.user = <USER>
|
11
|
+
# config.password = <PASSWORD>
|
12
|
+
# config.role = <ROLE>
|
13
|
+
class Configuration
|
14
|
+
attr_accessor :account, :warehouse, :database, :schema, :user, :password, :role
|
15
|
+
attr_writer :port
|
8
16
|
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
setting :schema
|
13
|
-
setting :user
|
14
|
-
setting :password
|
15
|
-
setting :role
|
16
|
-
setting :port, default: 443
|
17
|
+
def port
|
18
|
+
@port || 443
|
19
|
+
end
|
17
20
|
end
|
18
|
-
end
|
21
|
+
end
|
data/lib/snowflake_rb.rb
CHANGED
@@ -31,7 +31,6 @@ module Snowflake
|
|
31
31
|
end
|
32
32
|
|
33
33
|
module Client
|
34
|
-
extend SnowflakeRB::Configuration
|
35
34
|
module_function
|
36
35
|
|
37
36
|
# @return String last error or nil. May be end of file which is not really an error
|
@@ -55,14 +54,14 @@ module Snowflake
|
|
55
54
|
port = nil
|
56
55
|
)
|
57
56
|
::Snowflake::Binding.connect(
|
58
|
-
account ||
|
59
|
-
warehouse ||
|
60
|
-
database ||
|
61
|
-
schema ||
|
62
|
-
user ||
|
63
|
-
password ||
|
64
|
-
role ||
|
65
|
-
port ||
|
57
|
+
account || Snowflake::configuration.account,
|
58
|
+
warehouse || Snowflake::configuration.warehouse,
|
59
|
+
database || Snowflake::configuration.database,
|
60
|
+
schema || Snowflake::configuration.schema,
|
61
|
+
user || Snowflake::configuration.user,
|
62
|
+
password || Snowflake::configuration.password,
|
63
|
+
role || Snowflake::configuration.role,
|
64
|
+
port || Snowflake::configuration.port
|
66
65
|
)
|
67
66
|
end
|
68
67
|
|
@@ -161,4 +160,14 @@ module Snowflake
|
|
161
160
|
SnowflakeRB::Configuration.config
|
162
161
|
end
|
163
162
|
end
|
163
|
+
|
164
|
+
class << self
|
165
|
+
def configuration
|
166
|
+
@configuration ||= SnowflakeRB::Configuration.new
|
167
|
+
end
|
168
|
+
|
169
|
+
def configure
|
170
|
+
yield(configuration)
|
171
|
+
end
|
172
|
+
end
|
164
173
|
end
|
metadata
CHANGED
@@ -1,16 +1,16 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: snowflake_rb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Darren Cheng
|
8
8
|
- Arjun Krishnan
|
9
|
-
- Mohammad-Reza
|
9
|
+
- Mohammad-Reza Daliri
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2023-04-
|
13
|
+
date: 2023-04-13 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: ffi
|
@@ -26,20 +26,6 @@ dependencies:
|
|
26
26
|
- - "~>"
|
27
27
|
- !ruby/object:Gem::Version
|
28
28
|
version: 1.15.5
|
29
|
-
- !ruby/object:Gem::Dependency
|
30
|
-
name: dry-configurable
|
31
|
-
requirement: !ruby/object:Gem::Requirement
|
32
|
-
requirements:
|
33
|
-
- - "~>"
|
34
|
-
- !ruby/object:Gem::Version
|
35
|
-
version: 1.0.1
|
36
|
-
type: :runtime
|
37
|
-
prerelease: false
|
38
|
-
version_requirements: !ruby/object:Gem::Requirement
|
39
|
-
requirements:
|
40
|
-
- - "~>"
|
41
|
-
- !ruby/object:Gem::Version
|
42
|
-
version: 1.0.1
|
43
29
|
description: This gem adds a ruby wrapper around the go native snowflake client
|
44
30
|
email:
|
45
31
|
- darren@thanx.com
|