simple-sql 0.5.33 → 0.5.34

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: 567c2dd86ca2849c533ced2e9d3dcc14705ca71659bbe19e63fc82fe2907e15d
4
- data.tar.gz: 1a799e2970974d7acbcc0587a14547674124686f1361ddc0f8049811eb0653e8
3
+ metadata.gz: 19ee32b31a04b470791185276282c822543db6ba04025e20783aa9806c87eea0
4
+ data.tar.gz: c08591756d2ae5f613f6dc02c1b6234bd32e44df9d6d537f64e4634b932abb94
5
5
  SHA512:
6
- metadata.gz: ef6c51b2827d93e11b68c0094052604b55f790e8bca3a5667e6113f6d413b6f0c663b3e3e0f718e46e4ae492972216ae5495f51c03e72fbf8b6b40cae511f266
7
- data.tar.gz: 5a51b78d962fac7ba6fe651ed08d34fa9d3854749fb9708855b83c29ee8d1a6cabb2b97d007c658cd447324e45e30123113c9f72b2674cded7144eec289f0e0b
6
+ metadata.gz: 7e2ef27dd8a283f327dc6bcdf65a33592910e15939bc767a6af759b4a91286fc73eac56716802d462b7f1389b7ff5269c38b4e7e1d33353e2fb1fcb6e3877883
7
+ data.tar.gz: '0998341550cdd3da389c415cb228559a9affbf152636192d602e3578f1143f526b2faec53ebd41e161191e1eaf0bff4ef47a237e2375016b9bc4920407cc0199'
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.5.33
1
+ 0.5.34
@@ -21,7 +21,13 @@ class Simple::SQL::Connection::Scope
21
21
  sql = order_by(nil).to_sql(pagination: false)
22
22
 
23
23
  cost = @connection.estimate_cost "SELECT MIN(#{sql_fragment}) FROM (#{sql}) sq", *args
24
- raise "enumerate_groups(#{sql_fragment.inspect}) takes too much time. Make sure to create a suitable index" if cost > 10_000
24
+
25
+ # cost estimates are good, but are hard to check against a hard coded value.
26
+ # see https://issues.mediafellows.com/issues/75232
27
+ #
28
+ # if cost > 10_000
29
+ # raise "enumerate_groups(#{sql_fragment.inspect}) takes too much time. Make sure to create a suitable index"
30
+ # end
25
31
 
26
32
  groups = []
27
33
  var_name = "$#{@args.count + 1}"
@@ -0,0 +1,29 @@
1
+ require "benchmark"
2
+ require "simple-sql"
3
+
4
+ ENV["DATABASE_URL"] = "postgres://admin:admin@localhost/um_development"
5
+
6
+ Simple::SQL.connect
7
+ # require 'stackprof'# added
8
+
9
+ Benchmark.bmbm do |x|
10
+ x.report("1000x Simple::SQL HStore performance for 100 users") do
11
+ 1000.times { Simple::SQL.all("SELECT id, meta_data FROM users limit 100") }
12
+ end
13
+
14
+ x.report("1000x Simple::SQL HStore::varchar performance for 100 users") do
15
+ 1000.times { Simple::SQL.all("SELECT id, meta_data::varchar FROM users limit 100") }
16
+ end
17
+
18
+ x.report("1000x Simple::SQL HStore as jsonb performance for 100 users") do
19
+ 1000.times { Simple::SQL.all("SELECT id, to_jsonb(meta_data) FROM users limit 100") }
20
+ end
21
+
22
+ x.report("1000x Simple::SQL timestamp performance for 100 users") do
23
+ 1000.times { Simple::SQL.all("SELECT id, created_at FROM users limit 100") }
24
+ end
25
+
26
+ x.report("1000x Simple::SQL timestamp::varchar performance for 100 users") do
27
+ 1000.times { Simple::SQL.all("SELECT id, created_at::varchar FROM users limit 100") }
28
+ end
29
+ end
data/simple-sql.gemspec CHANGED
@@ -35,14 +35,14 @@ Gem::Specification.new do |gem|
35
35
  if ENV["SIMPLE_SQL_ACTIVERECORD_SPECS"]
36
36
  gem.add_dependency 'activerecord', '>= 5.2.4.5', *(ENV["SIMPLE_SQL_ACTIVERECORD_SPECS"].split(","))
37
37
  else
38
- gem.add_dependency 'activerecord', '>= 5.2.4.5', '< 7'
38
+ gem.add_dependency 'activerecord', '>= 5.2.4.5', '< 6.1'
39
39
  end
40
40
 
41
41
  # optional gems (required by some of the parts)
42
42
 
43
43
  # development gems
44
44
  gem.add_development_dependency 'pg', '0.20'
45
- gem.add_development_dependency 'rake', '~> 11'
45
+ gem.add_development_dependency 'rake', '>= 12.3.3'
46
46
  gem.add_development_dependency 'rspec', '~> 3.7'
47
47
  gem.add_development_dependency 'rubocop', '~> 0.61.1'
48
48
  gem.add_development_dependency 'simplecov', '~> 0'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simple-sql
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.33
4
+ version: 0.5.34
5
5
  platform: ruby
6
6
  authors:
7
7
  - radiospiel
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2021-03-02 00:00:00.000000000 Z
12
+ date: 2021-03-10 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: pg_array_parser
@@ -96,7 +96,7 @@ dependencies:
96
96
  version: 5.2.4.5
97
97
  - - "<"
98
98
  - !ruby/object:Gem::Version
99
- version: '7'
99
+ version: '6.1'
100
100
  type: :runtime
101
101
  prerelease: false
102
102
  version_requirements: !ruby/object:Gem::Requirement
@@ -106,7 +106,7 @@ dependencies:
106
106
  version: 5.2.4.5
107
107
  - - "<"
108
108
  - !ruby/object:Gem::Version
109
- version: '7'
109
+ version: '6.1'
110
110
  - !ruby/object:Gem::Dependency
111
111
  name: pg
112
112
  requirement: !ruby/object:Gem::Requirement
@@ -125,16 +125,16 @@ dependencies:
125
125
  name: rake
126
126
  requirement: !ruby/object:Gem::Requirement
127
127
  requirements:
128
- - - "~>"
128
+ - - ">="
129
129
  - !ruby/object:Gem::Version
130
- version: '11'
130
+ version: 12.3.3
131
131
  type: :development
132
132
  prerelease: false
133
133
  version_requirements: !ruby/object:Gem::Requirement
134
134
  requirements:
135
- - - "~>"
135
+ - - ">="
136
136
  - !ruby/object:Gem::Version
137
- version: '11'
137
+ version: 12.3.3
138
138
  - !ruby/object:Gem::Dependency
139
139
  name: rspec
140
140
  requirement: !ruby/object:Gem::Requirement
@@ -235,6 +235,7 @@ files:
235
235
  - lib/simple/sql/table_print.rb
236
236
  - lib/simple/sql/version.rb
237
237
  - log/.gitkeep
238
+ - scripts/benchmark1.rb
238
239
  - scripts/release
239
240
  - scripts/release.rb
240
241
  - scripts/stats