Module: Imparcial::Driver::AbstractExpression::Record

Included in:
Imparcial::Driver::AbstractExpression
Defined in:
lib/imparcial/driver/abstract/expression/record.rb

Instance Method Summary collapse

Instance Method Details

#total_of_records(options = {}) ⇒ Object Also known as: num_of_records

Retrieve the total of records in a table.



18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# File 'lib/imparcial/driver/abstract/expression/record.rb', line 18

def total_of_records ( options = {} )
            
  check_options expected_options_for_total_of_records, options
                      
  sql = sql_for_couting_records( options )
  
  logger.warn sql if @record_logging
  
  query sql
  
  result.fetch_first_row.value
  
rescue adapter_specific_exception => ex

  raise ExpressionError.new(ex.message)
  
end