Class: SqlGenius::Core::ExecutionResult
- Inherits:
-
Object
- Object
- SqlGenius::Core::ExecutionResult
- Defined in:
- lib/sql_genius/core/execution_result.rb
Overview
Immutable frozen value object returned from Core::QueryRunner#run. Contains the executed columns and (possibly masked) rows plus runtime metrics: row count, wall-clock execution time in milliseconds, and a truncated flag indicating whether the row count reached the applied LIMIT.
This is distinct from Core::Result (which models a plain query result shape) because QueryRunner returns runtime metadata that plain results don’t carry.
Instance Attribute Summary collapse
-
#columns ⇒ Object
readonly
Returns the value of attribute columns.
-
#execution_time_ms ⇒ Object
readonly
Returns the value of attribute execution_time_ms.
-
#row_count ⇒ Object
readonly
Returns the value of attribute row_count.
-
#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:, execution_time_ms:, truncated:) ⇒ ExecutionResult
constructor
A new instance of ExecutionResult.
Constructor Details
#initialize(columns:, rows:, execution_time_ms:, truncated:) ⇒ ExecutionResult
Returns a new instance of ExecutionResult.
17 18 19 20 21 22 23 24 |
# File 'lib/sql_genius/core/execution_result.rb', line 17 def initialize(columns:, rows:, execution_time_ms:, truncated:) @columns = columns.freeze @rows = rows.freeze @row_count = rows.length @execution_time_ms = execution_time_ms @truncated = truncated freeze end |
Instance Attribute Details
#columns ⇒ Object (readonly)
Returns the value of attribute columns.
15 16 17 |
# File 'lib/sql_genius/core/execution_result.rb', line 15 def columns @columns end |
#execution_time_ms ⇒ Object (readonly)
Returns the value of attribute execution_time_ms.
15 16 17 |
# File 'lib/sql_genius/core/execution_result.rb', line 15 def execution_time_ms @execution_time_ms end |
#row_count ⇒ Object (readonly)
Returns the value of attribute row_count.
15 16 17 |
# File 'lib/sql_genius/core/execution_result.rb', line 15 def row_count @row_count end |
#rows ⇒ Object (readonly)
Returns the value of attribute rows.
15 16 17 |
# File 'lib/sql_genius/core/execution_result.rb', line 15 def rows @rows end |
#truncated ⇒ Object (readonly)
Returns the value of attribute truncated.
15 16 17 |
# File 'lib/sql_genius/core/execution_result.rb', line 15 def truncated @truncated end |