Class: Dexter::Query

Inherits:
Object
  • Object
show all
Defined in:
lib/dexter/query.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(statement, fingerprint) ⇒ Query

Returns a new instance of Query.



6
7
8
9
# File 'lib/dexter/query.rb', line 6

def initialize(statement, fingerprint)
  @statement = statement
  @fingerprint = fingerprint
end

Instance Attribute Details

#fingerprintObject (readonly)

Returns the value of attribute fingerprint.



3
4
5
# File 'lib/dexter/query.rb', line 3

def fingerprint
  @fingerprint
end

#initial_costObject

Returns the value of attribute initial_cost.



4
5
6
# File 'lib/dexter/query.rb', line 4

def initial_cost
  @initial_cost
end

#missing_tablesObject

Returns the value of attribute missing_tables.



4
5
6
# File 'lib/dexter/query.rb', line 4

def missing_tables
  @missing_tables
end

#new_costObject

Returns the value of attribute new_cost.



4
5
6
# File 'lib/dexter/query.rb', line 4

def new_cost
  @new_cost
end

#statementObject (readonly)

Returns the value of attribute statement.



3
4
5
# File 'lib/dexter/query.rb', line 3

def statement
  @statement
end

Instance Method Details

#tablesObject



11
12
13
# File 'lib/dexter/query.rb', line 11

def tables
  @tables ||= PgQuery.parse(statement).tables rescue []
end