Class: QueryConsole::Runner::QueryResult

Inherits:
Object
  • Object
show all
Defined in:
app/services/query_console/runner.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#columnsObject (readonly)

Returns the value of attribute columns.



6
7
8
# File 'app/services/query_console/runner.rb', line 6

def columns
  @columns
end

#errorObject (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_msObject (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_dmlObject (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_shownObject (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

#rowsObject (readonly)

Returns the value of attribute rows.



6
7
8
# File 'app/services/query_console/runner.rb', line 6

def rows
  @rows
end

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

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

Returns:

  • (Boolean)


31
32
33
# File 'app/services/query_console/runner.rb', line 31

def dml?
  @is_dml
end

#failure?Boolean

Returns:

  • (Boolean)


23
24
25
# File 'app/services/query_console/runner.rb', line 23

def failure?
  !success?
end

#success?Boolean

Returns:

  • (Boolean)


19
20
21
# File 'app/services/query_console/runner.rb', line 19

def success?
  @error.nil?
end

#truncated?Boolean

Returns:

  • (Boolean)


27
28
29
# File 'app/services/query_console/runner.rb', line 27

def truncated?
  @truncated
end