diff --git a/lib/active_record/connection_adapters/clickhouse_adapter.rb b/lib/active_record/connection_adapters/clickhouse_adapter.rb index e2e0becf..908736e8 100644 --- a/lib/active_record/connection_adapters/clickhouse_adapter.rb +++ b/lib/active_record/connection_adapters/clickhouse_adapter.rb @@ -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' @@ -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 @@ -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