clickhouse-activerecord 0.3.4 → 0.3.5
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
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: f7b2fb3282fdff192d0cec9cb19a68ba70d02d83
|
4
|
+
data.tar.gz: 50dea626b278f9ac8a33ea95d300a5d440fa229a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 06a3b3ae02ca8e2e60974109f1ead35743340b8e12beefa28134cadeeff4df753db044da60e25af007a5e14abda14695fc1725d5b86aa5432dce7f642d2004ab
|
7
|
+
data.tar.gz: 9d8215272de3a2b9c0bc2d4671cc22d769acdf1e3f8c32ea8d685c28a32be5838bb28dc7c77a8c4bbdaa7960df1537bf0aad7f8db7571c07793c85a64fbcb696
|
data/CHANGELOG.md
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require 'clickhouse-activerecord/arel/visitors/to_sql'
|
4
|
+
require 'clickhouse-activerecord/arel/table'
|
4
5
|
require 'active_record/connection_adapters/abstract_adapter'
|
5
6
|
require 'active_record/connection_adapters/clickhouse/oid/date'
|
6
7
|
require 'active_record/connection_adapters/clickhouse/oid/date_time'
|
@@ -30,6 +31,14 @@ module ActiveRecord
|
|
30
31
|
end
|
31
32
|
end
|
32
33
|
|
34
|
+
module TypeCaster
|
35
|
+
class Map
|
36
|
+
def is_view
|
37
|
+
types.is_view
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
33
42
|
module ModelSchema
|
34
43
|
module ClassMethods
|
35
44
|
def is_view
|
@@ -39,6 +48,11 @@ module ActiveRecord
|
|
39
48
|
def is_view=(value)
|
40
49
|
@is_view = value
|
41
50
|
end
|
51
|
+
|
52
|
+
def arel_table # :nodoc:
|
53
|
+
@arel_table ||= ClickhouseActiverecord::Arel::Table.new(table_name, type_caster: type_caster)
|
54
|
+
end
|
55
|
+
|
42
56
|
end
|
43
57
|
end
|
44
58
|
|
@@ -130,6 +144,10 @@ module ActiveRecord
|
|
130
144
|
value.to_s(:db)
|
131
145
|
end
|
132
146
|
|
147
|
+
def column_name_for_operation(operation, node) # :nodoc:
|
148
|
+
column_name_from_arel_node(node)
|
149
|
+
end
|
150
|
+
|
133
151
|
# Executes insert +sql+ statement in the context of this connection using
|
134
152
|
# +binds+ as the bind substitutes. +name+ is logged along with
|
135
153
|
# the executed +sql+ statement.
|
@@ -6,13 +6,12 @@ module ClickhouseActiverecord
|
|
6
6
|
class ToSql < ::Arel::Visitors::ToSql
|
7
7
|
|
8
8
|
def aggregate(name, o, collector)
|
9
|
-
# todo how get model class from request? This method works with only rails 4.2.
|
10
9
|
# replacing function name for materialized view
|
11
|
-
|
12
|
-
|
13
|
-
|
10
|
+
if o.expressions.first && o.expressions.first != '*' && !o.expressions.first.is_a?(String) && o.expressions.first.relation&.is_view
|
11
|
+
super("#{name.downcase}Merge", o, collector)
|
12
|
+
else
|
14
13
|
super
|
15
|
-
|
14
|
+
end
|
16
15
|
end
|
17
16
|
|
18
17
|
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: 0.3.
|
4
|
+
version: 0.3.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sergey Odintsov
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-07-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -126,6 +126,7 @@ files:
|
|
126
126
|
- lib/active_record/connection_adapters/clickhouse/schema_statements.rb
|
127
127
|
- lib/active_record/connection_adapters/clickhouse_adapter.rb
|
128
128
|
- lib/clickhouse-activerecord.rb
|
129
|
+
- lib/clickhouse-activerecord/arel/table.rb
|
129
130
|
- lib/clickhouse-activerecord/arel/visitors/to_sql.rb
|
130
131
|
- lib/clickhouse-activerecord/railtie.rb
|
131
132
|
- lib/clickhouse-activerecord/schema_dumper.rb
|
@@ -152,7 +153,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
152
153
|
- !ruby/object:Gem::Version
|
153
154
|
version: '0'
|
154
155
|
requirements: []
|
155
|
-
|
156
|
+
rubyforge_project:
|
157
|
+
rubygems_version: 2.5.2.3
|
156
158
|
signing_key:
|
157
159
|
specification_version: 4
|
158
160
|
summary: ClickHouse ActiveRecord
|