Module: FastCount

Defined in:
lib/fast_count.rb,
lib/fast_count/utils.rb,
lib/fast_count/version.rb,
lib/fast_count/adapters.rb,
lib/fast_count/extensions.rb,
lib/fast_count/adapters/base_adapter.rb,
lib/fast_count/adapters/mysql_adapter.rb,
lib/fast_count/adapters/sqlite_adapter.rb,
lib/fast_count/adapters/postgresql_adapter.rb

Defined Under Namespace

Modules: Adapters, Extensions, Utils

Constant Summary collapse

VERSION =
"0.3.0"

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.thresholdObject

Determines for how large tables this gem should get the exact row count using SELECT COUNT. If the approximate row count is smaller than this value, SELECT COUNT will be used, otherwise the approximate count will be used.



25
26
27
# File 'lib/fast_count.rb', line 25

def threshold
  @threshold
end

Class Method Details

.install(connection: ActiveRecord::Base.connection) ⇒ Object



12
13
14
15
# File 'lib/fast_count.rb', line 12

def install(connection: ActiveRecord::Base.connection)
  adapter = Adapters.for_connection(connection)
  adapter.install
end

.uninstall(connection: ActiveRecord::Base.connection) ⇒ Object



17
18
19
20
# File 'lib/fast_count.rb', line 17

def uninstall(connection: ActiveRecord::Base.connection)
  adapter = Adapters.for_connection(connection)
  adapter.uninstall
end