Skip to content

Commit

Permalink
Merge branch 'master' into sync-upstream
Browse files Browse the repository at this point in the history
  • Loading branch information
vincent-pochet authored Oct 8, 2024
2 parents 9c50598 + 3c4b369 commit 27c3ee0
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions lib/active_record/connection_adapters/clickhouse_adapter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
require 'active_record/connection_adapters/clickhouse/oid/array'
require 'active_record/connection_adapters/clickhouse/oid/date'
require 'active_record/connection_adapters/clickhouse/oid/date_time'
require 'active_record/connection_adapters/clickhouse/oid/map'
require 'active_record/connection_adapters/clickhouse/oid/big_integer'
require 'active_record/connection_adapters/clickhouse/oid/map'
require 'active_record/connection_adapters/clickhouse/oid/uuid'
Expand Down Expand Up @@ -109,10 +110,14 @@ class ClickhouseAdapter < AbstractAdapter
uint64: { name: 'UInt64' },
# uint128: { name: 'UInt128' }, not yet implemented in clickhouse
uint256: { name: 'UInt256' },

map: { name: 'Map' }
}.freeze

include Clickhouse::SchemaStatements

TYPE_MAP = Type::TypeMap.new.tap { |m| initialize_type_map(m) }

# Initializes and connects a Clickhouse adapter.
def initialize(config_or_deprecated_connection, deprecated_logger = nil, deprecated_connection_options = nil, deprecated_config = nil)
super
Expand Down Expand Up @@ -165,6 +170,10 @@ def arel_visitor # :nodoc:
Arel::Visitors::Clickhouse.new(self)
end

def type_map
self.class::TYPE_MAP
end

def native_database_types #:nodoc:
NATIVE_DATABASE_TYPES
end
Expand Down

0 comments on commit 27c3ee0

Please sign in to comment.