quick_count 0.1.2.pre.1 → 0.1.2.pre.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/quick_count/version.rb +1 -1
- data/lib/quick_count.rb +7 -7
- metadata +2 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 438a66bd87229dd94820af384fc47b94ebc75d1648eec942aa0c9d840810cd2c
|
4
|
+
data.tar.gz: 9f89c4f42d931cab0ef6b84539f7850a2f0f36ddb373ea0d1d363cbd331392a2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6d8f36f586cc38b6637f0254dd306c586bb58216ea5dfa908d0572803a0ebd636fe40fad06d0bae6114f22c90c0472af79fcbc74177749010621530ed2c35cfa
|
7
|
+
data.tar.gz: 775faee06a5eac39fa5d311633dcd7ae263ec5396fa668f5bb0ae1f69d6006524481a5d6609625fc7ac4556943864f00988c1a07572eba0dce13b462996bb567
|
data/lib/quick_count/version.rb
CHANGED
data/lib/quick_count.rb
CHANGED
@@ -13,15 +13,15 @@ module QuickCount
|
|
13
13
|
::ActiveRecord::Relation.send :include, CountEstimate::ActiveRecord
|
14
14
|
end
|
15
15
|
|
16
|
-
def self.install(threshold: 500000, schema: 'public')
|
17
|
-
|
18
|
-
|
16
|
+
def self.install(threshold: 500000, schema: 'public', connection: ::ActiveRecord::Base.connection)
|
17
|
+
connection.execute(quick_count_sql(schema: schema, threshold: threshold))
|
18
|
+
connection.execute(count_estimate_sql(schema: schema))
|
19
19
|
end
|
20
20
|
|
21
|
-
def self.uninstall(schema: 'public')
|
22
|
-
|
23
|
-
|
24
|
-
|
21
|
+
def self.uninstall(schema: 'public', connection: ::ActiveRecord::Base.connection)
|
22
|
+
connection.execute("DROP FUNCTION IF EXISTS #{schema}.quick_count(text, bigint);")
|
23
|
+
connection.execute("DROP FUNCTION IF EXISTS #{schema}.quick_count(text);")
|
24
|
+
connection.execute("DROP FUNCTION IF EXISTS #{schema}.count_estimate(text);")
|
25
25
|
end
|
26
26
|
|
27
27
|
private
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: quick_count
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.2.pre.
|
4
|
+
version: 0.1.2.pre.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dale Stevens
|
@@ -157,8 +157,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
157
157
|
- !ruby/object:Gem::Version
|
158
158
|
version: 1.3.1
|
159
159
|
requirements: []
|
160
|
-
|
161
|
-
rubygems_version: 2.7.6.2
|
160
|
+
rubygems_version: 3.1.2
|
162
161
|
signing_key:
|
163
162
|
specification_version: 4
|
164
163
|
summary: Quickly get an accurate count estimation for large tables.
|