click_house 2.0.0 → 2.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/Gemfile_faraday1.lock +1 -1
- data/lib/click_house/ast/statement.rb +0 -1
- data/lib/click_house/connection.rb +16 -1
- data/lib/click_house/version.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: c2d62b43147b81ad3551c48c79388a949307d03491c1d87965d25ae9818e0a86
|
4
|
+
data.tar.gz: ad6e79c3a974e4e39889d93dcabd94d3dc8f2bced9b739449f741bd1c8c83038
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9035db18ecc851ab6de8f9ae88d434dfff07f2da5e23eac4cf3c091fe699871c64f0c9c05a1637730f44dfd5fef4eca60f6cd94f613360113152461f7e4dabe8
|
7
|
+
data.tar.gz: bb93033b9ffc82a7003af0affea015ad2a84292a86a50c46ea6cecfa232b22d172708dc1633f896fd29eea373270eb464baa70e02df8d036195d0aeb2f88f29c
|
data/Gemfile.lock
CHANGED
data/Gemfile_faraday1.lock
CHANGED
@@ -47,13 +47,22 @@ module ClickHouse
|
|
47
47
|
end
|
48
48
|
|
49
49
|
# transport should work the same both with Faraday v1 and Faraday v2
|
50
|
+
# rubocop:disable Metrics/AbcSize
|
50
51
|
def transport
|
51
52
|
@transport ||= Faraday.new(config.url!) do |conn|
|
52
53
|
conn.options.timeout = config.timeout
|
53
54
|
conn.options.open_timeout = config.open_timeout
|
54
55
|
conn.headers = config.headers
|
55
56
|
conn.ssl.verify = config.ssl_verify
|
56
|
-
|
57
|
+
|
58
|
+
if config.auth?
|
59
|
+
if faraday_v1?
|
60
|
+
conn.request :basic_auth, config.username, config.password
|
61
|
+
else
|
62
|
+
conn.request :authorization, :basic, config.username, config.password
|
63
|
+
end
|
64
|
+
end
|
65
|
+
|
57
66
|
conn.response Middleware::RaiseError
|
58
67
|
conn.response Middleware::Logging, logger: config.logger!
|
59
68
|
conn.response config.json_parser, content_type: %r{application/json}, parser_options: { config: config }
|
@@ -61,10 +70,16 @@ module ClickHouse
|
|
61
70
|
conn.adapter config.adapter
|
62
71
|
end
|
63
72
|
end
|
73
|
+
# rubocop:enable Metrics/AbcSize
|
64
74
|
|
65
75
|
def compose(path, query = {})
|
66
76
|
# without <query.compact> "DB::Exception: Empty query" error will occur
|
67
77
|
"#{path}?#{URI.encode_www_form({ send_progress_in_http_headers: 1 }.merge(query).compact)}"
|
68
78
|
end
|
79
|
+
|
80
|
+
# @return [Boolean]
|
81
|
+
def faraday_v1?
|
82
|
+
Faraday::VERSION.start_with?('1')
|
83
|
+
end
|
69
84
|
end
|
70
85
|
end
|
data/lib/click_house/version.rb
CHANGED