janus-ar 0.15.2 → 7.2.0
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 +59 -59
- data/.rubocop.yml +26 -22
- data/Gemfile.lock +123 -128
- data/README.md +129 -110
- data/Rakefile +2 -0
- data/janus-ar.gemspec +36 -36
- data/lib/{active_record → janus-ar/active_record}/connection_adapters/janus_mysql2_adapter.rb +148 -144
- data/lib/{active_record → janus-ar/active_record}/connection_adapters/janus_trilogy_adapter.rb +148 -144
- data/lib/{janus → janus-ar}/client.rb +6 -6
- data/lib/{janus → janus-ar}/context.rb +80 -80
- data/lib/{janus → janus-ar}/db_console_config.rb +17 -17
- data/lib/{janus → janus-ar}/logging/logger.rb +15 -15
- data/lib/{janus → janus-ar}/logging/subscriber.rb +27 -27
- data/lib/{janus → janus-ar}/query_director.rb +54 -54
- data/lib/{janus → janus-ar}/version.rb +17 -17
- data/lib/janus-ar.rb +22 -0
- data/spec/lib/{active_record → janus-ar/active_record}/connection_adapters/janus_mysql_adapter_spec.rb +82 -76
- data/spec/lib/{active_record → janus-ar/active_record}/connection_adapters/janus_trilogy_adapter_spec.rb +82 -80
- data/spec/lib/{janus → janus-ar}/client_spec.rb +7 -7
- data/spec/lib/{janus → janus-ar}/context_spec.rb +46 -46
- data/spec/lib/{janus → janus-ar}/logging/logger_spec.rb +31 -31
- data/spec/lib/{janus → janus-ar}/query_director_spec.rb +59 -59
- data/spec/spec_helper.rb +46 -43
- metadata +30 -30
- data/lib/janus.rb +0 -22
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d9a0e04cbb2ece10c1a3fec2d0c1036788eaa290e36f5af3ea78812e8de6ac6c
|
4
|
+
data.tar.gz: 4cdf47f493d980f0c90b2bdb1d45468163cc58bf7d88c60956dc12e62dd2983d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1cc3b11d2a1f77ffd74c13fb61d9a6b012fa95375c030f93317be8a02052cc899c3750dbda3273efc4344e9bfc259c22d385842d9ad829ebde770ec3c911d969
|
7
|
+
data.tar.gz: 2abaface3c1b02a535a3b467b047ed03ab67ee5b57396363253fa975ab89b39cffaf0386b08968b9001f86623779b92ef31189cd91598242a31934ae1b71e8d9
|
data/.github/workflows/ci.yml
CHANGED
@@ -1,60 +1,60 @@
|
|
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
|
-
name: Ruby ${{ matrix.ruby }}
|
18
|
-
services:
|
19
|
-
mysql:
|
20
|
-
image: mysql:8
|
21
|
-
env:
|
22
|
-
MYSQL_DATABASE: test
|
23
|
-
MYSQL_ROOT_PASSWORD: password
|
24
|
-
MYSQL_USER: test
|
25
|
-
MYSQL_PASSWORD: test_password
|
26
|
-
ports:
|
27
|
-
- 3306:3306
|
28
|
-
options: >-
|
29
|
-
--health-cmd "mysqladmin ping"
|
30
|
-
--health-interval 10s
|
31
|
-
--health-timeout 5s
|
32
|
-
--health-retries 5
|
33
|
-
steps:
|
34
|
-
- uses: actions/checkout@v2
|
35
|
-
- uses: ruby/setup-ruby@v1
|
36
|
-
with:
|
37
|
-
ruby-version: ${{ matrix.ruby }}
|
38
|
-
bundler-cache: true
|
39
|
-
- run: |
|
40
|
-
mysql -e "CREATE USER 'replica'@'%' IDENTIFIED
|
41
|
-
mysql -e "GRANT SELECT ON test.* TO 'replica'@'%'" -u root -p${{ env.MYSQL_PASSWORD || 'password' }} -h 127.0.0.1
|
42
|
-
|
43
|
-
mysql -e "CREATE USER 'primary'@'%' IDENTIFIED
|
44
|
-
mysql -e "GRANT ALL PRIVILEGES ON *.* TO 'primary'@'%';" -u root -p${{ env.MYSQL_PASSWORD || 'password' }} -h 127.0.0.1
|
45
|
-
mysql -e "FLUSH PRIVILEGES;" -u root -p${{ env.MYSQL_PASSWORD || 'password' }} -h 127.0.0.1
|
46
|
-
- run: |
|
47
|
-
bundle exec rspec
|
48
|
-
env:
|
49
|
-
MYSQL_HOST: 127.0.0.1
|
50
|
-
RAILS_ENV: test
|
51
|
-
RuboCop:
|
52
|
-
runs-on: ubuntu-latest
|
53
|
-
steps:
|
54
|
-
- uses: actions/checkout@v2
|
55
|
-
- uses: ruby/setup-ruby@v1
|
56
|
-
with:
|
57
|
-
ruby-version: '3.2'
|
58
|
-
bundler-cache: true
|
59
|
-
- run: |
|
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
|
+
name: Ruby ${{ matrix.ruby }}
|
18
|
+
services:
|
19
|
+
mysql:
|
20
|
+
image: mysql:8
|
21
|
+
env:
|
22
|
+
MYSQL_DATABASE: test
|
23
|
+
MYSQL_ROOT_PASSWORD: password
|
24
|
+
MYSQL_USER: test
|
25
|
+
MYSQL_PASSWORD: test_password
|
26
|
+
ports:
|
27
|
+
- 3306:3306
|
28
|
+
options: >-
|
29
|
+
--health-cmd "mysqladmin ping"
|
30
|
+
--health-interval 10s
|
31
|
+
--health-timeout 5s
|
32
|
+
--health-retries 5
|
33
|
+
steps:
|
34
|
+
- uses: actions/checkout@v2
|
35
|
+
- uses: ruby/setup-ruby@v1
|
36
|
+
with:
|
37
|
+
ruby-version: ${{ matrix.ruby }}
|
38
|
+
bundler-cache: true
|
39
|
+
- run: |
|
40
|
+
mysql -e "CREATE USER 'replica'@'%' IDENTIFIED BY 'replica_password';" -u root -p${{ env.MYSQL_PASSWORD || 'password' }} -h 127.0.0.1
|
41
|
+
mysql -e "GRANT SELECT ON test.* TO 'replica'@'%'" -u root -p${{ env.MYSQL_PASSWORD || 'password' }} -h 127.0.0.1
|
42
|
+
|
43
|
+
mysql -e "CREATE USER 'primary'@'%' IDENTIFIED BY 'primary_password';" -u root -p${{ env.MYSQL_PASSWORD || 'password' }} -h 127.0.0.1
|
44
|
+
mysql -e "GRANT ALL PRIVILEGES ON *.* TO 'primary'@'%';" -u root -p${{ env.MYSQL_PASSWORD || 'password' }} -h 127.0.0.1
|
45
|
+
mysql -e "FLUSH PRIVILEGES;" -u root -p${{ env.MYSQL_PASSWORD || 'password' }} -h 127.0.0.1
|
46
|
+
- run: |
|
47
|
+
bundle exec rspec
|
48
|
+
env:
|
49
|
+
MYSQL_HOST: 127.0.0.1
|
50
|
+
RAILS_ENV: test
|
51
|
+
RuboCop:
|
52
|
+
runs-on: ubuntu-latest
|
53
|
+
steps:
|
54
|
+
- uses: actions/checkout@v2
|
55
|
+
- uses: ruby/setup-ruby@v1
|
56
|
+
with:
|
57
|
+
ruby-version: '3.2'
|
58
|
+
bundler-cache: true
|
59
|
+
- run: |
|
60
60
|
bundle exec rubocop --parallel --color
|
data/.rubocop.yml
CHANGED
@@ -1,22 +1,26 @@
|
|
1
|
-
inherit_from:
|
2
|
-
- https://tech.olioex.com/.support/rubocop-styling-v1.0
|
3
|
-
|
4
|
-
require:
|
5
|
-
- rubocop-rails
|
6
|
-
|
7
|
-
Style/Documentation:
|
8
|
-
Enabled: false
|
9
|
-
|
10
|
-
Rails/Delegate:
|
11
|
-
Enabled: false
|
12
|
-
|
13
|
-
Metrics/BlockLength:
|
14
|
-
Exclude:
|
15
|
-
- spec/**/*
|
16
|
-
|
17
|
-
Style/GlobalVars:
|
18
|
-
Exclude:
|
19
|
-
- 'spec/**/*'
|
20
|
-
|
21
|
-
|
22
|
-
|
1
|
+
inherit_from:
|
2
|
+
- https://tech.olioex.com/.support/rubocop-styling-v1.0
|
3
|
+
|
4
|
+
require:
|
5
|
+
- rubocop-rails
|
6
|
+
|
7
|
+
Style/Documentation:
|
8
|
+
Enabled: false
|
9
|
+
|
10
|
+
Rails/Delegate:
|
11
|
+
Enabled: false
|
12
|
+
|
13
|
+
Metrics/BlockLength:
|
14
|
+
Exclude:
|
15
|
+
- spec/**/*
|
16
|
+
|
17
|
+
Style/GlobalVars:
|
18
|
+
Exclude:
|
19
|
+
- 'spec/**/*'
|
20
|
+
|
21
|
+
Naming/FileName:
|
22
|
+
Exclude:
|
23
|
+
- lib/janus-ar.rb
|
24
|
+
|
25
|
+
Metrics/AbcSize:
|
26
|
+
Max: 25
|
data/Gemfile.lock
CHANGED
@@ -1,128 +1,123 @@
|
|
1
|
-
PATH
|
2
|
-
remote: .
|
3
|
-
specs:
|
4
|
-
janus-ar (
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
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
|
-
rspec-
|
60
|
-
|
61
|
-
|
62
|
-
rspec-support (~> 3.13.0)
|
63
|
-
rspec-
|
64
|
-
diff-lcs (>= 1.2.0, < 2.0)
|
65
|
-
rspec-support (~> 3.13.0)
|
66
|
-
rspec-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
rubocop (>= 1.
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
rubocop (>= 1.
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
rubocop
|
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
|
-
rubocop-thread_safety
|
125
|
-
trilogy
|
126
|
-
|
127
|
-
BUNDLED WITH
|
128
|
-
2.4.22
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
janus-ar (7.2.0)
|
5
|
+
activerecord (~> 7.2)
|
6
|
+
|
7
|
+
GEM
|
8
|
+
remote: http://rubygems.org/
|
9
|
+
specs:
|
10
|
+
activemodel (7.2.1)
|
11
|
+
activesupport (= 7.2.1)
|
12
|
+
activerecord (7.2.1)
|
13
|
+
activemodel (= 7.2.1)
|
14
|
+
activesupport (= 7.2.1)
|
15
|
+
timeout (>= 0.4.0)
|
16
|
+
activesupport (7.2.1)
|
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
|
+
logger (>= 1.4.2)
|
24
|
+
minitest (>= 5.1)
|
25
|
+
securerandom (>= 0.3)
|
26
|
+
tzinfo (~> 2.0, >= 2.0.5)
|
27
|
+
ast (2.4.2)
|
28
|
+
base64 (0.2.0)
|
29
|
+
bigdecimal (3.1.8)
|
30
|
+
coderay (1.1.3)
|
31
|
+
concurrent-ruby (1.3.4)
|
32
|
+
connection_pool (2.4.1)
|
33
|
+
diff-lcs (1.5.1)
|
34
|
+
drb (2.2.1)
|
35
|
+
i18n (1.14.5)
|
36
|
+
concurrent-ruby (~> 1.0)
|
37
|
+
json (2.7.2)
|
38
|
+
language_server-protocol (3.17.0.3)
|
39
|
+
logger (1.6.0)
|
40
|
+
method_source (1.0.0)
|
41
|
+
minitest (5.25.1)
|
42
|
+
mysql2 (0.5.6)
|
43
|
+
parallel (1.26.3)
|
44
|
+
parser (3.3.4.2)
|
45
|
+
ast (~> 2.4.1)
|
46
|
+
racc
|
47
|
+
pry (0.14.2)
|
48
|
+
coderay (~> 1.1)
|
49
|
+
method_source (~> 1.0)
|
50
|
+
racc (1.8.1)
|
51
|
+
rack (3.1.7)
|
52
|
+
rainbow (3.1.1)
|
53
|
+
rake (13.2.1)
|
54
|
+
regexp_parser (2.9.2)
|
55
|
+
rexml (3.3.6)
|
56
|
+
strscan
|
57
|
+
rspec (3.13.0)
|
58
|
+
rspec-core (~> 3.13.0)
|
59
|
+
rspec-expectations (~> 3.13.0)
|
60
|
+
rspec-mocks (~> 3.13.0)
|
61
|
+
rspec-core (3.13.0)
|
62
|
+
rspec-support (~> 3.13.0)
|
63
|
+
rspec-expectations (3.13.0)
|
64
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
65
|
+
rspec-support (~> 3.13.0)
|
66
|
+
rspec-mocks (3.13.0)
|
67
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
68
|
+
rspec-support (~> 3.13.0)
|
69
|
+
rspec-support (3.13.1)
|
70
|
+
rubocop (1.65.1)
|
71
|
+
json (~> 2.3)
|
72
|
+
language_server-protocol (>= 3.17.0)
|
73
|
+
parallel (~> 1.10)
|
74
|
+
parser (>= 3.3.0.2)
|
75
|
+
rainbow (>= 2.2.2, < 4.0)
|
76
|
+
regexp_parser (>= 2.4, < 3.0)
|
77
|
+
rexml (>= 3.2.5, < 4.0)
|
78
|
+
rubocop-ast (>= 1.31.1, < 2.0)
|
79
|
+
ruby-progressbar (~> 1.7)
|
80
|
+
unicode-display_width (>= 2.4.0, < 3.0)
|
81
|
+
rubocop-ast (1.32.1)
|
82
|
+
parser (>= 3.3.1.0)
|
83
|
+
rubocop-performance (1.21.1)
|
84
|
+
rubocop (>= 1.48.1, < 2.0)
|
85
|
+
rubocop-ast (>= 1.31.1, < 2.0)
|
86
|
+
rubocop-rails (2.26.0)
|
87
|
+
activesupport (>= 4.2.0)
|
88
|
+
rack (>= 1.1)
|
89
|
+
rubocop (>= 1.52.0, < 2.0)
|
90
|
+
rubocop-ast (>= 1.31.1, < 2.0)
|
91
|
+
rubocop-rspec (3.0.4)
|
92
|
+
rubocop (~> 1.61)
|
93
|
+
rubocop-thread_safety (0.5.1)
|
94
|
+
rubocop (>= 0.90.0)
|
95
|
+
ruby-progressbar (1.13.0)
|
96
|
+
securerandom (0.3.1)
|
97
|
+
strscan (3.1.0)
|
98
|
+
timeout (0.4.1)
|
99
|
+
trilogy (2.8.1)
|
100
|
+
tzinfo (2.0.6)
|
101
|
+
concurrent-ruby (~> 1.0)
|
102
|
+
unicode-display_width (2.5.0)
|
103
|
+
|
104
|
+
PLATFORMS
|
105
|
+
arm64-darwin-23
|
106
|
+
x86_64-linux
|
107
|
+
|
108
|
+
DEPENDENCIES
|
109
|
+
activesupport (>= 7.2.0)
|
110
|
+
janus-ar!
|
111
|
+
mysql2
|
112
|
+
pry
|
113
|
+
rake
|
114
|
+
rspec (~> 3)
|
115
|
+
rubocop (~> 1.65.0)
|
116
|
+
rubocop-performance
|
117
|
+
rubocop-rails (~> 2.26.0)
|
118
|
+
rubocop-rspec
|
119
|
+
rubocop-thread_safety
|
120
|
+
trilogy
|
121
|
+
|
122
|
+
BUNDLED WITH
|
123
|
+
2.4.22
|