Class: QueryConsole::Runner::QueryResult
- Inherits:
-
Object
- Object
- QueryConsole::Runner::QueryResult
- Defined in:
- app/services/query_console/runner.rb
Instance Attribute Summary collapse
-
#columns ⇒ Object
readonly
Returns the value of attribute columns.
-
#error ⇒ Object
readonly
Returns the value of attribute error.
-
#execution_time_ms ⇒ Object
readonly
Returns the value of attribute execution_time_ms.
-
#is_dml ⇒ Object
readonly
Returns the value of attribute is_dml.
-
#row_count_shown ⇒ Object
readonly
Returns the value of attribute row_count_shown.
-
#rows ⇒ Object
readonly
Returns the value of attribute rows.
-
#rows_affected ⇒ Object
readonly
Returns the value of attribute rows_affected.
-
#truncated ⇒ Object
readonly
Returns the value of attribute truncated.
Instance Method Summary collapse
- #dml? ⇒ Boolean
- #failure? ⇒ Boolean
-
#initialize(columns: [], rows: [], execution_time_ms: 0, row_count_shown: 0, truncated: false, error: nil, is_dml: false, rows_affected: nil) ⇒ QueryResult
constructor
A new instance of QueryResult.
- #success? ⇒ Boolean
- #truncated? ⇒ Boolean
Constructor Details
#initialize(columns: [], rows: [], execution_time_ms: 0, row_count_shown: 0, truncated: false, error: nil, is_dml: false, rows_affected: nil) ⇒ QueryResult
Returns a new instance of QueryResult.
8 9 10 11 12 13 14 15 16 17 |
# File 'app/services/query_console/runner.rb', line 8 def initialize(columns: [], rows: [], execution_time_ms: 0, row_count_shown: 0, truncated: false, error: nil, is_dml: false, rows_affected: nil) @columns = columns @rows = rows @execution_time_ms = execution_time_ms @row_count_shown = row_count_shown @truncated = truncated @error = error @is_dml = is_dml @rows_affected = rows_affected end |
Instance Attribute Details
#columns ⇒ Object (readonly)
Returns the value of attribute columns.
6 7 8 |
# File 'app/services/query_console/runner.rb', line 6 def columns @columns end |
#error ⇒ Object (readonly)
Returns the value of attribute error.
6 7 8 |
# File 'app/services/query_console/runner.rb', line 6 def error @error end |
#execution_time_ms ⇒ Object (readonly)
Returns the value of attribute execution_time_ms.
6 7 8 |
# File 'app/services/query_console/runner.rb', line 6 def execution_time_ms @execution_time_ms end |
#is_dml ⇒ Object (readonly)
Returns the value of attribute is_dml.
6 7 8 |
# File 'app/services/query_console/runner.rb', line 6 def is_dml @is_dml end |
#row_count_shown ⇒ Object (readonly)
Returns the value of attribute row_count_shown.
6 7 8 |
# File 'app/services/query_console/runner.rb', line 6 def row_count_shown @row_count_shown end |
#rows ⇒ Object (readonly)
Returns the value of attribute rows.
6 7 8 |
# File 'app/services/query_console/runner.rb', line 6 def rows @rows end |
#rows_affected ⇒ Object (readonly)
Returns the value of attribute rows_affected.
6 7 8 |
# File 'app/services/query_console/runner.rb', line 6 def rows_affected @rows_affected end |
#truncated ⇒ Object (readonly)
Returns the value of attribute truncated.
6 7 8 |
# File 'app/services/query_console/runner.rb', line 6 def truncated @truncated end |
Instance Method Details
#dml? ⇒ Boolean
31 32 33 |
# File 'app/services/query_console/runner.rb', line 31 def dml? @is_dml end |
#failure? ⇒ Boolean
23 24 25 |
# File 'app/services/query_console/runner.rb', line 23 def failure? !success? end |
#success? ⇒ Boolean
19 20 21 |
# File 'app/services/query_console/runner.rb', line 19 def success? @error.nil? end |
#truncated? ⇒ Boolean
27 28 29 |
# File 'app/services/query_console/runner.rb', line 27 def truncated? @truncated end |