clickhouse-activerecord 0.1.2 → 0.1.3
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
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: eac051324737a5cccf85980602ca00a03a67144f
|
4
|
+
data.tar.gz: e5944f2ddaf351da5607187a3d9d4b0b008ae55d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b0440948eda2c9aaf4dae8762cba4a8e506b0620e06e6a4160d64f7865f9e4963966cba30665a6a2cb7660c4f674e94dc7388399d93cb6c788e88c205ab5678c
|
7
|
+
data.tar.gz: fada2ee435950d8521d33a0bbbd1cd08d05e542123c780219f47aba213bed2c238ae6784856c930ab38a8c521da0bb00d0fde13572200fb10e5414762017b127
|
@@ -0,0 +1,23 @@
|
|
1
|
+
module ActiveRecord
|
2
|
+
module ConnectionAdapters
|
3
|
+
module Clickhouse
|
4
|
+
module OID # :nodoc:
|
5
|
+
class BigInteger < Type::BigInteger # :nodoc:
|
6
|
+
|
7
|
+
DEFAULT_LIMIT = 8
|
8
|
+
|
9
|
+
def limit
|
10
|
+
DEFAULT_LIMIT
|
11
|
+
end
|
12
|
+
|
13
|
+
private
|
14
|
+
|
15
|
+
def _limit
|
16
|
+
DEFAULT_LIMIT
|
17
|
+
end
|
18
|
+
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
@@ -1,6 +1,7 @@
|
|
1
1
|
require 'active_record/connection_adapters/abstract_adapter'
|
2
2
|
require 'active_record/connection_adapters/clickhouse/oid/date'
|
3
3
|
require 'active_record/connection_adapters/clickhouse/oid/date_time'
|
4
|
+
require 'active_record/connection_adapters/clickhouse/oid/big_integer'
|
4
5
|
|
5
6
|
module ActiveRecord
|
6
7
|
class Base
|
@@ -75,6 +76,7 @@ module ActiveRecord
|
|
75
76
|
NATIVE_DATABASE_TYPES = {
|
76
77
|
string: { name: 'String', limit: 255 },
|
77
78
|
integer: { name: 'UInt32' },
|
79
|
+
big_integer: { name: 'UInt64', limit: 8 },
|
78
80
|
float: { name: 'Float32' },
|
79
81
|
datetime: { name: 'DateTime' },
|
80
82
|
date: { name: 'Date' },
|
@@ -114,15 +116,15 @@ module ActiveRecord
|
|
114
116
|
register_class_with_limit m, 'String', Type::String
|
115
117
|
register_class_with_limit m, 'Nullable(String)', Type::String
|
116
118
|
register_class_with_limit m, 'Uint8', Type::UnsignedInteger
|
117
|
-
register_class_with_limit m, 'Uint64', Type::BigInteger
|
118
|
-
register_class_with_limit m, 'Int64', Type::BigInteger
|
119
119
|
register_class_with_limit m, 'Date', Clickhouse::OID::Date
|
120
120
|
register_class_with_limit m, 'DateTime', Clickhouse::OID::DateTime
|
121
121
|
m.alias_type 'UInt16', 'uint8'
|
122
122
|
m.alias_type 'UInt32', 'uint8'
|
123
|
+
m.register_type 'UInt64', Clickhouse::OID::BigInteger.new
|
123
124
|
m.alias_type 'Int8', 'int8'
|
124
125
|
m.alias_type 'Int16', 'int8'
|
125
126
|
m.alias_type 'Int32', 'int8'
|
127
|
+
m.alias_type 'Int64', 'UInt64'
|
126
128
|
end
|
127
129
|
|
128
130
|
# Queries the database and returns the results in an Array-like object
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: clickhouse-activerecord
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sergey Odintsov
|
@@ -82,6 +82,7 @@ files:
|
|
82
82
|
- bin/console
|
83
83
|
- bin/setup
|
84
84
|
- clickhouse-activerecord.gemspec
|
85
|
+
- lib/active_record/connection_adapters/clickhouse/oid/big_integer.rb
|
85
86
|
- lib/active_record/connection_adapters/clickhouse/oid/date.rb
|
86
87
|
- lib/active_record/connection_adapters/clickhouse/oid/date_time.rb
|
87
88
|
- lib/active_record/connection_adapters/clickhouse_adapter.rb
|