click_house 1.2.3 → 1.2.4

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: cbc27532a4abd9eab176f4c1816bae63d4b4d379bbd0f2ab24c4e6fd1d3a7178
4
- data.tar.gz: ff239f24529edda890282222c8aa58e93c0d9d65f1376a1ee38a9371d770e893
3
+ metadata.gz: 7486a9c08726582c9824560d471e12260cc0349a80caa10f32ab19edca64cc06
4
+ data.tar.gz: ada7929336b444323b135773e3e6678276e3a9d3433dc6e81b5e3db9238570f3
5
5
  SHA512:
6
- metadata.gz: d4eb18c92e8489be5b0cc63cd578ef7359619ec0972ec96f9efccc0b145a9347a8de320a34a88eaec366f99c0c2c19733d59bcd2acd3104f80e02149db6f2d2f
7
- data.tar.gz: 59ce90b17994fb5bd334dbfb8181faf6a16d8514f302e89b673f45164ebd3a493e71fb96b02de510b70ca8cadefc232d13bb2d9d15b1cb2b2530efef43e4587d
6
+ metadata.gz: d3a96167eaac87f3421d0ce146dc1c0f898f02330416e59b06483f02ed8c1acb5403d8f5bf19f1138018c02434736d7edd32a550b3a3ac70f110380e952f8086
7
+ data.tar.gz: 8c6d0c99b0fbfa2e8d9a298d4d144202eabe564714e2821ee27bc4e436bad19b2d1c0060327be9216ee27a879fb75785af59ee260845fd995ce808faf8e1b71e
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- click_house (1.2.3)
4
+ click_house (1.2.4)
5
5
  faraday
6
6
  faraday_middleware
7
7
 
data/README.md CHANGED
@@ -330,7 +330,15 @@ string_type = FixedStringType.new
330
330
 
331
331
  ClickHouse.connection.insert('table', columns: %i[name time]) do |buffer|
332
332
  buffer << [string_type.serialize('a' * 1000, 20), time.serialize(Time.current, 'Europe/Moscow')]
333
- end
333
+ end
334
+
335
+ ## alternatively
336
+ data = @records.map do |record|
337
+ {
338
+ id: record.id,
339
+ time: ClickHouse.types['DateTime(%s)'].serialize(Time.current)
340
+ }
341
+ end
334
342
  ```
335
343
 
336
344
  If native type supports arguments, define type with `%s` argument:
@@ -345,6 +353,15 @@ end
345
353
  ClickHouse.add_type('DateTime(%s)', DateTimeType.new)
346
354
  ```
347
355
 
356
+ if you need to redefine all built-in types with your implementation,
357
+ just clear the default type system:
358
+
359
+ ```ruby
360
+ ClickHouse.types.clear
361
+ ClickHouse.types # => {}
362
+ ClickHouse.types.default #=> #<ClickHouse::Type::UndefinedType:0x00007fc1cfabd630>
363
+ ```
364
+
348
365
  ## Using with a connection pool
349
366
 
350
367
  ```ruby
@@ -8,7 +8,7 @@ module ClickHouse
8
8
  end
9
9
 
10
10
  def serialize(value)
11
- value.strftime('%Y-%m-%d %H:%m:%S %p %z')
11
+ value.strftime('%Y-%m-%d %H:%M:%S')
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.2.3'
4
+ VERSION = '1.2.4'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: click_house
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.3
4
+ version: 1.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Aliaksandr Shylau