shlima/click_house
A modern Ruby database driver providing a comprehensive and efficient interface to interact with ClickHouse databases via the HTTP protocol.
The project 'clickhouse-activerecord' is a Ruby database ActiveRecord driver specifically designed for ClickHouse, a columnar database management system. It supports Rails versions 7.1 and above and is compatible with ClickHouse versions starting from 22.0 LTS. The driver facilitates seamless integration of ClickHouse with Ruby on Rails applications, allowing developers to use ActiveRecord, the ORM framework in Rails, to interact with ClickHouse databases. Installation is straightforward via RubyGems, and the project provides detailed configuration options for database connections, including support for SSL, debugging, cluster and replica configurations, and custom HTTP transport. It supports multiple database connections, enabling Rails applications to connect to ClickHouse alongside other databases like PostgreSQL. The project includes Rake tasks for managing the ClickHouse database lifecycle, such as creating, dropping, purging, and resetting databases, as well as migrations and schema dumps/loads. It supports schema and structure dumps and loads for both single and multiple database setups, facilitating database version control and deployment. The driver supports advanced ActiveRecord features such as materialized views, complex queries with joins, window functions, and query optimizations. It also provides RSpec integration for testing, including automatic table truncation before tests. Migration support includes a variety of ClickHouse-specific data types, including unsigned integers by default, with options for signed integers and complex types like arrays and maps. The project allows creating tables with custom column structures, codec compression, and indexes tailored to ClickHouse's capabilities. Overall, 'clickhouse-activerecord' bridges the gap between Ruby on Rails and ClickHouse, enabling developers to leverage ClickHouse's high-performance analytics capabilities within the familiar ActiveRecord framework, enhancing productivity and database management in Rails applications.
https://github.com/PNixx/clickhouse-activerecord
A modern Ruby database driver providing a comprehensive and efficient interface to interact with ClickHouse databases via the HTTP protocol.