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 +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +18 -1
- data/lib/click_house/type/date_time_type.rb +1 -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: 7486a9c08726582c9824560d471e12260cc0349a80caa10f32ab19edca64cc06
|
4
|
+
data.tar.gz: ada7929336b444323b135773e3e6678276e3a9d3433dc6e81b5e3db9238570f3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d3a96167eaac87f3421d0ce146dc1c0f898f02330416e59b06483f02ed8c1acb5403d8f5bf19f1138018c02434736d7edd32a550b3a3ac70f110380e952f8086
|
7
|
+
data.tar.gz: 8c6d0c99b0fbfa2e8d9a298d4d144202eabe564714e2821ee27bc4e436bad19b2d1c0060327be9216ee27a879fb75785af59ee260845fd995ce808faf8e1b71e
|
data/Gemfile.lock
CHANGED
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
|
data/lib/click_house/version.rb
CHANGED