rails-pg-extras 5.4.0 → 5.4.1
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 +33 -30
- data/Rakefile +1 -1
- 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/spec/smoke_spec.rb +1 -0
- data/spec/spec_helper.rb +8 -4
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: eae7b49e84af570a46a1442642dcc8a1f9abc78d660489d777715b7fde100224
|
4
|
+
data.tar.gz: 4fd17ae15d5dc2b0eddfd8f4770dfe062efeee119d1d797f4ffb00c4e8e369f8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f0f610b3eea483eaf8a7d2e321a0af7a805633d70e1e473905d0aae5993f5dc70055a39cee07634f3e7dc1691cd70c77d9b25440018e0b6550645378b65aadf8
|
7
|
+
data.tar.gz: e506327e15ee0d8072f74b712abb4552c0dfe34b8f6dfd53149dbd439bf4bba96064d1c61bf5dfae979a46571fb9dd776382893890740648ae8bb624a932aa9c
|
data/.github/workflows/ci.yml
CHANGED
@@ -12,43 +12,52 @@ jobs:
|
|
12
12
|
strategy:
|
13
13
|
fail-fast: false
|
14
14
|
matrix:
|
15
|
-
ruby-version: ['3.2', '3.1', '3.0', '2.7', '2.6']
|
15
|
+
ruby-version: ['3.3', '3.2', '3.1', '3.0', '2.7', '2.6']
|
16
16
|
steps:
|
17
|
-
- uses: actions/checkout@
|
18
|
-
- name: Run PostgreSQL
|
17
|
+
- uses: actions/checkout@v4
|
18
|
+
- name: Run PostgreSQL 12
|
19
19
|
run: |
|
20
20
|
docker run --env POSTGRES_USER=postgres \
|
21
21
|
--env POSTGRES_DB=rails-pg-extras-test \
|
22
22
|
--env POSTGRES_PASSWORD=secret \
|
23
|
-
-d -p 5432:5432 postgres:
|
23
|
+
-d -p 5432:5432 postgres:12.20-alpine \
|
24
24
|
postgres -c shared_preload_libraries=pg_stat_statements
|
25
|
-
- name: Run PostgreSQL
|
25
|
+
- name: Run PostgreSQL 13
|
26
26
|
run: |
|
27
27
|
docker run --env POSTGRES_USER=postgres \
|
28
28
|
--env POSTGRES_DB=rails-pg-extras-test \
|
29
29
|
--env POSTGRES_PASSWORD=secret \
|
30
|
-
-d -p 5433:5432 postgres:
|
30
|
+
-d -p 5433:5432 postgres:13.16-alpine \
|
31
31
|
postgres -c shared_preload_libraries=pg_stat_statements
|
32
|
-
- name: Run PostgreSQL
|
32
|
+
- name: Run PostgreSQL 14
|
33
33
|
run: |
|
34
34
|
docker run --env POSTGRES_USER=postgres \
|
35
35
|
--env POSTGRES_DB=rails-pg-extras-test \
|
36
36
|
--env POSTGRES_PASSWORD=secret \
|
37
|
-
-d -p 5434:5432 postgres:13
|
37
|
+
-d -p 5434:5432 postgres:14.13-alpine \
|
38
38
|
postgres -c shared_preload_libraries=pg_stat_statements
|
39
|
-
- name: Run PostgreSQL
|
39
|
+
- name: Run PostgreSQL 15
|
40
40
|
run: |
|
41
41
|
docker run --env POSTGRES_USER=postgres \
|
42
42
|
--env POSTGRES_DB=rails-pg-extras-test \
|
43
43
|
--env POSTGRES_PASSWORD=secret \
|
44
|
-
-d -p 5435:5432 postgres:
|
44
|
+
-d -p 5435:5432 postgres:15.8-alpine \
|
45
45
|
postgres -c shared_preload_libraries=pg_stat_statements
|
46
|
-
|
46
|
+
sleep 15
|
47
|
+
- name: Run PostgreSQL 16
|
48
|
+
run: |
|
49
|
+
docker run --env POSTGRES_USER=postgres \
|
50
|
+
--env POSTGRES_DB=rails-pg-extras-test \
|
51
|
+
--env POSTGRES_PASSWORD=secret \
|
52
|
+
-d -p 5436:5432 postgres:16.4-alpine \
|
53
|
+
postgres -c shared_preload_libraries=pg_stat_statements
|
54
|
+
sleep 15
|
55
|
+
- name: Run PostgreSQL 17
|
47
56
|
run: |
|
48
57
|
docker run --env POSTGRES_USER=postgres \
|
49
58
|
--env POSTGRES_DB=rails-pg-extras-test \
|
50
59
|
--env POSTGRES_PASSWORD=secret \
|
51
|
-
-d -p
|
60
|
+
-d -p 5437:5432 postgres:17.0-alpine \
|
52
61
|
postgres -c shared_preload_libraries=pg_stat_statements
|
53
62
|
sleep 15
|
54
63
|
- name: Set up Ruby ${{ matrix.ruby-version }}
|
@@ -64,64 +73,58 @@ jobs:
|
|
64
73
|
bundle config set --local path 'vendor/bundle'
|
65
74
|
bundle install
|
66
75
|
sleep 10
|
67
|
-
- name: Run tests for PG
|
76
|
+
- name: Run tests for PG 12
|
68
77
|
env:
|
69
|
-
PG_VERSION:
|
78
|
+
PG_VERSION: 12
|
70
79
|
POSTGRES_HOST: localhost
|
71
80
|
POSTGRES_USER: postgres
|
72
81
|
POSTGRES_DB: rails-pg-extras-test
|
73
82
|
POSTGRES_PASSWORD: secret
|
74
|
-
DATABASE_URL: postgresql://postgres:secret@localhost:5432/rails-pg-extras-test
|
75
83
|
run: |
|
76
84
|
bundle exec rspec spec/
|
77
|
-
- name: Run tests for PG
|
85
|
+
- name: Run tests for PG 13
|
78
86
|
env:
|
79
|
-
PG_VERSION:
|
87
|
+
PG_VERSION: 13
|
80
88
|
POSTGRES_HOST: localhost
|
81
89
|
POSTGRES_USER: postgres
|
82
90
|
POSTGRES_DB: rails-pg-extras-test
|
83
91
|
POSTGRES_PASSWORD: secret
|
84
|
-
DATABASE_URL: postgresql://postgres:secret@localhost:5432/rails-pg-extras-test
|
85
92
|
run: |
|
86
93
|
bundle exec rspec spec/
|
87
|
-
- name: Run tests for PG
|
94
|
+
- name: Run tests for PG 14
|
88
95
|
env:
|
89
|
-
PG_VERSION:
|
96
|
+
PG_VERSION: 14
|
90
97
|
POSTGRES_HOST: localhost
|
91
98
|
POSTGRES_USER: postgres
|
92
99
|
POSTGRES_DB: rails-pg-extras-test
|
93
100
|
POSTGRES_PASSWORD: secret
|
94
|
-
DATABASE_URL: postgresql://postgres:secret@localhost:5433/rails-pg-extras-test
|
95
101
|
run: |
|
96
102
|
bundle exec rspec spec/
|
97
|
-
- name: Run tests for PG
|
103
|
+
- name: Run tests for PG 15
|
98
104
|
env:
|
99
|
-
PG_VERSION:
|
105
|
+
PG_VERSION: 15
|
100
106
|
POSTGRES_HOST: localhost
|
101
107
|
POSTGRES_USER: postgres
|
102
108
|
POSTGRES_DB: rails-pg-extras-test
|
103
109
|
POSTGRES_PASSWORD: secret
|
104
|
-
DATABASE_URL: postgresql://postgres:secret@localhost:5434/rails-pg-extras-test
|
105
110
|
run: |
|
106
111
|
bundle exec rspec spec/
|
107
|
-
- name: Run tests for PG
|
112
|
+
- name: Run tests for PG 16
|
108
113
|
env:
|
109
|
-
PG_VERSION:
|
114
|
+
PG_VERSION: 16
|
110
115
|
POSTGRES_HOST: localhost
|
111
116
|
POSTGRES_USER: postgres
|
112
117
|
POSTGRES_DB: rails-pg-extras-test
|
113
118
|
POSTGRES_PASSWORD: secret
|
114
|
-
DATABASE_URL: postgresql://postgres:secret@localhost:5435/rails-pg-extras-test
|
115
119
|
run: |
|
116
120
|
bundle exec rspec spec/
|
117
|
-
- name: Run tests for PG
|
121
|
+
- name: Run tests for PG 17
|
118
122
|
env:
|
119
|
-
PG_VERSION:
|
123
|
+
PG_VERSION: 17
|
120
124
|
POSTGRES_HOST: localhost
|
121
125
|
POSTGRES_USER: postgres
|
122
126
|
POSTGRES_DB: rails-pg-extras-test
|
123
127
|
POSTGRES_PASSWORD: secret
|
124
|
-
DATABASE_URL: postgresql://postgres:secret@localhost:5436/rails-pg-extras-test
|
125
128
|
run: |
|
126
129
|
bundle exec rspec spec/
|
127
130
|
|
data/Rakefile
CHANGED
@@ -5,5 +5,5 @@ RSpec::Core::RakeTask.new(:spec)
|
|
5
5
|
|
6
6
|
desc "Test all PG versions"
|
7
7
|
task :test_all do
|
8
|
-
system("PG_VERSION=
|
8
|
+
system("PG_VERSION=12 bundle exec rspec spec/ && PG_VERSION=13 bundle exec rspec spec/ && PG_VERSION=14 bundle exec rspec spec/ && PG_VERSION=15 bundle exec rspec spec/ && PG_VERSION=16 bundle exec rspec spec/ && PG_VERSION=17 bundle exec rspec spec/")
|
9
9
|
end
|
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
|
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.1
|
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-10-08 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.1
|
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.1
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rails
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|