clickhouse-activerecord 1.0.10 → 1.0.12
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: bb1844d5c04115646e36f7914b9d3e46872f28d87e941354eb01313df6228df9
|
4
|
+
data.tar.gz: b7ec986391a326ac03d910dfbd40820f339c8f6d49ee937a863c5ea0fffc336f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 188bfb4db6343255fb738658d44133380e31806257af0fc3a1077f7483033e47dca2d7f460ac8070859624c1cb77ec208a953d441dae83af39199279e1341a6b
|
7
|
+
data.tar.gz: 9cd536b970e75d0a2ecaf2a1651216dcefbab1ff85cbdfacb5437b57ddf54b56ad8866ee905cfbf9f7c105a771ead6e783de6e5819362c36944d23993e519bf2
|
@@ -104,7 +104,8 @@ HEADER
|
|
104
104
|
raise StandardError, "Unknown type '#{column.sql_type}' for column '#{column.name}'" unless @connection.valid_type?(column.type)
|
105
105
|
next if column.name == pk
|
106
106
|
type, colspec = column_spec(column)
|
107
|
-
|
107
|
+
name = column.name =~ (/\./) ? "\"`#{column.name}`\"" : column.name.inspect
|
108
|
+
tbl.print " t.#{type} #{name}"
|
108
109
|
tbl.print ", #{format_colspec(colspec)}" if colspec.present?
|
109
110
|
tbl.puts
|
110
111
|
end
|
@@ -167,10 +168,15 @@ HEADER
|
|
167
168
|
(column.sql_type =~ /Array?\(/).nil? ? nil : true
|
168
169
|
end
|
169
170
|
|
171
|
+
def schema_low_cardinality(column)
|
172
|
+
(column.sql_type =~ /LowCardinality?\(/).nil? ? nil : true
|
173
|
+
end
|
174
|
+
|
170
175
|
def prepare_column_options(column)
|
171
176
|
spec = {}
|
172
177
|
spec[:unsigned] = schema_unsigned(column)
|
173
178
|
spec[:array] = schema_array(column)
|
179
|
+
spec[:low_cardinality] = schema_low_cardinality(column)
|
174
180
|
spec.merge(super).compact
|
175
181
|
end
|
176
182
|
|
@@ -36,10 +36,16 @@ module CoreExtensions
|
|
36
36
|
connection.insert(im, "#{self.class} Create Rollback Version", primary_key, version)
|
37
37
|
end
|
38
38
|
|
39
|
-
def
|
39
|
+
def versions
|
40
40
|
return super unless connection.is_a?(::ActiveRecord::ConnectionAdapters::ClickhouseAdapter)
|
41
41
|
|
42
|
-
|
42
|
+
sm = ::Arel::SelectManager.new(arel_table)
|
43
|
+
sm.final!
|
44
|
+
sm.project(arel_table[primary_key])
|
45
|
+
sm.order(arel_table[primary_key].asc)
|
46
|
+
sm.where([arel_table['active'].eq(1)])
|
47
|
+
|
48
|
+
connection.select_values(sm, "#{self.class} Load")
|
43
49
|
end
|
44
50
|
end
|
45
51
|
end
|
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: 1.0.
|
4
|
+
version: 1.0.12
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sergey Odintsov
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-07-
|
11
|
+
date: 2024-07-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|