Class: HhClickHouseSynBase

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
app/models/hh_click_house_syn_base.rb

Overview

HhClickHouseSynBase provides the base connection configuration for ClickHouse syn database access.

This base class is used by models that access the syn database in ClickHouse, which contains analytics and conversion tracking data.

Connection Details:

  • Database: syn (or ENV)

  • Uses HTTP interface (port 8123) instead of native protocol

  • Read-only access for analytical queries

  • Contains materialized views for conversion rate analytics

rubocop:disable Rails/ApplicationRecord We intentionally inherit from ActiveRecord::Base instead of ApplicationRecord because:

  • This connects to a separate ClickHouse database (not the main MySQL database)

  • Uses a different adapter (clickhouse vs mysql2)

  • Should not inherit ApplicationRecord's MySQL-specific callbacks and methods

Direct Known Subclasses

HhClickHouseConversionRate

Class Method Summary collapse

Class Method Details

.find(id) ⇒ Object

.find method does not work with ClickHouse adapter So we need to use find_by id rubocop:disable Style/RedundantSelf, Rails/FindById



47
48
49
# File 'app/models/hh_click_house_syn_base.rb', line 47

def self.find(id)
  self.find_by!(id: id)
end