fast_count 0.2.0 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 25bb1bbb54bacd1439f8a649e5927fa8968e9cb9c5076d56d3da8a6bdb74b086
4
- data.tar.gz: d565c1a47ca831b9013b99a6a0feea5dacb569380686721b5c62b6c12f6cbac3
3
+ metadata.gz: 7b13d77aeaaa7eccb6e556661aa157c0116925cb176aede5aeb35ef07e047c93
4
+ data.tar.gz: 967179160b1af55eae2f2898a2626be8ad46e914fc6c311e792f8af438c4481d
5
5
  SHA512:
6
- metadata.gz: 34189623d034c4a8433ced800bd9c3f83d9f3f2925ec5d2d646c783e1921e68640e23de1636cecabf49d7d5f7ffa9d42d813e500e1ba8899d5cc913e24042087
7
- data.tar.gz: 8fbd2df556dc2d09f56fa55fdd5df0693861ff9daa2e651aca6ec35591e77af25744e4e4bb0da3cdb5cd33e1a7247875528f2b725d458cd599d3df67cd485a75
6
+ metadata.gz: d7b2b3069004e30077649ae0dc5e9547ae69d8115180b3005560fa676c3c9ab8b81c70ee03817f44b8e7944e2a34c484bd4d748c517a5951bba88def7f6a27f5
7
+ data.tar.gz: 0f76f37f959cd2c60f57bd5d9f43b40694a6e3d7a022b39b2e33fc9bce4c7389c6b37117e05e80681f97cebb028eb596643cc8a771893104f196cc1b41962634
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  ## master (unreleased)
2
2
 
3
+ ## 0.3.0 (2024-08-12)
4
+
5
+ - Raise when `fast_distinct_count` is used on primary key
6
+
3
7
  ## 0.2.0 (2023-07-24)
4
8
 
5
9
  - Support for quickly getting an exact number of distinct values in a column
@@ -31,6 +31,10 @@ module FastCount
31
31
  # User.fast_distinct_count(column: :company_id)
32
32
  #
33
33
  def fast_distinct_count(column:)
34
+ if column.to_s == primary_key
35
+ raise "Use `#fast_count` when counting primary keys."
36
+ end
37
+
34
38
  adapter = Adapters.for_connection(connection)
35
39
  adapter.fast_distinct_count(table_name, column)
36
40
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module FastCount
4
- VERSION = "0.2.0"
4
+ VERSION = "0.3.0"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fast_count
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - fatkodima
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2023-07-24 00:00:00.000000000 Z
12
+ date: 2024-08-12 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activerecord
@@ -66,7 +66,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
66
66
  - !ruby/object:Gem::Version
67
67
  version: '0'
68
68
  requirements: []
69
- rubygems_version: 3.4.6
69
+ rubygems_version: 3.4.19
70
70
  signing_key:
71
71
  specification_version: 4
72
72
  summary: Quickly get a count estimation for large tables.