Class: SeqScanner::QueryPlan
- Inherits:
-
Object
- Object
- SeqScanner::QueryPlan
- Defined in:
- lib/seq_scanner/query_plan.rb
Instance Attribute Summary collapse
-
#binds ⇒ Object
readonly
Returns the value of attribute binds.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#query_plan ⇒ Object
readonly
Returns the value of attribute query_plan.
-
#sql ⇒ Object
readonly
Returns the value of attribute sql.
Instance Method Summary collapse
-
#initialize(input, result) ⇒ QueryPlan
constructor
A new instance of QueryPlan.
- #validate ⇒ Object
Constructor Details
#initialize(input, result) ⇒ QueryPlan
Returns a new instance of QueryPlan.
7 8 9 10 11 12 13 14 15 16 17 |
# File 'lib/seq_scanner/query_plan.rb', line 7 def initialize(input, result) self.sql = input[:sql] self.name = input[:name] self.binds = input[:binds].map do |bind| { name: bind.name, value: bind.value, } end self.query_plan = result end |
Instance Attribute Details
#binds ⇒ Object
Returns the value of attribute binds.
5 6 7 |
# File 'lib/seq_scanner/query_plan.rb', line 5 def binds @binds end |
#name ⇒ Object
Returns the value of attribute name.
5 6 7 |
# File 'lib/seq_scanner/query_plan.rb', line 5 def name @name end |
#query_plan ⇒ Object
Returns the value of attribute query_plan.
5 6 7 |
# File 'lib/seq_scanner/query_plan.rb', line 5 def query_plan @query_plan end |
#sql ⇒ Object
Returns the value of attribute sql.
5 6 7 |
# File 'lib/seq_scanner/query_plan.rb', line 5 def sql @sql end |
Instance Method Details
#validate ⇒ Object
19 20 21 22 23 24 |
# File 'lib/seq_scanner/query_plan.rb', line 19 def validate return true if schema_migrations? return true unless seq? raise SeqScanDetectedError.new(self) end |