click_house 1.3.0 → 1.3.1

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: 73a7b3a1d277214b437bf34712185e436d372a6396d0e388a446e3f29c61ac0e
4
- data.tar.gz: 42869ca836d053d80299126149dc88266da4a0b31ce96837fc02348d60dc0394
3
+ metadata.gz: 1374424a3c271d0414b1d40088dfa532337f1047606b55bf4f1a4f0c2e22f140
4
+ data.tar.gz: 53200789244d3e83c0bd2b9de660db0d82d8f8d9af83dd44a5813d4d5cbbfd39
5
5
  SHA512:
6
- metadata.gz: 5e308c6f52fc984e3532453a869603d727620d3db61533ff80307caa06c481a5dec29685c38fb46527dea94e9d3577ee5c8918af79aa85bd8697ae7a22063b26
7
- data.tar.gz: 9dc3e6b31f65c6b3cee80aaa657fe924face07474d256714da34d4287128a26563a463e7b14019564895d4d6821b5b2aaf7324418530fd8c548d629522f15008
6
+ metadata.gz: 482c77bda957329e1187bd009567eb216547028ad0810ced5a3ee58474ac273cb11e4b271f2107edae78e44bc855cc0c3130b848c028ebc84422a517d3e1bfdf
7
+ data.tar.gz: 82bdf1a4f88537652bcc7f0827fa3e89ff609c24e1631bd3f131080295b4b184164975b439244e1cdb15c89fcf294f3f8482032f00b93db83b60c1cb51804403
@@ -1,3 +1,6 @@
1
+ # 1.3.1
2
+ * added request [headers](https://github.com/shlima/click_house/pull/8) support
3
+
1
4
  # 1.3.0
2
5
  * added support for IPv4/IPv6 types
3
6
 
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- click_house (1.3.0)
4
+ click_house (1.3.1)
5
5
  faraday
6
6
  faraday_middleware
7
7
 
data/README.md CHANGED
@@ -53,6 +53,7 @@ ClickHouse.config do |config|
53
53
  config.timeout = 60
54
54
  config.open_timeout = 3
55
55
  config.ssl_verify = false
56
+ config.headers = {}
56
57
 
57
58
  # or provide connection options separately
58
59
  config.scheme = 'http'
@@ -216,7 +217,8 @@ ClickHouse.connection.create_table('visits', if_not_exists: true, engine: 'Merge
216
217
  t.Decimal :money, 5, 4
217
218
  t.String :event
218
219
  t.UInt32 :user_id
219
- t.UInt32 :Float32
220
+ t.IPv4 :ipv4
221
+ t.IPv6 :ipv6
220
222
  end
221
223
  ```
222
224
 
@@ -328,11 +330,11 @@ ClickHouse.add_type('Date', DateType.new)
328
330
  Actually `serialize` function is not used for now, but you may use it manually:
329
331
 
330
332
  ```ruby
331
- time_type = DateTimeType.new
332
- string_type = FixedStringType.new
333
+ time_type = ClickHouse::Type::DateTimeType.new
334
+ string_type = ClickHouse::Type::FixedStringType.new
333
335
 
334
336
  ClickHouse.connection.insert('table', columns: %i[name time]) do |buffer|
335
- buffer << [string_type.serialize('a' * 1000, 20), time.serialize(Time.current, 'Europe/Moscow')]
337
+ buffer << [string_type.serialize('a' * 1000, 20), time_type.serialize(Time.current, 'Europe/Moscow')]
336
338
  end
337
339
 
338
340
  ## alternatively
@@ -448,11 +450,6 @@ class CreateAdvertVisits < ActiveRecord::Migration[6.0]
448
450
  t.UInt16 :account_id
449
451
  t.UInt16 :user_id
450
452
  t.Date :date
451
- t.DateTime :time, 'UTC'
452
- t.IPv4 :ipv4
453
- t.IPv6 :ipv6
454
- t.UInt32 :device_type_id
455
- t.UInt32 :os_family_id
456
453
  end
457
454
  end
458
455
 
@@ -18,7 +18,8 @@ module ClickHouse
18
18
  password: nil,
19
19
  timeout: nil,
20
20
  open_timeout: nil,
21
- ssl_verify: false
21
+ ssl_verify: false,
22
+ headers: {}
22
23
  }.freeze
23
24
 
24
25
  attr_accessor :adapter
@@ -33,6 +34,7 @@ module ClickHouse
33
34
  attr_accessor :timeout
34
35
  attr_accessor :open_timeout
35
36
  attr_accessor :ssl_verify
37
+ attr_accessor :headers
36
38
 
37
39
  def initialize(params = {})
38
40
  assign(DEFAULTS.merge(params))
@@ -11,6 +11,7 @@ module ClickHouse
11
11
 
12
12
  attr_reader :config
13
13
 
14
+ # @param [Config]
14
15
  def initialize(config)
15
16
  @config = config
16
17
  end
@@ -31,6 +32,7 @@ module ClickHouse
31
32
  @transport ||= Faraday.new(config.url!) do |conn|
32
33
  conn.options.timeout = config.timeout
33
34
  conn.options.open_timeout = config.open_timeout
35
+ conn.headers = config.headers
34
36
  conn.ssl.verify = config.ssl_verify
35
37
  conn.basic_auth(config.username, config.password) if config.auth?
36
38
  conn.response Middleware::Logging, logger: config.logger!
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ClickHouse
4
- VERSION = '1.3.0'
4
+ VERSION = '1.3.1'
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.0
4
+ version: 1.3.1
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-09-23 00:00:00.000000000 Z
11
+ date: 2020-10-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday