click_house 1.6.1 → 1.6.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.github/workflows/main.yml +1 -1
- data/CHANGELOG.md +4 -0
- data/Gemfile.lock +4 -4
- data/docker-compose.yml +1 -1
- data/lib/click_house/extend/connection_selective.rb +3 -3
- data/lib/click_house/response/factory.rb +2 -1
- data/lib/click_house/response/result_set.rb +3 -2
- data/lib/click_house/util/statement.rb +0 -9
- data/lib/click_house/version.rb +1 -1
- 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: 6a24e10e60cd19671f70f521f6db773ef0d3b0f6f33a9ef40b5a26ed7aaf8106
|
4
|
+
data.tar.gz: 3a948f7381d345f6784a8a125bedbc62ba9df554920cc40eb217699c350cfc02
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 12af01d64fb80f0fbfff2df8654c79b6574bd09b6159bac8ae9425417a5fc48fbf7ae8bcf2b0e42efc80bd23bc55212f5ba232f187e606b76fb8d6f7193a6976
|
7
|
+
data.tar.gz: 2d819029b2030f25b68a85f623dcbbec497aa9756d6b69d2e223eccdc97ba35ef58299ceea47f45de568cfdd161f09ca75e1635f9bc3176e94de337ae88e4a59
|
data/.github/workflows/main.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,7 @@
|
|
1
|
+
# 1.6.2
|
2
|
+
* [PR](https://github.com/shlima/click_house/pull/31) Add rows_before_limit_at_least to ResultSet
|
3
|
+
* [PR](https://github.com/shlima/click_house/pull/29) Force JSON format by using "default_format" instead of modifying the query
|
4
|
+
|
1
5
|
# 1.6.1
|
2
6
|
* [PR](https://github.com/shlima/click_house/pull/26) call logging middleware when an error is raised
|
3
7
|
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
click_house (1.6.
|
4
|
+
click_house (1.6.2)
|
5
5
|
faraday (>= 1.7)
|
6
6
|
faraday_middleware
|
7
7
|
|
@@ -27,8 +27,8 @@ GEM
|
|
27
27
|
faraday-em_synchrony (1.0.0)
|
28
28
|
faraday-excon (1.1.0)
|
29
29
|
faraday-httpclient (1.0.1)
|
30
|
-
faraday-multipart (1.0.
|
31
|
-
multipart-post (
|
30
|
+
faraday-multipart (1.0.4)
|
31
|
+
multipart-post (~> 2)
|
32
32
|
faraday-net_http (1.0.1)
|
33
33
|
faraday-net_http_persistent (1.2.0)
|
34
34
|
faraday-patron (1.0.0)
|
@@ -37,7 +37,7 @@ GEM
|
|
37
37
|
faraday_middleware (1.2.0)
|
38
38
|
faraday (~> 1.0)
|
39
39
|
method_source (1.0.0)
|
40
|
-
multipart-post (2.
|
40
|
+
multipart-post (2.2.3)
|
41
41
|
parallel (1.22.1)
|
42
42
|
parser (3.1.1.0)
|
43
43
|
ast (~> 2.4.1)
|
data/docker-compose.yml
CHANGED
@@ -5,17 +5,17 @@ module ClickHouse
|
|
5
5
|
module ConnectionSelective
|
6
6
|
# @return [ResultSet]
|
7
7
|
def select_all(sql)
|
8
|
-
response = get(body:
|
8
|
+
response = get(body: sql, query: { default_format: 'JSON' })
|
9
9
|
Response::Factory[response]
|
10
10
|
end
|
11
11
|
|
12
12
|
def select_value(sql)
|
13
|
-
response = get(body:
|
13
|
+
response = get(body: sql, query: { default_format: 'JSON' })
|
14
14
|
Array(Response::Factory[response].first).dig(0, -1)
|
15
15
|
end
|
16
16
|
|
17
17
|
def select_one(sql)
|
18
|
-
response = get(body:
|
18
|
+
response = get(body: sql, query: { default_format: 'JSON' })
|
19
19
|
Response::Factory[response].first
|
20
20
|
end
|
21
21
|
end
|
@@ -14,7 +14,7 @@ module ClickHouse
|
|
14
14
|
:inspect, :each, :fetch, :length, :count, :size,
|
15
15
|
:first, :last, :[], :to_h
|
16
16
|
|
17
|
-
attr_reader :meta, :data, :totals, :statistics
|
17
|
+
attr_reader :meta, :data, :totals, :statistics, :rows_before_limit_at_least
|
18
18
|
|
19
19
|
class << self
|
20
20
|
# @return [Array<String, Array>]
|
@@ -51,10 +51,11 @@ module ClickHouse
|
|
51
51
|
# @param totals [Array|Hash|NilClass] Support for 'GROUP BY WITH TOTALS' modifier
|
52
52
|
# https://clickhouse.tech/docs/en/sql-reference/statements/select/group-by/#with-totals-modifier
|
53
53
|
# Hash in JSON format and Array in JSONCompact
|
54
|
-
def initialize(meta:, data:, totals: nil, statistics: nil)
|
54
|
+
def initialize(meta:, data:, totals: nil, statistics: nil, rows_before_limit_at_least: nil)
|
55
55
|
@meta = meta
|
56
56
|
@data = data
|
57
57
|
@totals = totals
|
58
|
+
@rows_before_limit_at_least = rows_before_limit_at_least
|
58
59
|
@statistics = Hash(statistics)
|
59
60
|
end
|
60
61
|
|
@@ -3,20 +3,11 @@
|
|
3
3
|
module ClickHouse
|
4
4
|
module Util
|
5
5
|
module Statement
|
6
|
-
END_OF_STATEMENT = ';'
|
7
|
-
END_OF_STATEMENT_RE = /#{END_OF_STATEMENT}(\s+|\Z)/.freeze
|
8
|
-
|
9
6
|
module_function
|
10
7
|
|
11
8
|
def ensure(truthful, value, fallback = nil)
|
12
9
|
truthful ? value : fallback
|
13
10
|
end
|
14
|
-
|
15
|
-
def format(sql, format)
|
16
|
-
return sql if sql.match?(/FORMAT/i)
|
17
|
-
|
18
|
-
"#{sql.sub(END_OF_STATEMENT_RE, '')} FORMAT #{format};"
|
19
|
-
end
|
20
11
|
end
|
21
12
|
end
|
22
13
|
end
|
data/lib/click_house/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: click_house
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.6.
|
4
|
+
version: 1.6.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Aliaksandr Shylau
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-06-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|