click_house 1.3.9 → 1.4.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a840e675477999a80f7ceee3f2364df83fc0efcc4ee4d0e16212dba1bb495acf
4
- data.tar.gz: 1d8ad01d6dc2e1720c0d499f2f7168cdf83018151bc24dbbe1f8a8244da1d5ee
3
+ metadata.gz: '095426f805a20574d725842799b3e09368ef4239bf8a262d4ca061ef7689cedd'
4
+ data.tar.gz: 77098569ba1c05b236bc6b68118116c63985c1cc91bc49cdc5ae49c2550459f6
5
5
  SHA512:
6
- metadata.gz: 76172279bdf916f3b1ff68e55ad576a3e05a5651e47e22547a20b8d87159b7920edc72c5bb8b449833d50409c30738dc4374259df7096af53a99141e8d67c9d5
7
- data.tar.gz: 5542180b24e7d7e7b747cfd09eca9a999371b26b0013d783ef1fa888623eb6854803e38286aa3f0fb3893b158ffed6977ea92aa089c91f25523f0882a99b514e
6
+ metadata.gz: a71819d5ea5c61bf85907501e9b80ca713dc3e78e97a066a9f3e8fb1713dfc0a81b91aef0b12c51389afad53c518ccca913544be0f44d60182d02ecb722e0e1c
7
+ data.tar.gz: 95fb2a123492cb6f816ed4c8b1984ec1ba21b1784eceb489543081616ad5d0a5947d56623be63c7e8d5f4586977f4c2999a0bb8c229d20519e8d1f8fc2365749
@@ -8,13 +8,13 @@ jobs:
8
8
 
9
9
  services:
10
10
  clickhouse:
11
- image: yandex/clickhouse-server:20.12.3.3
11
+ image: yandex/clickhouse-server:21.1.4
12
12
  ports:
13
13
  - 8123:8123
14
14
 
15
15
  strategy:
16
16
  matrix:
17
- ruby-version: [2.7, 2.6, 2.5, 2.4]
17
+ ruby-version: [3.0, 2.7, 2.6, 2.5, 2.4]
18
18
 
19
19
  steps:
20
20
  - uses: actions/checkout@v2
data/.rubocop.yml CHANGED
@@ -105,6 +105,10 @@ Layout/EmptyLinesAroundAttributeAccessor:
105
105
  Enabled: true
106
106
  Layout/SpaceAroundMethodCallOperator:
107
107
  Enabled: true
108
+ Layout/SpaceBeforeBrackets:
109
+ Enabled: true
110
+ Lint/AmbiguousAssignment:
111
+ Enabled: true
108
112
 
109
113
  # ============================== Style ==============================
110
114
  Style/RescueModifier:
@@ -217,6 +221,12 @@ Style/SwapValues:
217
221
  Enabled: true
218
222
  Style/RedundantArgument:
219
223
  Enabled: true
224
+ Style/HashExcept:
225
+ Enabled: true
226
+ Style/EndlessMethod:
227
+ Enabled: true
228
+ Style/IfWithBooleanLiteralBranches:
229
+ Enabled: true
220
230
 
221
231
  # ============================== Lint ==============================
222
232
  Lint/DuplicateMethods:
@@ -287,3 +297,17 @@ Lint/UnmodifiedReduceAccumulator:
287
297
  Enabled: true
288
298
  Lint/UnexpectedBlockArity:
289
299
  Enabled: true
300
+ Lint/DeprecatedConstants:
301
+ Enabled: true
302
+ Lint/LambdaWithoutLiteralBlock:
303
+ Enabled: true
304
+ Lint/NumberedParameterAssignment:
305
+ Enabled: true
306
+ Lint/OrAssignmentToConstant:
307
+ Enabled: true
308
+ Lint/RedundantDirGlobSort:
309
+ Enabled: true
310
+ Lint/SymbolConversion:
311
+ Enabled: true
312
+ Lint/TripleQuotes:
313
+ Enabled: true
data/CHANGELOG.md CHANGED
@@ -1,3 +1,6 @@
1
+ # 1.4.0
2
+ * fizx decimal type casting [#11](https://github.com/shlima/click_house/issues/11)
3
+
1
4
  # 1.3.9
2
5
  * add `ClickHouse.connection.add_index`, `ClickHouse.connection.drop_index`
3
6
 
data/Gemfile.lock CHANGED
@@ -1,63 +1,65 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- click_house (1.3.9)
4
+ click_house (1.4.0)
5
5
  faraday
6
6
  faraday_middleware
7
7
 
8
8
  GEM
9
9
  remote: https://rubygems.org/
10
10
  specs:
11
- ast (2.4.1)
11
+ ast (2.4.2)
12
12
  coderay (1.1.3)
13
13
  diff-lcs (1.4.4)
14
- faraday (1.1.0)
14
+ faraday (1.3.0)
15
+ faraday-net_http (~> 1.0)
15
16
  multipart-post (>= 1.2, < 3)
16
17
  ruby2_keywords
18
+ faraday-net_http (1.0.1)
17
19
  faraday_middleware (1.0.0)
18
20
  faraday (~> 1.0)
19
21
  method_source (1.0.0)
20
22
  multipart-post (2.1.1)
21
23
  parallel (1.20.1)
22
- parser (2.7.2.0)
24
+ parser (3.0.0.0)
23
25
  ast (~> 2.4.1)
24
- pry (0.13.1)
26
+ pry (0.14.0)
25
27
  coderay (~> 1.1)
26
28
  method_source (~> 1.0)
27
29
  rainbow (3.0.0)
28
30
  rake (13.0.3)
29
- regexp_parser (2.0.1)
31
+ regexp_parser (2.0.3)
30
32
  rexml (3.2.4)
31
33
  rspec (3.10.0)
32
34
  rspec-core (~> 3.10.0)
33
35
  rspec-expectations (~> 3.10.0)
34
36
  rspec-mocks (~> 3.10.0)
35
- rspec-core (3.10.0)
37
+ rspec-core (3.10.1)
36
38
  rspec-support (~> 3.10.0)
37
- rspec-expectations (3.10.0)
39
+ rspec-expectations (3.10.1)
38
40
  diff-lcs (>= 1.2.0, < 2.0)
39
41
  rspec-support (~> 3.10.0)
40
- rspec-mocks (3.10.0)
42
+ rspec-mocks (3.10.2)
41
43
  diff-lcs (>= 1.2.0, < 2.0)
42
44
  rspec-support (~> 3.10.0)
43
- rspec-support (3.10.0)
44
- rubocop (1.6.1)
45
+ rspec-support (3.10.2)
46
+ rubocop (1.9.1)
45
47
  parallel (~> 1.10)
46
- parser (>= 2.7.1.5)
48
+ parser (>= 3.0.0.0)
47
49
  rainbow (>= 2.2.2, < 4.0)
48
50
  regexp_parser (>= 1.8, < 3.0)
49
51
  rexml
50
52
  rubocop-ast (>= 1.2.0, < 2.0)
51
53
  ruby-progressbar (~> 1.7)
52
- unicode-display_width (>= 1.4.0, < 2.0)
53
- rubocop-ast (1.3.0)
54
+ unicode-display_width (>= 1.4.0, < 3.0)
55
+ rubocop-ast (1.4.1)
54
56
  parser (>= 2.7.1.5)
55
- rubocop-performance (1.9.1)
57
+ rubocop-performance (1.9.2)
56
58
  rubocop (>= 0.90.0, < 2.0)
57
59
  rubocop-ast (>= 0.4.0)
58
- ruby-progressbar (1.10.1)
59
- ruby2_keywords (0.0.2)
60
- unicode-display_width (1.7.0)
60
+ ruby-progressbar (1.11.0)
61
+ ruby2_keywords (0.0.4)
62
+ unicode-display_width (2.0.0)
61
63
 
62
64
  PLATFORMS
63
65
  ruby
@@ -72,4 +74,4 @@ DEPENDENCIES
72
74
  rubocop-performance
73
75
 
74
76
  BUNDLED WITH
75
- 2.1.4
77
+ 2.2.3
data/README.md CHANGED
@@ -104,6 +104,7 @@ ClickHouse.connection.truncate_tables(['table_1', 'table_2'], if_exists: true, c
104
104
  ClickHouse.connection.truncate_tables # will truncate all tables in database
105
105
  ClickHouse.connection.rename_table('old_name', 'new_name', cluster: nil)
106
106
  ClickHouse.connection.rename_table(%w[table_1 table_2], %w[new_1 new_2], cluster: nil)
107
+ ClickHouse.connection.alter_table('table', 'DROP COLUMN user_id', cluster: nil)
107
108
  ClickHouse.connection.add_index('table', 'ix', 'has(b, a)', type: 'minmax', granularity: 2, cluster: nil)
108
109
  ClickHouse.connection.drop_index('table', 'ix', cluster: nil)
109
110
 
data/docker-compose.yml CHANGED
@@ -2,7 +2,7 @@ version: '3.5'
2
2
 
3
3
  services:
4
4
  clickhouse:
5
- image: yandex/clickhouse-server:20.12.3.3
5
+ image: yandex/clickhouse-server:21.1.4
6
6
  ports:
7
7
  - "8123:8123"
8
8
  - "9000:9000"
@@ -4,11 +4,11 @@ module ClickHouse
4
4
  module Type
5
5
  class DecimalType < BaseType
6
6
  def cast(value, precision = Float::DIG, _scale = nil)
7
- BigDecimal(value, precision.to_f)
7
+ BigDecimal(value, precision.to_i)
8
8
  end
9
9
 
10
10
  def serialize(value, precision = Float::DIG, _scale = nil)
11
- BigDecimal(value, precision.to_f) unless value.nil?
11
+ BigDecimal(value, precision.to_i).to_f unless value.nil?
12
12
  end
13
13
  end
14
14
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ClickHouse
4
- VERSION = '1.3.9'
4
+ VERSION = '1.4.0'
5
5
  end
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.3.9
4
+ version: 1.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Aliaksandr Shylau
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-12-21 00:00:00.000000000 Z
11
+ date: 2021-02-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -210,7 +210,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
210
210
  - !ruby/object:Gem::Version
211
211
  version: '0'
212
212
  requirements: []
213
- rubygems_version: 3.1.2
213
+ rubygems_version: 3.2.3
214
214
  signing_key:
215
215
  specification_version: 4
216
216
  summary: Modern Ruby database driver for ClickHouse