Class: ActiveRecord::ConnectionAdapters::Clickhouse::Statement
- Inherits:
-
Object
- Object
- ActiveRecord::ConnectionAdapters::Clickhouse::Statement
- Defined in:
- lib/active_record/connection_adapters/clickhouse/statement.rb,
lib/active_record/connection_adapters/clickhouse/statement/format_manager.rb,
lib/active_record/connection_adapters/clickhouse/statement/response_processor.rb
Defined Under Namespace
Classes: FormatManager, ResponseProcessor
Instance Attribute Summary collapse
-
#format ⇒ Object
readonly
Returns the value of attribute format.
-
#response ⇒ Object
writeonly
Sets the attribute response.
Instance Method Summary collapse
- #formatted_sql ⇒ Object
-
#initialize(sql, format:) ⇒ Statement
constructor
A new instance of Statement.
- #processed_response ⇒ Object
Constructor Details
#initialize(sql, format:) ⇒ Statement
Returns a new instance of Statement.
14 15 16 17 |
# File 'lib/active_record/connection_adapters/clickhouse/statement.rb', line 14 def initialize(sql, format:) @sql = sql @format = format end |
Instance Attribute Details
#format ⇒ Object (readonly)
Returns the value of attribute format.
11 12 13 |
# File 'lib/active_record/connection_adapters/clickhouse/statement.rb', line 11 def format @format end |
#response=(value) ⇒ Object (writeonly)
Sets the attribute response
12 13 14 |
# File 'lib/active_record/connection_adapters/clickhouse/statement.rb', line 12 def response=(value) @response = value end |
Instance Method Details
#formatted_sql ⇒ Object
19 20 21 |
# File 'lib/active_record/connection_adapters/clickhouse/statement.rb', line 19 def formatted_sql @formatted_sql ||= FormatManager.new(@sql, format: @format).apply end |
#processed_response ⇒ Object
23 24 25 |
# File 'lib/active_record/connection_adapters/clickhouse/statement.rb', line 23 def processed_response ResponseProcessor.new(@response, @format, @sql).process end |