clickhouse-activerecord 0.1.2 → 0.1.3

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
  SHA1:
3
- metadata.gz: 678367cbac5ed82b144255157353b904daacc7a7
4
- data.tar.gz: 964abcf8cbd1b79f209d01c6a2a43d143e863954
3
+ metadata.gz: eac051324737a5cccf85980602ca00a03a67144f
4
+ data.tar.gz: e5944f2ddaf351da5607187a3d9d4b0b008ae55d
5
5
  SHA512:
6
- metadata.gz: c1f105f17c651ecfddc44fa837c2462adb1ab1f69eae6cd767a22c1f9b56774ee3e130d29ace118a5ad8e22f1a174c4a74ccab453dc0c888109b165abea130ac
7
- data.tar.gz: f619f0b652ec11c51c6421ac6fd1800f14543ccdf654dd87e423e8a87974d4c71c87767524163edd1211eee97304fa3d6258a5372e394dfacf5135c079eefba8
6
+ metadata.gz: b0440948eda2c9aaf4dae8762cba4a8e506b0620e06e6a4160d64f7865f9e4963966cba30665a6a2cb7660c4f674e94dc7388399d93cb6c788e88c205ab5678c
7
+ data.tar.gz: fada2ee435950d8521d33a0bbbd1cd08d05e542123c780219f47aba213bed2c238ae6784856c930ab38a8c521da0bb00d0fde13572200fb10e5414762017b127
@@ -5,7 +5,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
5
5
 
6
6
  Gem::Specification.new do |spec|
7
7
  spec.name = 'clickhouse-activerecord'
8
- spec.version = '0.1.2'
8
+ spec.version = '0.1.3'
9
9
  spec.authors = ['Sergey Odintsov']
10
10
  spec.email = ['nixx.dj@gmail.com']
11
11
 
@@ -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.2
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