Class: LogStash::PluginMixins::Jdbc::PreparedStatementHandler

Inherits:
StatementHandler
  • Object
show all
Defined in:
lib/logstash/plugin_mixins/jdbc/statement_handler.rb

Instance Attribute Summary collapse

Attributes inherited from StatementHandler

#parameters, #statement, #statement_logger

Instance Method Summary collapse

Methods inherited from StatementHandler

build_statement_handler, #initialize

Constructor Details

This class inherits a constructor from LogStash::PluginMixins::Jdbc::StatementHandler

Instance Attribute Details

#bind_values_arrayObject (readonly)

Returns the value of attribute bind_values_array.



71
72
73
# File 'lib/logstash/plugin_mixins/jdbc/statement_handler.rb', line 71

def bind_values_array
  @bind_values_array
end

#nameObject (readonly)

Returns the value of attribute name.



71
72
73
# File 'lib/logstash/plugin_mixins/jdbc/statement_handler.rb', line 71

def name
  @name
end

#preparedObject (readonly)

Returns the value of attribute prepared.



71
72
73
# File 'lib/logstash/plugin_mixins/jdbc/statement_handler.rb', line 71

def prepared
  @prepared
end

#statement_preparedObject (readonly)

Returns the value of attribute statement_prepared.



71
72
73
# File 'lib/logstash/plugin_mixins/jdbc/statement_handler.rb', line 71

def statement_prepared
  @statement_prepared
end

Instance Method Details

#perform_query(db, sql_last_value, jdbc_paging_enabled, jdbc_page_size) {|row| ... } ⇒ Object

Performs the query, ignoring our pagination settings, yielding once per row of data

Parameters:

  • db (Sequel::Database)
  • sql_last_value (Integet|DateTime|Time)

Yield Parameters:

  • row (Hash{Symbol=>Object})


77
78
79
80
81
82
# File 'lib/logstash/plugin_mixins/jdbc/statement_handler.rb', line 77

def perform_query(db, sql_last_value, jdbc_paging_enabled, jdbc_page_size)
  query = build_query(db, sql_last_value)
  query.each do |row|
    yield row
  end
end