rails-pg-extras 5.4.0 → 5.4.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/ci.yml +30 -53
- data/Rakefile +1 -1
- data/app/views/layouts/rails_pg_extras/web/application.html.erb +2 -2
- data/assets/pg-extras-rails-ujs.js +630 -0
- data/assets/pg-extras-tailwind.min.css +11874 -0
- data/docker-compose.yml.sample +27 -10
- data/lib/rails-pg-extras.rb +3 -0
- data/lib/rails_pg_extras/version.rb +1 -1
- data/lib/rails_pg_extras/web/engine.rb +3 -1
- data/spec/smoke_spec.rb +1 -0
- data/spec/spec_helper.rb +8 -4
- metadata +6 -4
data/docker-compose.yml.sample
CHANGED
@@ -1,8 +1,6 @@
|
|
1
|
-
version: '3'
|
2
|
-
|
3
1
|
services:
|
4
|
-
|
5
|
-
image: postgres:
|
2
|
+
postgres12:
|
3
|
+
image: postgres:12.20-alpine
|
6
4
|
command: postgres -c shared_preload_libraries=pg_stat_statements
|
7
5
|
environment:
|
8
6
|
POSTGRES_USER: postgres
|
@@ -10,8 +8,8 @@ services:
|
|
10
8
|
POSTGRES_PASSWORD: secret
|
11
9
|
ports:
|
12
10
|
- '5432:5432'
|
13
|
-
|
14
|
-
image: postgres:
|
11
|
+
postgres13:
|
12
|
+
image: postgres:13.16-alpine
|
15
13
|
command: postgres -c shared_preload_libraries=pg_stat_statements
|
16
14
|
environment:
|
17
15
|
POSTGRES_USER: postgres
|
@@ -19,8 +17,8 @@ services:
|
|
19
17
|
POSTGRES_PASSWORD: secret
|
20
18
|
ports:
|
21
19
|
- '5433:5432'
|
22
|
-
|
23
|
-
image: postgres:13
|
20
|
+
postgres14:
|
21
|
+
image: postgres:14.13-alpine
|
24
22
|
command: postgres -c shared_preload_libraries=pg_stat_statements
|
25
23
|
environment:
|
26
24
|
POSTGRES_USER: postgres
|
@@ -28,8 +26,8 @@ services:
|
|
28
26
|
POSTGRES_PASSWORD: secret
|
29
27
|
ports:
|
30
28
|
- '5434:5432'
|
31
|
-
|
32
|
-
image: postgres:
|
29
|
+
postgres15:
|
30
|
+
image: postgres:15.8-alpine
|
33
31
|
command: postgres -c shared_preload_libraries=pg_stat_statements
|
34
32
|
environment:
|
35
33
|
POSTGRES_USER: postgres
|
@@ -37,3 +35,22 @@ services:
|
|
37
35
|
POSTGRES_PASSWORD: secret
|
38
36
|
ports:
|
39
37
|
- '5435:5432'
|
38
|
+
postgres16:
|
39
|
+
image: postgres:16.4-alpine
|
40
|
+
command: postgres -c shared_preload_libraries=pg_stat_statements
|
41
|
+
environment:
|
42
|
+
POSTGRES_USER: postgres
|
43
|
+
POSTGRES_DB: rails-pg-extras-test
|
44
|
+
POSTGRES_PASSWORD: secret
|
45
|
+
ports:
|
46
|
+
- '5436:5432'
|
47
|
+
postgres17:
|
48
|
+
image: postgres:17.0-alpine
|
49
|
+
command: postgres -c shared_preload_libraries=pg_stat_statements
|
50
|
+
environment:
|
51
|
+
POSTGRES_USER: postgres
|
52
|
+
POSTGRES_DB: rails-pg-extras-test
|
53
|
+
POSTGRES_PASSWORD: secret
|
54
|
+
ports:
|
55
|
+
- '5437:5432'
|
56
|
+
|
data/lib/rails-pg-extras.rb
CHANGED
@@ -13,6 +13,7 @@ module RailsPgExtras
|
|
13
13
|
QUERIES = RubyPgExtras::QUERIES
|
14
14
|
DEFAULT_ARGS = RubyPgExtras::DEFAULT_ARGS
|
15
15
|
NEW_PG_STAT_STATEMENTS = RubyPgExtras::NEW_PG_STAT_STATEMENTS
|
16
|
+
PG_STAT_STATEMENTS_17 = RubyPgExtras::PG_STAT_STATEMENTS_17
|
16
17
|
|
17
18
|
QUERIES.each do |query_name|
|
18
19
|
define_singleton_method query_name do |options = {}|
|
@@ -33,6 +34,8 @@ module RailsPgExtras
|
|
33
34
|
.to_a[0].fetch("installed_version", nil))
|
34
35
|
if Gem::Version.new(version) < Gem::Version.new(NEW_PG_STAT_STATEMENTS)
|
35
36
|
query_name = "#{query_name}_legacy".to_sym
|
37
|
+
elsif Gem::Version.new(version) >= Gem::Version.new(PG_STAT_STATEMENTS_17)
|
38
|
+
query_name = "#{query_name}_17".to_sym
|
36
39
|
end
|
37
40
|
end
|
38
41
|
end
|
@@ -3,7 +3,9 @@ require "rails"
|
|
3
3
|
module RailsPgExtras::Web
|
4
4
|
class Engine < ::Rails::Engine
|
5
5
|
isolate_namespace RailsPgExtras::Web
|
6
|
-
|
7
6
|
config.middleware.use ActionDispatch::Flash
|
7
|
+
initializer "static assets" do |app|
|
8
|
+
app.middleware.insert_before(::ActionDispatch::Static, ::ActionDispatch::Static, "#{RailsPgExtras::Web::Engine.root}/assets")
|
9
|
+
end
|
8
10
|
end
|
9
11
|
end
|
data/spec/smoke_spec.rb
CHANGED
data/spec/spec_helper.rb
CHANGED
@@ -7,14 +7,18 @@ require_relative "../lib/rails-pg-extras"
|
|
7
7
|
|
8
8
|
pg_version = ENV["PG_VERSION"]
|
9
9
|
|
10
|
-
port = if pg_version == "
|
10
|
+
port = if pg_version == "12"
|
11
11
|
"5432"
|
12
|
-
elsif pg_version == "12"
|
13
|
-
"5433"
|
14
12
|
elsif pg_version == "13"
|
15
|
-
"
|
13
|
+
"5433"
|
16
14
|
elsif pg_version == "14"
|
15
|
+
"5434"
|
16
|
+
elsif pg_version == "15"
|
17
17
|
"5435"
|
18
|
+
elsif pg_version == "16"
|
19
|
+
"5436"
|
20
|
+
elsif pg_version == "17"
|
21
|
+
"5437"
|
18
22
|
else
|
19
23
|
"5432"
|
20
24
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rails-pg-extras
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 5.4.
|
4
|
+
version: 5.4.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- pawurb
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-11-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ruby-pg-extras
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - '='
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 5.4.
|
19
|
+
version: 5.4.2
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - '='
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 5.4.
|
26
|
+
version: 5.4.2
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rails
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -105,6 +105,8 @@ files:
|
|
105
105
|
- app/views/rails_pg_extras/web/queries/index.html.erb
|
106
106
|
- app/views/rails_pg_extras/web/queries/show.html.erb
|
107
107
|
- app/views/rails_pg_extras/web/shared/_queries_selector.html.erb
|
108
|
+
- assets/pg-extras-rails-ujs.js
|
109
|
+
- assets/pg-extras-tailwind.min.css
|
108
110
|
- config/routes.rb
|
109
111
|
- docker-compose.yml.sample
|
110
112
|
- lib/rails-pg-extras.rb
|