Class: HhClickHouseBookingBase

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

Overview

HhClickHouseBookingBase provides the base connection configuration for ClickHouse booking_production database access.

This base class is used by models that access the booking_production database in ClickHouse, which contains data synchronized from the booking_production RDS via Airbyte.

Connection Details:

  • Database: booking_production (or ENV)

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

  • Read-only access for analytical queries

  • Data synced from booking_production RDS by Airbyte

  • Table names and columns match the production database schema

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

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



48
49
50
# File 'app/models/hh_click_house_booking_base.rb', line 48

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