activerecord-jdbc-alt-adapter 61.2.0-java → 70.0.0.rc2-java

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.
Files changed (78) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/main.yml +118 -0
  3. data/.github/workflows/ruby.yml +273 -0
  4. data/.gitignore +1 -0
  5. data/.travis.yml +3 -4
  6. data/Gemfile +9 -7
  7. data/README.md +5 -1
  8. data/Rakefile +1 -1
  9. data/activerecord-jdbc-adapter.gemspec +2 -2
  10. data/activerecord-jdbc-alt-adapter.gemspec +2 -2
  11. data/lib/arel/visitors/compat.rb +5 -33
  12. data/lib/arel/visitors/h2.rb +1 -13
  13. data/lib/arel/visitors/hsqldb.rb +1 -21
  14. data/lib/arel/visitors/sql_server.rb +2 -103
  15. data/lib/arjdbc/abstract/core.rb +8 -9
  16. data/lib/arjdbc/abstract/database_statements.rb +4 -4
  17. data/lib/arjdbc/discover.rb +0 -67
  18. data/lib/arjdbc/hsqldb/adapter.rb +2 -2
  19. data/lib/arjdbc/jdbc/adapter.rb +3 -3
  20. data/lib/arjdbc/jdbc/adapter_java.jar +0 -0
  21. data/lib/arjdbc/jdbc/adapter_require.rb +3 -1
  22. data/lib/arjdbc/jdbc/column.rb +1 -26
  23. data/lib/arjdbc/jdbc/type_cast.rb +2 -2
  24. data/lib/arjdbc/jdbc.rb +0 -7
  25. data/lib/arjdbc/mssql/adapter.rb +138 -108
  26. data/lib/arjdbc/mssql/quoting.rb +26 -27
  27. data/lib/arjdbc/mssql/schema_creation.rb +1 -1
  28. data/lib/arjdbc/mssql/schema_definitions.rb +32 -17
  29. data/lib/arjdbc/mssql/schema_dumper.rb +13 -1
  30. data/lib/arjdbc/mssql/schema_statements.rb +61 -36
  31. data/lib/arjdbc/mssql/transaction.rb +2 -2
  32. data/lib/arjdbc/mssql/types/date_and_time_types.rb +6 -6
  33. data/lib/arjdbc/mssql/types/numeric_types.rb +2 -2
  34. data/lib/arjdbc/mssql.rb +1 -1
  35. data/lib/arjdbc/mysql/adapter.rb +2 -1
  36. data/lib/arjdbc/oracle/adapter.rb +4 -23
  37. data/lib/arjdbc/postgresql/adapter.rb +152 -4
  38. data/lib/arjdbc/postgresql/oid_types.rb +142 -106
  39. data/lib/arjdbc/sqlite3/adapter.rb +132 -88
  40. data/lib/arjdbc/tasks/database_tasks.rb +0 -12
  41. data/lib/arjdbc/util/serialized_attributes.rb +0 -22
  42. data/lib/arjdbc/util/table_copier.rb +2 -1
  43. data/lib/arjdbc/version.rb +1 -1
  44. data/rakelib/02-test.rake +3 -18
  45. data/src/java/arjdbc/jdbc/RubyJdbcConnection.java +17 -2
  46. data/src/java/arjdbc/postgresql/PostgreSQLRubyJdbcConnection.java +5 -0
  47. data/src/java/arjdbc/sqlite3/SQLite3RubyJdbcConnection.java +33 -0
  48. metadata +9 -40
  49. data/lib/active_record/connection_adapters/as400_adapter.rb +0 -2
  50. data/lib/active_record/connection_adapters/db2_adapter.rb +0 -1
  51. data/lib/active_record/connection_adapters/derby_adapter.rb +0 -1
  52. data/lib/active_record/connection_adapters/informix_adapter.rb +0 -1
  53. data/lib/arel/visitors/db2.rb +0 -137
  54. data/lib/arel/visitors/derby.rb +0 -112
  55. data/lib/arel/visitors/firebird.rb +0 -79
  56. data/lib/arjdbc/db2/adapter.rb +0 -808
  57. data/lib/arjdbc/db2/as400.rb +0 -142
  58. data/lib/arjdbc/db2/column.rb +0 -131
  59. data/lib/arjdbc/db2/connection_methods.rb +0 -48
  60. data/lib/arjdbc/db2.rb +0 -4
  61. data/lib/arjdbc/derby/active_record_patch.rb +0 -13
  62. data/lib/arjdbc/derby/adapter.rb +0 -521
  63. data/lib/arjdbc/derby/connection_methods.rb +0 -20
  64. data/lib/arjdbc/derby/schema_creation.rb +0 -15
  65. data/lib/arjdbc/derby.rb +0 -3
  66. data/lib/arjdbc/firebird/adapter.rb +0 -413
  67. data/lib/arjdbc/firebird/connection_methods.rb +0 -23
  68. data/lib/arjdbc/firebird.rb +0 -4
  69. data/lib/arjdbc/informix/adapter.rb +0 -139
  70. data/lib/arjdbc/informix/connection_methods.rb +0 -9
  71. data/lib/arjdbc/sybase/adapter.rb +0 -47
  72. data/lib/arjdbc/sybase.rb +0 -2
  73. data/lib/arjdbc/tasks/db2_database_tasks.rb +0 -104
  74. data/lib/arjdbc/tasks/derby_database_tasks.rb +0 -95
  75. data/src/java/arjdbc/derby/DerbyModule.java +0 -178
  76. data/src/java/arjdbc/derby/DerbyRubyJdbcConnection.java +0 -152
  77. data/src/java/arjdbc/firebird/FirebirdRubyJdbcConnection.java +0 -174
  78. data/src/java/arjdbc/informix/InformixRubyJdbcConnection.java +0 -75
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: aaaf1a1ed8cb06e36bf0a6667be9ec1ce05d68a10f416449443c559be91e5fe2
4
- data.tar.gz: 9447c46dfff607cc8a4cd177644229a55d660cecd3debb98ce123a12b4ee9704
3
+ metadata.gz: 61ee665d7dfe0dc2b0a84c5c2014ba1c4427dfb63a52a0992eee1ba8449360c0
4
+ data.tar.gz: fdd181f5107c6af495b97f3d67bc5031fd9b9c0a9e454ea6e0fc06e280a544dd
5
5
  SHA512:
6
- metadata.gz: 49cbdc1c2e924fb00c5a5ff0af6dba814c976eec8c1b1dd08fe0b8e28dd4babee04f354248ccffc73f4f8bd7f09b12360c9fe87befde93b3b89a7859a551d053
7
- data.tar.gz: afc769af1ce09137cbeb9d714fd02791a13a71c0685747eea934ab635413d035baca60e99c9c911f5cd510c93c848fb073e79e77f4f8dcb42520fbf2267430e5
6
+ metadata.gz: 16c1ca8af769eec8eaab04650e6293f0b0e8cfdc20ae77bb5c2d37c276f5104ed3e42da35a1397215f4d8925bd192e87a18c163cdbdb03578573baa181d7550b
7
+ data.tar.gz: e200993abec93188a25038d74a3641d83e16cd11d87b10fba1051d51e2e61622dca977edad111c965215e731f51d013bec95bdf42ef73f6c98067a118acf9117
@@ -0,0 +1,118 @@
1
+ # This workflow uses actions that are not certified by GitHub.
2
+ # They are provided by a third-party and are governed by
3
+ # separate terms of service, privacy policy, and support
4
+ # documentation.
5
+ # This workflow will download a prebuilt Ruby version, install dependencies and run tests with Rake
6
+ # For more information see: https://github.com/marketplace/actions/setup-ruby-jruby-and-truffleruby
7
+
8
+ name: Tests
9
+
10
+ on:
11
+ push:
12
+ branches: [ stable-dev ]
13
+ pull_request:
14
+ branches: [ stable-dev ]
15
+
16
+ # Allows you to run this workflow manually from the Actions tab
17
+ workflow_dispatch:
18
+
19
+ permissions:
20
+ contents: read
21
+
22
+ jobs:
23
+ test-rails-pgsql:
24
+
25
+ name: Rails Tests (Postgres)
26
+ runs-on: ubuntu-latest
27
+ strategy:
28
+ fail-fast: false
29
+ matrix:
30
+ ruby-version: [ 'jruby-head' ]
31
+ db: [ 'postgresql' ]
32
+ test_targets: [ "rails:test_postgresql" ]
33
+ ar_version: ["7-0-stable"]
34
+ prepared_statements: [ 'false', 'true' ]
35
+
36
+ services:
37
+ postgres:
38
+ image: postgres:10
39
+ env:
40
+ POSTGRES_PASSWORD: postgres
41
+ POSTGRES_HOST_AUTH_METHOD: trust
42
+ ports:
43
+ - 5432:5432
44
+ options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
45
+
46
+ env:
47
+ DB: ${{ matrix.db }}
48
+ AR_VERSION: ${{ matrix.ar_version }}
49
+ JRUBY_OPTS: "-J-Xms64M -J-Xmx1024M"
50
+ PREPARED_STATEMENTS: ${{ matrix.prepared_statements }}
51
+ JDBC_SQLITE_VERSION: "3.32.3.3"
52
+ PGHOST: localhost
53
+ PGPORT: 5432
54
+ PGUSER: postgres
55
+
56
+ steps:
57
+ - uses: actions/checkout@v3
58
+ - name: Set up Ruby
59
+ uses: ruby/setup-ruby@v1
60
+ with:
61
+ ruby-version: ${{ matrix.ruby-version }}
62
+ bundler-cache: true # runs 'bundle install' and caches installed gems automatically
63
+ - name: Setup database
64
+ run: |
65
+ psql -c "create database activerecord_unittest;" -U postgres
66
+ psql -c "create database activerecord_unittest2;" -U postgres
67
+ - name: Build
68
+ run: |
69
+ rake jar # compiles ext generates: lib/arjdbc/jdbc/adapter_java.jar
70
+ - name: Run tests
71
+ run: |
72
+ bundle exec rake ${{ matrix.test_targets }}
73
+
74
+ test-arjdbc-pgsql:
75
+
76
+ name: ARJDBC Tests (Postgres)
77
+ runs-on: ubuntu-latest
78
+ strategy:
79
+ fail-fast: false
80
+ matrix:
81
+ ruby-version: ['jruby-head']
82
+ db: ['postgresql']
83
+ test_targets: ["db:postgresql test_postgresql"]
84
+ prepared_statements: ['false', 'true']
85
+ insert_returning: ['false', 'true']
86
+
87
+ services:
88
+ postgres:
89
+ image: postgres:10
90
+ env:
91
+ POSTGRES_PASSWORD: postgres
92
+ POSTGRES_HOST_AUTH_METHOD: trust
93
+ ports:
94
+ - 5432:5432
95
+ options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
96
+
97
+ env:
98
+ DB: ${{ matrix.db }}
99
+ JRUBY_OPTS: "-J-Xms64M -J-Xmx1024M"
100
+ PREPARED_STATEMENTS: ${{ matrix.prepared_statements }}
101
+ INSERT_RETURNING: ${{ matrix.insert_returning }}
102
+ PGHOST: localhost
103
+ PGPORT: 5432
104
+ PGUSER: postgres
105
+
106
+ steps:
107
+ - uses: actions/checkout@v3
108
+ - name: Set up Ruby
109
+ uses: ruby/setup-ruby@v1
110
+ with:
111
+ ruby-version: ${{ matrix.ruby-version }}
112
+ bundler-cache: true # runs 'bundle install' and caches installed gems automatically
113
+ - name: Build
114
+ run: |
115
+ rake jar
116
+ - name: Run tests
117
+ run: |
118
+ bundle exec rake ${{ matrix.test_targets }}
@@ -0,0 +1,273 @@
1
+ # This workflow uses actions that are not certified by GitHub.
2
+ # They are provided by a third-party and are governed by
3
+ # separate terms of service, privacy policy, and support
4
+ # documentation.
5
+ # This workflow will download a prebuilt Ruby version, install dependencies and run tests with Rake
6
+ # For more information see: https://github.com/marketplace/actions/setup-ruby-jruby-and-truffleruby
7
+
8
+ name: Ruby
9
+
10
+ on:
11
+ push:
12
+ branches: [ master ]
13
+ pull_request:
14
+ branches: [ master ]
15
+
16
+ permissions:
17
+ contents: read
18
+
19
+ jobs:
20
+ test-rails-mysql:
21
+
22
+ name: Rails Tests (MySQL)
23
+ runs-on: ubuntu-latest
24
+ strategy:
25
+ fail-fast: false
26
+ matrix:
27
+ ruby-version: ['jruby-head']
28
+ db: ['mysql2']
29
+ test_targets: ["rails:test_mysql2"]
30
+ ar_version: ["7-0-stable"]
31
+ prepared_statements: ['false', 'true']
32
+ driver: ['MySQL']
33
+
34
+ services:
35
+ mysql:
36
+ image: mysql:5.7
37
+ ports:
38
+ - 3306
39
+
40
+ env:
41
+ DB: ${{ matrix.db }}
42
+ AR_VERSION: ${{ matrix.ar_version }}
43
+ PREPARED_STATEMENTS: ${{ matrix.prepared_statements }}
44
+ DRIVER: ${{ matrix.driver }}
45
+ JRUBY_OPTS: "-J-Xms64M -J-Xmx1024M"
46
+
47
+ steps:
48
+ - uses: actions/checkout@v3
49
+ - name: Set up Ruby
50
+ uses: ruby/setup-ruby@v1
51
+ with:
52
+ ruby-version: ${{ matrix.ruby-version }}
53
+ bundler-cache: true # runs 'bundle install' and caches installed gems automatically
54
+ - name: Setup database
55
+ run: |
56
+ sudo service mysql start
57
+ mysql --version || true # to see if we're using MySQL or MariaDB
58
+ mysql -u root -proot -e "CREATE USER rails@localhost;"
59
+ mysql -u root -proot -e "grant all privileges on activerecord_unittest.* to rails@localhost;"
60
+ mysql -u root -proot -e "grant all privileges on activerecord_unittest2.* to rails@localhost;"
61
+ mysql -u root -proot -e "grant all privileges on inexistent_activerecord_unittest.* to rails@localhost;"
62
+ mysql -u root -proot -e "CREATE DATABASE activerecord_unittest DEFAULT CHARACTER SET utf8mb4;"
63
+ mysql -u root -proot -e "CREATE DATABASE activerecord_unittest2 DEFAULT CHARACTER SET utf8mb4;"
64
+ - name: Build
65
+ run: |
66
+ echo "JAVA_OPTS=$JAVA_OPTS"
67
+ rake jar # compiles ext generates: lib/arjdbc/jdbc/adapter_java.jar
68
+ - name: Run tests
69
+ run: |
70
+ bundle exec rake ${{ matrix.test_targets }}
71
+
72
+ test-rails-pgsql:
73
+
74
+ name: Rails Tests (Postgres)
75
+ runs-on: ubuntu-latest
76
+ strategy:
77
+ fail-fast: false
78
+ matrix:
79
+ ruby-version: [ 'jruby-head' ]
80
+ db: [ 'postgresql' ]
81
+ test_targets: [ "rails:test_postgresql" ]
82
+ ar_version: ["7-0-stable"]
83
+ prepared_statements: [ 'false', 'true' ]
84
+
85
+ services:
86
+ postgres:
87
+ image: postgres:10
88
+ env:
89
+ POSTGRES_PASSWORD: postgres
90
+ POSTGRES_HOST_AUTH_METHOD: trust
91
+ ports:
92
+ - 5432:5432
93
+ options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
94
+
95
+ env:
96
+ DB: ${{ matrix.db }}
97
+ AR_VERSION: ${{ matrix.ar_version }}
98
+ JRUBY_OPTS: "-J-Xms64M -J-Xmx1024M"
99
+ PREPARED_STATEMENTS: ${{ matrix.prepared_statements }}
100
+ PGHOST: localhost
101
+ PGPORT: 5432
102
+ PGUSER: postgres
103
+
104
+ steps:
105
+ - uses: actions/checkout@v3
106
+ - name: Set up Ruby
107
+ uses: ruby/setup-ruby@v1
108
+ with:
109
+ ruby-version: ${{ matrix.ruby-version }}
110
+ bundler-cache: true # runs 'bundle install' and caches installed gems automatically
111
+ - name: Setup database
112
+ run: |
113
+ psql -c "create database activerecord_unittest;" -U postgres
114
+ psql -c "create database activerecord_unittest2;" -U postgres
115
+ - name: Build
116
+ run: |
117
+ rake jar # compiles ext generates: lib/arjdbc/jdbc/adapter_java.jar
118
+ - name: Run tests
119
+ run: |
120
+ bundle exec rake ${{ matrix.test_targets }}
121
+
122
+ test-rails-sqlite:
123
+
124
+ name: Rails Tests (SQLite)
125
+ runs-on: ubuntu-latest
126
+ strategy:
127
+ fail-fast: false
128
+ matrix:
129
+ ruby-version: ['jruby-head']
130
+ db: ['sqlite3']
131
+ test_targets: ["rails:test_sqlite3"]
132
+ ar_version: ["7-0-stable"]
133
+
134
+ env:
135
+ DB: ${{ matrix.db }}
136
+ AR_VERSION: ${{ matrix.ar_version }}
137
+ JRUBY_OPTS: "-J-Xms64M -J-Xmx1024M"
138
+
139
+ steps:
140
+ - uses: actions/checkout@v3
141
+ - name: Set up Ruby
142
+ uses: ruby/setup-ruby@v1
143
+ with:
144
+ ruby-version: ${{ matrix.ruby-version }}
145
+ bundler-cache: true # runs 'bundle install' and caches installed gems automatically
146
+ - name: Build
147
+ run: |
148
+ echo "JAVA_OPTS=$JAVA_OPTS"
149
+ rake jar # compiles ext generates: lib/arjdbc/jdbc/adapter_java.jar
150
+ - name: Run tests
151
+ run: |
152
+ bundle exec rake ${{ matrix.test_targets }}
153
+
154
+ test-arjdbc-mysql:
155
+
156
+ name: ARJDBC Tests (MySQL)
157
+ runs-on: ubuntu-latest
158
+ strategy:
159
+ fail-fast: false
160
+ matrix:
161
+ ruby-version: ['jruby-head']
162
+ db: ['mysql2']
163
+ test_targets: ["db:mysql test_mysql2"]
164
+ prepared_statements: ['false', 'true']
165
+ driver: ['MySQL']
166
+
167
+ services:
168
+ mysql:
169
+ image: mysql:5.7
170
+ ports:
171
+ - 3306
172
+
173
+ env:
174
+ DB: ${{ matrix.db }}
175
+ DRIVER: ${{ matrix.driver }}
176
+ JRUBY_OPTS: "-J-Xms64M -J-Xmx1024M"
177
+ MY_USER: root
178
+ MY_PASSWORD: root
179
+ PREPARED_STATEMENTS: ${{ matrix.prepared_statements }}
180
+
181
+ steps:
182
+ - uses: actions/checkout@v3
183
+ - name: Set up Ruby
184
+ uses: ruby/setup-ruby@v1
185
+ with:
186
+ ruby-version: ${{ matrix.ruby-version }}
187
+ bundler-cache: true # runs 'bundle install' and caches installed gems automatically
188
+ - name: Setup database
189
+ run: |
190
+ sudo service mysql start
191
+ mysql --version || true # to see if we're using MySQL or MariaDB
192
+ - name: Build
193
+ run: |
194
+ rake jar
195
+ - name: Run tests
196
+ run: |
197
+ bundle exec rake ${{ matrix.test_targets }}
198
+
199
+ test-arjdbc-pgsql:
200
+
201
+ name: ARJDBC Tests (Postgres)
202
+ runs-on: ubuntu-latest
203
+ strategy:
204
+ fail-fast: false
205
+ matrix:
206
+ ruby-version: ['jruby-head']
207
+ db: ['postgresql']
208
+ test_targets: ["db:postgresql test_postgresql"]
209
+ prepared_statements: ['false', 'true']
210
+ insert_returning: ['false', 'true']
211
+
212
+ services:
213
+ postgres:
214
+ image: postgres:10
215
+ env:
216
+ POSTGRES_PASSWORD: postgres
217
+ POSTGRES_HOST_AUTH_METHOD: trust
218
+ ports:
219
+ - 5432:5432
220
+ options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
221
+
222
+ env:
223
+ DB: ${{ matrix.db }}
224
+ DRIVER: ${{ matrix.driver }}
225
+ JRUBY_OPTS: "-J-Xms64M -J-Xmx1024M"
226
+ PREPARED_STATEMENTS: ${{ matrix.prepared_statements }}
227
+ INSERT_RETURNING: ${{ matrix.insert_returning }}
228
+ PGHOST: localhost
229
+ PGPORT: 5432
230
+ PGUSER: postgres
231
+
232
+ steps:
233
+ - uses: actions/checkout@v3
234
+ - name: Set up Ruby
235
+ uses: ruby/setup-ruby@v1
236
+ with:
237
+ ruby-version: ${{ matrix.ruby-version }}
238
+ bundler-cache: true # runs 'bundle install' and caches installed gems automatically
239
+ - name: Build
240
+ run: |
241
+ rake jar
242
+ - name: Run tests
243
+ run: |
244
+ bundle exec rake ${{ matrix.test_targets }}
245
+
246
+ test-arjdbc-sqlite:
247
+
248
+ name: ARJDBC Tests (SQLite)
249
+ runs-on: ubuntu-latest
250
+ strategy:
251
+ fail-fast: false
252
+ matrix:
253
+ ruby-version: ['jruby-head']
254
+ db: ['sqlite3']
255
+ test_targets: ['test_sqlite3']
256
+
257
+ env:
258
+ DB: ${{ matrix.db }}
259
+ JRUBY_OPTS: "-J-Xms64M -J-Xmx1024M"
260
+
261
+ steps:
262
+ - uses: actions/checkout@v3
263
+ - name: Set up Ruby
264
+ uses: ruby/setup-ruby@v1
265
+ with:
266
+ ruby-version: ${{ matrix.ruby-version }}
267
+ bundler-cache: true # runs 'bundle install' and caches installed gems automatically
268
+ - name: Build
269
+ run: |
270
+ rake jar
271
+ - name: Run tests
272
+ run: |
273
+ bundle exec rake ${{ matrix.test_targets }}
data/.gitignore CHANGED
@@ -36,3 +36,4 @@ lib/arjdbc/jdbc/adapter_java.jar
36
36
  tags
37
37
  pik.sh
38
38
  .ruby-version
39
+ .rubocop.yml
data/.travis.yml CHANGED
@@ -9,14 +9,13 @@ before_install:
9
9
  - rvm @default,@global do gem uninstall bundler -a -x -I || true
10
10
  - gem install bundler -v "~>1.17.3"
11
11
  install:
12
- - bundle config set --local without 'development'
13
- - bundle install
12
+ - bundle install --retry 3 --without development
14
13
  # to fix this issue: https://travis-ci.community/t/mariadb-10-1-fails-to-install-on-xenial/3151/3
15
14
  - mysql -u root -e 'CREATE USER IF NOT EXISTS travis@localhost; GRANT ALL ON *.* TO travis@localhost;' || true
16
15
 
17
16
  language: ruby
18
17
  rvm:
19
- - jruby-9.2.19.0
18
+ - jruby-9.2.14.0
20
19
  jdk:
21
20
  - openjdk8
22
21
 
@@ -49,7 +48,7 @@ before_script:
49
48
 
50
49
  env:
51
50
  global:
52
- - AR_VERSION="6-1-stable"
51
+ - AR_VERSION="master"
53
52
  matrix:
54
53
  allow_failures:
55
54
  - rvm: jruby-head
data/Gemfile CHANGED
@@ -44,25 +44,25 @@ elsif ENV['AR_VERSION'] # Use specific version of AR and not .gemspec version
44
44
  end
45
45
  end
46
46
  else
47
- gemspec name: 'activerecord-jdbc-adapter' # Use versiom from .gemspec
47
+ gemspec name: 'activerecord-jdbc-alt-adapter' # Use versiom from .gemspec
48
48
  end
49
49
 
50
- gem 'rake', '>= 11.1', require: nil
50
+ gem 'rake', require: nil
51
51
 
52
52
  group :test do
53
- gem 'test-unit', '~> 2.5.4', require: nil
54
- gem 'test-unit-context', '>= 0.4.0', require: nil
53
+ gem 'test-unit', require: nil
54
+ gem 'test-unit-context', require: nil
55
55
  gem 'mocha', '~> 1.2', require: false # Rails has '~> 0.14'
56
56
 
57
57
  gem 'bcrypt', '~> 3.1.11', require: false
58
- gem 'jdbc-mssql', '~> 0.9.0', require: nil
58
+ gem 'jdbc-mssql', '~> 12.2', require: nil
59
59
  # gem 'pry-debugger-jruby', platform: :jruby
60
60
  end
61
61
 
62
62
  group :rails do
63
63
  group :test do
64
- gem 'minitest', '~> 5.12.2', require: nil
65
- gem 'minitest-excludes', '~> 2.0.1', require: nil
64
+ gem 'minitest', require: nil
65
+ gem 'minitest-excludes', require: nil
66
66
  gem 'minitest-rg', require: nil
67
67
 
68
68
  gem 'benchmark-ips', require: nil
@@ -74,6 +74,8 @@ group :rails do
74
74
  gem 'erubis', require: nil # "~> 2.7.0"
75
75
  # NOTE: due rails/activerecord/test/cases/connection_management_test.rb
76
76
  gem 'rack', require: nil
77
+
78
+ gem 'zeitwerk'
77
79
  end
78
80
 
79
81
  group :development do
data/README.md CHANGED
@@ -15,6 +15,7 @@ stable of this adapter and Rails
15
15
  | 52.6.0 | 5.2.4 | 9.1.x |
16
16
  | 60.1.0 | 6.0.3 | 9.2.9 |
17
17
  | 61.0.0 | 6.1.3 | 9.2.16 |
18
+ | 70.0.0 | 7.0.4 | 9.4.1.0 |
18
19
 
19
20
  This adapter passes most of the Rails tests (ActiveRecord tests) with the
20
21
  exception of some test that are not compatible with the SQL Server. To run
@@ -29,13 +30,16 @@ Add the following to your `Gemfile`:
29
30
  ```ruby
30
31
  platforms :jruby do
31
32
  # Use jdbc as the database for Active Record
32
- gem 'activerecord-jdbc-alt-adapter', '~> 61.0.0'
33
+ gem 'activerecord-jdbc-alt-adapter', '~> 70.0.0.rc1'
33
34
  gem 'jdbc-mssql', '~> 0.9.0'
34
35
  end
35
36
  ```
36
37
 
37
38
  Or look at the sample rails and see how is set up:
38
39
 
40
+
41
+ - Rails 7.0 sample app [wombat70](https://github.com/JesseChavez/wombat70)
42
+
39
43
  - Rails 6.1 sample app [wombat61](https://github.com/JesseChavez/wombat61)
40
44
 
41
45
  - Rails 6.0 sample app [wombat60](https://github.com/JesseChavez/wombat60)
data/Rakefile CHANGED
@@ -26,7 +26,7 @@
26
26
 
27
27
  require 'rake/clean'
28
28
 
29
- CLEAN.include 'derby*', 'test.db.*', '*test.sqlite3', 'test/reports'
29
+ CLEAN.include 'test.db.*', '*test.sqlite3', 'test/reports'
30
30
  CLEAN.include 'lib/**/*.jar', 'MANIFEST.MF', '*.log', 'target/*'
31
31
 
32
32
  task :default => :jar # RubyGems extention will do a bare `rake' e.g. :
@@ -41,12 +41,12 @@ Gem::Specification.new do |gem|
41
41
  gem.executables = gem.files.grep(%r{^bin/}).map { |f| File.basename(f) }
42
42
  gem.test_files = gem.files.grep(%r{^test/})
43
43
 
44
- gem.add_dependency 'activerecord', '~> 6.1.0'
44
+ gem.add_dependency 'activerecord', '~> 7.0'
45
45
 
46
46
  #gem.add_development_dependency 'test-unit', '2.5.4'
47
47
  #gem.add_development_dependency 'test-unit-context', '>= 0.3.0'
48
48
  #gem.add_development_dependency 'mocha', '~> 0.13.1'
49
49
 
50
- gem.rdoc_options = ["--main", "README.md", "-SHN", "-f", "darkfish"]
50
+ gem.rdoc_options = ["--main", "README.md"]
51
51
  end
52
52
 
@@ -43,12 +43,12 @@ Gem::Specification.new do |gem|
43
43
  gem.executables = gem.files.grep(%r{^bin/}).map { |f| File.basename(f) }
44
44
  gem.test_files = gem.files.grep(%r{^test/})
45
45
 
46
- gem.add_dependency 'activerecord', '~> 6.1.0'
46
+ gem.add_dependency 'activerecord', '~> 7.0.0'
47
47
 
48
48
  #gem.add_development_dependency 'test-unit', '2.5.4'
49
49
  #gem.add_development_dependency 'test-unit-context', '>= 0.3.0'
50
50
  #gem.add_development_dependency 'mocha', '~> 0.13.1'
51
51
 
52
- gem.rdoc_options = ["--main", "README.md", "-HN", "-f", "darkfish"]
52
+ gem.rdoc_options = ["--main", "README.md"]
53
53
  end
54
54
 
@@ -4,44 +4,16 @@ module Arel
4
4
 
5
5
  protected
6
6
 
7
- if ToSql.instance_method('visit').arity == 1
8
- def do_visit(x, a); visit(x); end # a = nil
9
- else # > AREL 4.0
10
- def do_visit(x, a); visit(x, a); end
11
- end
7
+ def do_visit(x, a); visit(x, a); end
12
8
 
13
- if ToSql.instance_method('visit_Arel_Nodes_SelectCore').arity == 1
14
- def do_visit_select_core(x, a) # a = nil
15
- visit_Arel_Nodes_SelectCore(x)
16
- end
17
- else # > AREL 4.0
18
- def do_visit_select_core(x, a)
19
- visit_Arel_Nodes_SelectCore(x, a)
20
- end
9
+ def do_visit_select_core(x, a)
10
+ visit_Arel_Nodes_SelectCore(x, a)
21
11
  end
22
12
 
23
13
  private
24
14
 
25
- if ArJdbc::AR42
26
- if Arel::VERSION < '6.0.2'
27
- def limit_for(limit_or_node)
28
- if limit_or_node.respond_to?(:expr)
29
- expr = limit_or_node.expr
30
- # NOTE(uwe): Different behavior for Arel 6.0.0 and 6.0.2
31
- expr.respond_to?(:value) ? expr.value.to_i : expr.to_i
32
- else
33
- limit_or_node
34
- end
35
- end
36
- else
37
- def limit_for(limit_or_node)
38
- limit_or_node.respond_to?(:expr) ? limit_or_node.expr.to_i : limit_or_node
39
- end
40
- end
41
- else
42
- def limit_for(limit_or_node)
43
- limit_or_node.respond_to?(:expr) ? limit_or_node.expr.to_i : limit_or_node
44
- end
15
+ def limit_for(limit_or_node)
16
+ limit_or_node.respond_to?(:expr) ? limit_or_node.expr.to_i : limit_or_node
45
17
  end
46
18
  module_function :limit_for
47
19
 
@@ -7,19 +7,7 @@ module Arel
7
7
  def visit_Arel_Nodes_SelectStatement(o, *)
8
8
  o.limit ||= Arel::Nodes::Limit.new(-1) if o.offset
9
9
  super
10
- end if ArJdbc::AR42
11
-
12
- def limit_offset sql, o
13
- offset = o.offset || 0
14
- offset = offset.expr unless (offset.nil? || offset == 0)
15
- if limit = o.limit
16
- "SELECT LIMIT #{offset} #{limit_for(limit)} #{sql[7..-1]}"
17
- elsif offset > 0
18
- "SELECT LIMIT #{offset} -1 #{sql[7..-1]}" # removes "SELECT "
19
- else
20
- sql
21
- end
22
- end unless ArJdbc::AR42
10
+ end
23
11
  end
24
12
  end
25
13
  end
@@ -6,27 +6,7 @@ module Arel
6
6
  def visit_Arel_Nodes_SelectStatement(o, *)
7
7
  o.limit ||= Arel::Nodes::Limit.new(0) if o.offset
8
8
  super
9
- end if ArJdbc::AR42
10
-
11
- def visit_Arel_Nodes_SelectStatement o, a = nil
12
- sql = limit_offset(o.cores.map { |x| do_visit_select_core x, a }.join, o)
13
- sql << " ORDER BY #{o.orders.map { |x| do_visit x, a }.join(', ')}" unless o.orders.empty?
14
- sql
15
- end unless ArJdbc::AR42
16
-
17
- private
18
-
19
- def limit_offset sql, o
20
- offset = o.offset || 0
21
- offset = offset.expr unless (offset.nil? || offset == 0)
22
- if limit = o.limit
23
- "SELECT LIMIT #{offset} #{limit_for(limit)} #{sql[7..-1]}"
24
- elsif offset > 0
25
- "SELECT LIMIT #{offset} 0 #{sql[7..-1]}" # removes "SELECT "
26
- else
27
- sql
28
- end
29
- end unless ArJdbc::AR42
9
+ end
30
10
  end
31
11
  end
32
12
  end