janus-ar 7.2.2 → 8.0.1
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/.github/workflows/ci.yml +67 -59
- data/.gitignore +1 -0
- data/.rubocop.yml +29 -26
- data/Gemfile.lock +142 -124
- data/README.md +130 -129
- data/bin/release.sh +1 -0
- data/gemfiles/activerecord_8_0.gemfile +7 -0
- data/gemfiles/activerecord_8_1.gemfile +7 -0
- data/janus-ar.gemspec +36 -36
- data/lib/janus-ar/active_record/connection_adapters/janus_mysql2_adapter.rb +32 -147
- data/lib/janus-ar/active_record/connection_adapters/janus_trilogy_adapter.rb +32 -148
- data/lib/janus-ar/adapter_extensions.rb +107 -0
- data/lib/janus-ar/context.rb +79 -80
- data/lib/janus-ar/query_director.rb +81 -54
- data/lib/janus-ar/railtie.rb +15 -0
- data/lib/janus-ar/version.rb +17 -17
- data/lib/janus-ar.rb +24 -22
- data/spec/lib/janus-ar/active_record/connection_adapters/janus_mysql_adapter_spec.rb +78 -82
- data/spec/lib/janus-ar/active_record/connection_adapters/janus_trilogy_adapter_spec.rb +77 -82
- data/spec/lib/janus-ar/context_spec.rb +118 -46
- data/spec/lib/janus-ar/db_console_config_spec.rb +28 -0
- data/spec/lib/janus-ar/logging/subscriber_spec.rb +58 -0
- data/spec/lib/janus-ar/query_director_spec.rb +141 -59
- data/spec/shared_examples/a_mysql_like_server.rb +70 -0
- metadata +25 -16
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 192027338ca77fe74dcf3d4ce10209514d57518e55be909c7d7fdf18c6bfcd44
|
|
4
|
+
data.tar.gz: 7d9cb1c366f05c08c19f07a6435673ddbbe8bc9ae07ab495e2f9901973ea932d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 6325a5fde59fc041a93182f97d294025a614e99ea974a9a018996af67895fcd28e1f9f156cebffe2366725b37fafca55b11d846dd7fe7ab4a1bd07c369d406f5
|
|
7
|
+
data.tar.gz: 1eea960641c63b5ba76e4fe285de967d04e79fea4e5de8eaeeffc082c97596dfcb9c3f0cb4e6524b452b59a8a4df8fc50ae2537c56561880c98f233502e34dc0
|
data/.github/workflows/ci.yml
CHANGED
|
@@ -1,60 +1,68 @@
|
|
|
1
|
-
name: CI
|
|
2
|
-
|
|
3
|
-
on:
|
|
4
|
-
push:
|
|
5
|
-
branches:
|
|
6
|
-
- main
|
|
7
|
-
pull_request:
|
|
8
|
-
|
|
9
|
-
jobs:
|
|
10
|
-
build:
|
|
11
|
-
runs-on: ubuntu-latest
|
|
12
|
-
strategy:
|
|
13
|
-
fail-fast: false
|
|
14
|
-
matrix:
|
|
15
|
-
ruby:
|
|
16
|
-
- '3.2'
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches:
|
|
6
|
+
- main
|
|
7
|
+
pull_request:
|
|
8
|
+
|
|
9
|
+
jobs:
|
|
10
|
+
build:
|
|
11
|
+
runs-on: ubuntu-latest
|
|
12
|
+
strategy:
|
|
13
|
+
fail-fast: false
|
|
14
|
+
matrix:
|
|
15
|
+
ruby:
|
|
16
|
+
- '3.2'
|
|
17
|
+
- '3.3'
|
|
18
|
+
- '3.4'
|
|
19
|
+
- '4.0'
|
|
20
|
+
gemfile:
|
|
21
|
+
- gemfiles/activerecord_8_0.gemfile
|
|
22
|
+
- gemfiles/activerecord_8_1.gemfile
|
|
23
|
+
name: Ruby ${{ matrix.ruby }} / ${{ matrix.gemfile }}
|
|
24
|
+
env:
|
|
25
|
+
BUNDLE_GEMFILE: ${{ matrix.gemfile }}
|
|
26
|
+
services:
|
|
27
|
+
mysql:
|
|
28
|
+
image: mysql:8.0
|
|
29
|
+
env:
|
|
30
|
+
MYSQL_DATABASE: test
|
|
31
|
+
MYSQL_ROOT_PASSWORD: password
|
|
32
|
+
MYSQL_USER: test
|
|
33
|
+
MYSQL_PASSWORD: test_password
|
|
34
|
+
ports:
|
|
35
|
+
- 3306:3306
|
|
36
|
+
options: >-
|
|
37
|
+
--health-cmd "mysqladmin ping"
|
|
38
|
+
--health-interval 10s
|
|
39
|
+
--health-timeout 5s
|
|
40
|
+
--health-retries 5
|
|
41
|
+
steps:
|
|
42
|
+
- uses: actions/checkout@v4
|
|
43
|
+
- uses: ruby/setup-ruby@v1
|
|
44
|
+
with:
|
|
45
|
+
ruby-version: ${{ matrix.ruby }}
|
|
46
|
+
bundler-cache: true
|
|
47
|
+
- run: |
|
|
48
|
+
mysql -e "CREATE USER 'replica'@'%' IDENTIFIED BY 'replica_password';" -u root -p${{ env.MYSQL_PASSWORD || 'password' }} -h 127.0.0.1
|
|
49
|
+
mysql -e "GRANT SELECT ON test.* TO 'replica'@'%'" -u root -p${{ env.MYSQL_PASSWORD || 'password' }} -h 127.0.0.1
|
|
50
|
+
|
|
51
|
+
mysql -e "CREATE USER 'primary'@'%' IDENTIFIED BY 'primary_password';" -u root -p${{ env.MYSQL_PASSWORD || 'password' }} -h 127.0.0.1
|
|
52
|
+
mysql -e "GRANT ALL PRIVILEGES ON *.* TO 'primary'@'%';" -u root -p${{ env.MYSQL_PASSWORD || 'password' }} -h 127.0.0.1
|
|
53
|
+
mysql -e "FLUSH PRIVILEGES;" -u root -p${{ env.MYSQL_PASSWORD || 'password' }} -h 127.0.0.1
|
|
54
|
+
- run: |
|
|
55
|
+
bundle exec rspec
|
|
56
|
+
env:
|
|
57
|
+
MYSQL_HOST: 127.0.0.1
|
|
58
|
+
RAILS_ENV: test
|
|
59
|
+
RuboCop:
|
|
60
|
+
runs-on: ubuntu-latest
|
|
61
|
+
steps:
|
|
62
|
+
- uses: actions/checkout@v4
|
|
63
|
+
- uses: ruby/setup-ruby@v1
|
|
64
|
+
with:
|
|
65
|
+
ruby-version: '3.2'
|
|
66
|
+
bundler-cache: true
|
|
67
|
+
- run: |
|
|
60
68
|
bundle exec rubocop --parallel --color
|
data/.gitignore
CHANGED
data/.rubocop.yml
CHANGED
|
@@ -1,26 +1,29 @@
|
|
|
1
|
-
inherit_from:
|
|
2
|
-
- https://tech.olioex.com/.support/rubocop-styling-v1.0
|
|
3
|
-
|
|
4
|
-
require:
|
|
5
|
-
- rubocop-rails
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
Enabled: false
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
1
|
+
inherit_from:
|
|
2
|
+
- https://tech.olioex.com/.support/rubocop-styling-v1.0
|
|
3
|
+
|
|
4
|
+
require:
|
|
5
|
+
- rubocop-rails
|
|
6
|
+
|
|
7
|
+
AllCops:
|
|
8
|
+
SuggestExtensions: false
|
|
9
|
+
|
|
10
|
+
Style/Documentation:
|
|
11
|
+
Enabled: false
|
|
12
|
+
|
|
13
|
+
Rails/Delegate:
|
|
14
|
+
Enabled: false
|
|
15
|
+
|
|
16
|
+
Metrics/BlockLength:
|
|
17
|
+
Exclude:
|
|
18
|
+
- spec/**/*
|
|
19
|
+
|
|
20
|
+
Style/GlobalVars:
|
|
21
|
+
Exclude:
|
|
22
|
+
- 'spec/**/*'
|
|
23
|
+
|
|
24
|
+
Naming/FileName:
|
|
25
|
+
Exclude:
|
|
26
|
+
- lib/janus-ar.rb
|
|
27
|
+
|
|
28
|
+
Metrics/AbcSize:
|
|
29
|
+
Max: 25
|
data/Gemfile.lock
CHANGED
|
@@ -1,124 +1,142 @@
|
|
|
1
|
-
PATH
|
|
2
|
-
remote: .
|
|
3
|
-
specs:
|
|
4
|
-
janus-ar (
|
|
5
|
-
activerecord (
|
|
6
|
-
|
|
7
|
-
GEM
|
|
8
|
-
remote: http://rubygems.org/
|
|
9
|
-
specs:
|
|
10
|
-
activemodel (
|
|
11
|
-
activesupport (=
|
|
12
|
-
activerecord (
|
|
13
|
-
activemodel (=
|
|
14
|
-
activesupport (=
|
|
15
|
-
timeout (>= 0.4.0)
|
|
16
|
-
activesupport (
|
|
17
|
-
base64
|
|
18
|
-
bigdecimal
|
|
19
|
-
concurrent-ruby (~> 1.0, >= 1.3.1)
|
|
20
|
-
connection_pool (>= 2.2.5)
|
|
21
|
-
drb
|
|
22
|
-
i18n (>= 1.6, < 2)
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
rspec
|
|
67
|
-
|
|
68
|
-
rspec-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
rubocop-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
1
|
+
PATH
|
|
2
|
+
remote: .
|
|
3
|
+
specs:
|
|
4
|
+
janus-ar (8.0.0)
|
|
5
|
+
activerecord (>= 8.0, < 9.0)
|
|
6
|
+
|
|
7
|
+
GEM
|
|
8
|
+
remote: http://rubygems.org/
|
|
9
|
+
specs:
|
|
10
|
+
activemodel (8.1.3)
|
|
11
|
+
activesupport (= 8.1.3)
|
|
12
|
+
activerecord (8.1.3)
|
|
13
|
+
activemodel (= 8.1.3)
|
|
14
|
+
activesupport (= 8.1.3)
|
|
15
|
+
timeout (>= 0.4.0)
|
|
16
|
+
activesupport (8.1.3)
|
|
17
|
+
base64
|
|
18
|
+
bigdecimal
|
|
19
|
+
concurrent-ruby (~> 1.0, >= 1.3.1)
|
|
20
|
+
connection_pool (>= 2.2.5)
|
|
21
|
+
drb
|
|
22
|
+
i18n (>= 1.6, < 2)
|
|
23
|
+
json
|
|
24
|
+
logger (>= 1.4.2)
|
|
25
|
+
minitest (>= 5.1)
|
|
26
|
+
securerandom (>= 0.3)
|
|
27
|
+
tzinfo (~> 2.0, >= 2.0.5)
|
|
28
|
+
uri (>= 0.13.1)
|
|
29
|
+
ast (2.4.3)
|
|
30
|
+
base64 (0.3.0)
|
|
31
|
+
bigdecimal (4.1.2)
|
|
32
|
+
coderay (1.1.3)
|
|
33
|
+
concurrent-ruby (1.3.6)
|
|
34
|
+
connection_pool (3.0.2)
|
|
35
|
+
diff-lcs (1.6.2)
|
|
36
|
+
drb (2.2.3)
|
|
37
|
+
i18n (1.14.8)
|
|
38
|
+
concurrent-ruby (~> 1.0)
|
|
39
|
+
io-console (0.8.2)
|
|
40
|
+
json (2.19.9)
|
|
41
|
+
language_server-protocol (3.17.0.5)
|
|
42
|
+
lint_roller (1.1.0)
|
|
43
|
+
logger (1.7.0)
|
|
44
|
+
method_source (1.1.0)
|
|
45
|
+
minitest (6.0.6)
|
|
46
|
+
drb (~> 2.0)
|
|
47
|
+
prism (~> 1.5)
|
|
48
|
+
mysql2 (0.5.7)
|
|
49
|
+
bigdecimal
|
|
50
|
+
parallel (1.28.0)
|
|
51
|
+
parser (3.3.11.1)
|
|
52
|
+
ast (~> 2.4.1)
|
|
53
|
+
racc
|
|
54
|
+
prism (1.9.0)
|
|
55
|
+
pry (0.16.0)
|
|
56
|
+
coderay (~> 1.1)
|
|
57
|
+
method_source (~> 1.0)
|
|
58
|
+
reline (>= 0.6.0)
|
|
59
|
+
racc (1.8.1)
|
|
60
|
+
rack (3.2.6)
|
|
61
|
+
rainbow (3.1.1)
|
|
62
|
+
rake (13.4.2)
|
|
63
|
+
regexp_parser (2.12.0)
|
|
64
|
+
reline (0.6.3)
|
|
65
|
+
io-console (~> 0.5)
|
|
66
|
+
rspec (3.13.2)
|
|
67
|
+
rspec-core (~> 3.13.0)
|
|
68
|
+
rspec-expectations (~> 3.13.0)
|
|
69
|
+
rspec-mocks (~> 3.13.0)
|
|
70
|
+
rspec-core (3.13.6)
|
|
71
|
+
rspec-support (~> 3.13.0)
|
|
72
|
+
rspec-expectations (3.13.5)
|
|
73
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
|
74
|
+
rspec-support (~> 3.13.0)
|
|
75
|
+
rspec-mocks (3.13.7)
|
|
76
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
|
77
|
+
rspec-support (~> 3.13.0)
|
|
78
|
+
rspec-support (3.13.7)
|
|
79
|
+
rubocop (1.88.0)
|
|
80
|
+
json (~> 2.3)
|
|
81
|
+
language_server-protocol (~> 3.17.0.2)
|
|
82
|
+
lint_roller (~> 1.1.0)
|
|
83
|
+
parallel (>= 1.10)
|
|
84
|
+
parser (>= 3.3.0.2)
|
|
85
|
+
rainbow (>= 2.2.2, < 4.0)
|
|
86
|
+
regexp_parser (>= 2.9.3, < 3.0)
|
|
87
|
+
rubocop-ast (>= 1.49.0, < 2.0)
|
|
88
|
+
ruby-progressbar (~> 1.7)
|
|
89
|
+
unicode-display_width (>= 2.4.0, < 4.0)
|
|
90
|
+
rubocop-ast (1.49.1)
|
|
91
|
+
parser (>= 3.3.7.2)
|
|
92
|
+
prism (~> 1.7)
|
|
93
|
+
rubocop-performance (1.26.1)
|
|
94
|
+
lint_roller (~> 1.1)
|
|
95
|
+
rubocop (>= 1.75.0, < 2.0)
|
|
96
|
+
rubocop-ast (>= 1.47.1, < 2.0)
|
|
97
|
+
rubocop-rails (2.35.4)
|
|
98
|
+
activesupport (>= 4.2.0)
|
|
99
|
+
lint_roller (~> 1.1)
|
|
100
|
+
rack (>= 1.1)
|
|
101
|
+
rubocop (>= 1.75.0, < 2.0)
|
|
102
|
+
rubocop-ast (>= 1.44.0, < 2.0)
|
|
103
|
+
rubocop-rspec (3.10.2)
|
|
104
|
+
lint_roller (~> 1.1)
|
|
105
|
+
regexp_parser (>= 2.0)
|
|
106
|
+
rubocop (~> 1.86, >= 1.86.2)
|
|
107
|
+
rubocop-thread_safety (0.7.3)
|
|
108
|
+
lint_roller (~> 1.1)
|
|
109
|
+
rubocop (~> 1.72, >= 1.72.1)
|
|
110
|
+
rubocop-ast (>= 1.44.0, < 2.0)
|
|
111
|
+
ruby-progressbar (1.13.0)
|
|
112
|
+
securerandom (0.4.1)
|
|
113
|
+
timeout (0.6.1)
|
|
114
|
+
trilogy (2.12.5)
|
|
115
|
+
bigdecimal
|
|
116
|
+
tzinfo (2.0.6)
|
|
117
|
+
concurrent-ruby (~> 1.0)
|
|
118
|
+
unicode-display_width (3.2.0)
|
|
119
|
+
unicode-emoji (~> 4.1)
|
|
120
|
+
unicode-emoji (4.2.0)
|
|
121
|
+
uri (1.1.1)
|
|
122
|
+
|
|
123
|
+
PLATFORMS
|
|
124
|
+
arm64-darwin-23
|
|
125
|
+
x86_64-linux
|
|
126
|
+
|
|
127
|
+
DEPENDENCIES
|
|
128
|
+
activesupport (>= 8.0)
|
|
129
|
+
janus-ar!
|
|
130
|
+
mysql2
|
|
131
|
+
pry
|
|
132
|
+
rake
|
|
133
|
+
rspec (~> 3)
|
|
134
|
+
rubocop (~> 1.88.0)
|
|
135
|
+
rubocop-performance
|
|
136
|
+
rubocop-rails (~> 2.35.2)
|
|
137
|
+
rubocop-rspec
|
|
138
|
+
rubocop-thread_safety
|
|
139
|
+
trilogy
|
|
140
|
+
|
|
141
|
+
BUNDLED WITH
|
|
142
|
+
2.4.22
|