Class: ActiveRecord::ConnectionAdapters::Clickhouse::Statement

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

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

#formatObject (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

Parameters:

  • value

    the value to set the attribute response to.



12
13
14
# File 'lib/active_record/connection_adapters/clickhouse/statement.rb', line 12

def response=(value)
  @response = value
end

Instance Method Details

#formatted_sqlObject



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_responseObject



23
24
25
# File 'lib/active_record/connection_adapters/clickhouse/statement.rb', line 23

def processed_response
  ResponseProcessor.new(@response, @format, @sql).process
end