clickhouse-activerecord 0.5.8 → 0.5.10
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e172255ef4610b0db49f84dea36cdd85951fc4ea596f1cbe7b63c62e9c9b2633
|
4
|
+
data.tar.gz: ec85d89e0274006250466bd8a96654d30eb6614512c4d0d0bee80dcf08285a20
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz: '
|
6
|
+
metadata.gz: 5130aef7dc279582f73ca91fbd0be7f80cf7200d241b17ab747e356762a9a21d5060f2f10995762a29ba5c46942bda17643937a7f849b28da58214998e85462d
|
7
|
+
data.tar.gz: '00096694c1b25b72e1f45c1f0160714eceb0c1f0c101206a9e4bc0cb4abadc825c24665f68ad4bcc7950b07553ffbceaa809830df5b35c7c3043ae9acb969ce6'
|
data/CHANGELOG.md
CHANGED
@@ -1,10 +1,14 @@
|
|
1
|
+
### Version 0.5.8 (Oct 25, 2021)
|
2
|
+
|
3
|
+
* Added support rails 7
|
4
|
+
|
1
5
|
### Version 0.5.6 (Oct 25, 2021)
|
2
|
-
|
6
|
+
|
3
7
|
* Added auto creating service distributed tables and additional options for creating view [@ygreeek](https://github.com/ygreeek)
|
4
8
|
* Added default user agent
|
5
9
|
|
6
10
|
### Version 0.5.3 (Sep 22, 2021)
|
7
|
-
|
11
|
+
|
8
12
|
* Fix replica cluster for a new syntax MergeTree
|
9
13
|
* Fix support rails 5.2 on alter table
|
10
14
|
* Support array type of column
|
@@ -92,7 +92,7 @@ module ActiveRecord
|
|
92
92
|
if (duplicate = inserting.detect { |v| inserting.count(v) > 1 })
|
93
93
|
raise "Duplicate migration #{duplicate}. Please renumber your migrations to resolve the conflict."
|
94
94
|
end
|
95
|
-
|
95
|
+
do_execute(insert_versions_sql(inserting), nil, settings: {max_partitions_per_insert_block: [100, inserting.size].max})
|
96
96
|
end
|
97
97
|
end
|
98
98
|
|
@@ -32,6 +32,7 @@ module ActiveRecord
|
|
32
32
|
sslca: config[:sslca],
|
33
33
|
read_timeout: config[:read_timeout],
|
34
34
|
write_timeout: config[:write_timeout],
|
35
|
+
keep_alive_timeout: config[:keep_alive_timeout]
|
35
36
|
}
|
36
37
|
end
|
37
38
|
|
@@ -80,17 +81,10 @@ module ActiveRecord
|
|
80
81
|
def is_view=(value)
|
81
82
|
@is_view = value
|
82
83
|
end
|
83
|
-
end
|
84
|
-
end
|
85
84
|
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
if self.connection.is_a?(ConnectionAdapters::ClickhouseAdapter)
|
90
|
-
ClickhouseActiverecord::Arel::Table.new(table_name, type_caster: type_caster)
|
91
|
-
else
|
92
|
-
Arel::Table.new(table_name, klass: self)
|
93
|
-
end
|
85
|
+
def arel_table # :nodoc:
|
86
|
+
@arel_table ||= ClickhouseActiverecord::Arel::Table.new(table_name, type_caster: type_caster)
|
87
|
+
end
|
94
88
|
end
|
95
89
|
end
|
96
90
|
|
@@ -233,14 +227,22 @@ module ActiveRecord
|
|
233
227
|
# Quoting time without microseconds
|
234
228
|
def quoted_date(value)
|
235
229
|
if value.acts_like?(:time)
|
236
|
-
|
230
|
+
if ActiveRecord::version >= Gem::Version.new('7')
|
231
|
+
zone_conversion_method = ActiveRecord.default_timezone == :utc ? :getutc : :getlocal
|
232
|
+
else
|
233
|
+
zone_conversion_method = ActiveRecord::Base.default_timezone == :utc ? :getutc : :getlocal
|
234
|
+
end
|
237
235
|
|
238
236
|
if value.respond_to?(zone_conversion_method)
|
239
237
|
value = value.send(zone_conversion_method)
|
240
238
|
end
|
241
239
|
end
|
242
240
|
|
243
|
-
|
241
|
+
if ActiveRecord::version >= Gem::Version.new('7')
|
242
|
+
value.to_fs(:db)
|
243
|
+
else
|
244
|
+
value.to_s(:db)
|
245
|
+
end
|
244
246
|
end
|
245
247
|
|
246
248
|
def column_name_for_operation(operation, node) # :nodoc:
|
@@ -292,7 +294,7 @@ module ActiveRecord
|
|
292
294
|
drop_table(table_name, options.merge(if_exists: true))
|
293
295
|
end
|
294
296
|
|
295
|
-
|
297
|
+
do_execute(schema_creation.accept(td), format: nil)
|
296
298
|
end
|
297
299
|
|
298
300
|
def create_table(table_name, **options, &block)
|
@@ -304,7 +306,7 @@ module ActiveRecord
|
|
304
306
|
drop_table(table_name, options.merge(if_exists: true))
|
305
307
|
end
|
306
308
|
|
307
|
-
|
309
|
+
do_execute(schema_creation.accept(td), format: nil)
|
308
310
|
|
309
311
|
if options[:with_distributed]
|
310
312
|
distributed_table_name = options.delete(:with_distributed)
|
@@ -376,7 +378,7 @@ module ActiveRecord
|
|
376
378
|
|
377
379
|
def database_engine_atomic?
|
378
380
|
current_database_engine = "select engine from system.databases where name = '#{@config[:database]}'"
|
379
|
-
res =
|
381
|
+
res = select_one(current_database_engine)
|
380
382
|
res['engine'] == 'Atomic' if res
|
381
383
|
end
|
382
384
|
|
@@ -418,6 +420,9 @@ module ActiveRecord
|
|
418
420
|
@connection.read_timeout = @connection_parameters[:read_timeout] if @connection_parameters[:read_timeout]
|
419
421
|
@connection.write_timeout = @connection_parameters[:write_timeout] if @connection_parameters[:write_timeout]
|
420
422
|
|
423
|
+
# Use clickhouse default keep_alive_timeout value of 10, rather than Net::HTTP's default of 2
|
424
|
+
@connection.keep_alive_timeout = @connection_parameters[:keep_alive_timeout] || 10
|
425
|
+
|
421
426
|
@connection
|
422
427
|
end
|
423
428
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: clickhouse-activerecord
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sergey Odintsov
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-06-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|