Class: WideEvent::Store::QueryResult
- Inherits:
-
Object
- Object
- WideEvent::Store::QueryResult
- Defined in:
- lib/wide_event/store/query_result.rb
Overview
An immutable, already-bounded result of a JSON /v1/query request
(store/internal/httpapi/query.go's {"columns":...,"rows":...,"truncated":...}
body, parsed). rows is an array of arrays in column order; a nil
element is a SQL NULL. truncated is true when the store cut the
result off at its row or response-size limit.
Instance Attribute Summary collapse
-
#columns ⇒ Object
readonly
Returns the value of attribute columns.
-
#rows ⇒ Object
readonly
Returns the value of attribute rows.
-
#truncated ⇒ Object
readonly
Returns the value of attribute truncated.
Instance Method Summary collapse
-
#initialize(columns:, rows:, truncated:) ⇒ QueryResult
constructor
A new instance of QueryResult.
Constructor Details
#initialize(columns:, rows:, truncated:) ⇒ QueryResult
Returns a new instance of QueryResult.
11 12 13 14 15 16 |
# File 'lib/wide_event/store/query_result.rb', line 11 def initialize(columns:, rows:, truncated:) @columns = columns.map(&:to_s).freeze @rows = rows.map { |row| row.freeze }.freeze @truncated = truncated == true freeze end |
Instance Attribute Details
#columns ⇒ Object (readonly)
Returns the value of attribute columns.
9 10 11 |
# File 'lib/wide_event/store/query_result.rb', line 9 def columns @columns end |
#rows ⇒ Object (readonly)
Returns the value of attribute rows.
9 10 11 |
# File 'lib/wide_event/store/query_result.rb', line 9 def rows @rows end |
#truncated ⇒ Object (readonly)
Returns the value of attribute truncated.
9 10 11 |
# File 'lib/wide_event/store/query_result.rb', line 9 def truncated @truncated end |