Method: Mongify::Database::SqlConnection#count
- Defined in:
- lib/mongify/database/sql_connection.rb
#count(table_name, where = nil) ⇒ Object
100 101 102 103 104 |
# File 'lib/mongify/database/sql_connection.rb', line 100 def count(table_name, where = nil) q = "SELECT COUNT(*) FROM #{table_name}" q = "#{q} WHERE #{where}" if where self.connection.select_value(q).to_i end |