activerecord-jdbc-alt-adapter 61.3.0-java → 70.0.0-java
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/main.yml +166 -0
- data/.github/workflows/ruby.yml +273 -0
- data/.gitignore +1 -0
- data/.travis.yml +3 -4
- data/Gemfile +5 -3
- data/README.md +5 -1
- data/Rakefile +1 -1
- data/activerecord-jdbc-adapter.gemspec +2 -2
- data/activerecord-jdbc-alt-adapter.gemspec +2 -2
- data/lib/arel/visitors/compat.rb +5 -33
- data/lib/arel/visitors/h2.rb +1 -13
- data/lib/arel/visitors/hsqldb.rb +1 -21
- data/lib/arel/visitors/sql_server.rb +2 -103
- data/lib/arjdbc/abstract/core.rb +8 -9
- data/lib/arjdbc/abstract/database_statements.rb +12 -4
- data/lib/arjdbc/discover.rb +0 -67
- data/lib/arjdbc/hsqldb/adapter.rb +2 -2
- data/lib/arjdbc/jdbc/adapter.rb +3 -3
- data/lib/arjdbc/jdbc/adapter_java.jar +0 -0
- data/lib/arjdbc/jdbc/adapter_require.rb +3 -1
- data/lib/arjdbc/jdbc/column.rb +1 -26
- data/lib/arjdbc/jdbc/type_cast.rb +2 -2
- data/lib/arjdbc/jdbc.rb +0 -7
- data/lib/arjdbc/mssql/adapter.rb +138 -108
- data/lib/arjdbc/mssql/quoting.rb +26 -27
- data/lib/arjdbc/mssql/schema_creation.rb +1 -1
- data/lib/arjdbc/mssql/schema_definitions.rb +18 -3
- data/lib/arjdbc/mssql/schema_dumper.rb +13 -1
- data/lib/arjdbc/mssql/schema_statements.rb +57 -32
- data/lib/arjdbc/mssql/types/date_and_time_types.rb +6 -6
- data/lib/arjdbc/mssql/types/numeric_types.rb +2 -2
- data/lib/arjdbc/mssql.rb +1 -1
- data/lib/arjdbc/mysql/adapter.rb +2 -1
- data/lib/arjdbc/oracle/adapter.rb +4 -23
- data/lib/arjdbc/postgresql/adapter.rb +153 -4
- data/lib/arjdbc/postgresql/oid_types.rb +155 -108
- data/lib/arjdbc/sqlite3/adapter.rb +152 -99
- data/lib/arjdbc/tasks/database_tasks.rb +0 -12
- data/lib/arjdbc/tasks/mssql_database_tasks.rb +1 -1
- data/lib/arjdbc/util/serialized_attributes.rb +0 -22
- data/lib/arjdbc/util/table_copier.rb +2 -1
- data/lib/arjdbc/version.rb +1 -1
- data/rakelib/02-test.rake +3 -18
- data/src/java/arjdbc/jdbc/RubyJdbcConnection.java +17 -2
- data/src/java/arjdbc/postgresql/PostgreSQLRubyJdbcConnection.java +5 -0
- data/src/java/arjdbc/sqlite3/SQLite3RubyJdbcConnection.java +33 -0
- metadata +8 -39
- data/lib/active_record/connection_adapters/as400_adapter.rb +0 -2
- data/lib/active_record/connection_adapters/db2_adapter.rb +0 -1
- data/lib/active_record/connection_adapters/derby_adapter.rb +0 -1
- data/lib/active_record/connection_adapters/informix_adapter.rb +0 -1
- data/lib/arel/visitors/db2.rb +0 -137
- data/lib/arel/visitors/derby.rb +0 -112
- data/lib/arel/visitors/firebird.rb +0 -79
- data/lib/arjdbc/db2/adapter.rb +0 -808
- data/lib/arjdbc/db2/as400.rb +0 -142
- data/lib/arjdbc/db2/column.rb +0 -131
- data/lib/arjdbc/db2/connection_methods.rb +0 -48
- data/lib/arjdbc/db2.rb +0 -4
- data/lib/arjdbc/derby/active_record_patch.rb +0 -13
- data/lib/arjdbc/derby/adapter.rb +0 -521
- data/lib/arjdbc/derby/connection_methods.rb +0 -20
- data/lib/arjdbc/derby/schema_creation.rb +0 -15
- data/lib/arjdbc/derby.rb +0 -3
- data/lib/arjdbc/firebird/adapter.rb +0 -413
- data/lib/arjdbc/firebird/connection_methods.rb +0 -23
- data/lib/arjdbc/firebird.rb +0 -4
- data/lib/arjdbc/informix/adapter.rb +0 -139
- data/lib/arjdbc/informix/connection_methods.rb +0 -9
- data/lib/arjdbc/sybase/adapter.rb +0 -47
- data/lib/arjdbc/sybase.rb +0 -2
- data/lib/arjdbc/tasks/db2_database_tasks.rb +0 -104
- data/lib/arjdbc/tasks/derby_database_tasks.rb +0 -95
- data/src/java/arjdbc/derby/DerbyModule.java +0 -178
- data/src/java/arjdbc/derby/DerbyRubyJdbcConnection.java +0 -152
- data/src/java/arjdbc/firebird/FirebirdRubyJdbcConnection.java +0 -174
- data/src/java/arjdbc/informix/InformixRubyJdbcConnection.java +0 -75
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 92f8a9759858e84a83dfcba88e6d636e15fde2fd4b3e3f803468285c689046c7
|
4
|
+
data.tar.gz: ed1afe9af104349e17c78c419cb57acf875df4385747c2dbc05fcca1a2d7454e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1758438f64620af7a292ad7474a8eaa0757dba8666a0051e3ab3e917a548d856bb69938d6a2730ee8b91b1cbd70f3df632da3fb50d450c98ae429994cf98ddc1
|
7
|
+
data.tar.gz: 41e2acd357484e61e4388078515f434d0098601764f67465a3d984bb0205b885c08bbff0918140568749a7fa1516d70bfd1cd9b3e8cae29e82999729e90502cf
|
@@ -0,0 +1,166 @@
|
|
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-arjdbc-mssql:
|
24
|
+
|
25
|
+
name: ARJDBC Tests (mssql)
|
26
|
+
runs-on: ubuntu-latest
|
27
|
+
strategy:
|
28
|
+
fail-fast: false
|
29
|
+
matrix:
|
30
|
+
ruby-version: ['jruby-9.4.2.0']
|
31
|
+
db: ['mssql']
|
32
|
+
test_targets: ['test_mssql']
|
33
|
+
|
34
|
+
services:
|
35
|
+
mssql:
|
36
|
+
image: mcr.microsoft.com/mssql/server:2019-latest
|
37
|
+
env:
|
38
|
+
ACCEPT_EULA: Y
|
39
|
+
MSSQL_SA_PASSWORD: Password12!
|
40
|
+
ports:
|
41
|
+
- 1433:1433
|
42
|
+
options: >-
|
43
|
+
--health-cmd="/opt/mssql-tools/bin/sqlcmd -S localhost -U SA -P \"Password12!\" -l 30 -Q \"SELECT 1\""
|
44
|
+
--health-start-period 10s
|
45
|
+
--health-interval 10s
|
46
|
+
--health-timeout 5s
|
47
|
+
--health-retries 10
|
48
|
+
|
49
|
+
env:
|
50
|
+
DB: ${{ matrix.db }}
|
51
|
+
JRUBY_OPTS: "-J-Xms64M -J-Xmx1024M"
|
52
|
+
SQLUSER: SA
|
53
|
+
SQLPASS: Password12!
|
54
|
+
|
55
|
+
steps:
|
56
|
+
- uses: actions/checkout@v3
|
57
|
+
- name: Set up Ruby
|
58
|
+
uses: ruby/setup-ruby@v1
|
59
|
+
with:
|
60
|
+
ruby-version: ${{ matrix.ruby-version }}
|
61
|
+
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
|
62
|
+
- name: Setup database
|
63
|
+
run: /opt/mssql-tools/bin/sqlcmd -S localhost -U SA -P "Password12!" -Q "CREATE DATABASE arjdbc_test;"
|
64
|
+
- name: Build
|
65
|
+
run: |
|
66
|
+
rake jar
|
67
|
+
- name: Run tests
|
68
|
+
run: |
|
69
|
+
bundle exec rake ${{ matrix.test_targets }}
|
70
|
+
|
71
|
+
test-rails-pgsql:
|
72
|
+
|
73
|
+
name: Rails Tests (Postgres)
|
74
|
+
runs-on: ubuntu-latest
|
75
|
+
strategy:
|
76
|
+
fail-fast: false
|
77
|
+
matrix:
|
78
|
+
ruby-version: [ 'jruby-9.4.2.0' ]
|
79
|
+
db: [ 'postgresql' ]
|
80
|
+
test_targets: [ "rails:test_postgresql" ]
|
81
|
+
ar_version: ["7-0-stable"]
|
82
|
+
prepared_statements: [ 'false', 'true' ]
|
83
|
+
|
84
|
+
services:
|
85
|
+
postgres:
|
86
|
+
image: postgres:10
|
87
|
+
env:
|
88
|
+
POSTGRES_PASSWORD: postgres
|
89
|
+
POSTGRES_HOST_AUTH_METHOD: trust
|
90
|
+
ports:
|
91
|
+
- 5432:5432
|
92
|
+
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
|
93
|
+
|
94
|
+
env:
|
95
|
+
DB: ${{ matrix.db }}
|
96
|
+
AR_VERSION: ${{ matrix.ar_version }}
|
97
|
+
JRUBY_OPTS: "-J-Xms64M -J-Xmx1024M"
|
98
|
+
PREPARED_STATEMENTS: ${{ matrix.prepared_statements }}
|
99
|
+
JDBC_SQLITE_VERSION: "3.32.3.3"
|
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-arjdbc-pgsql:
|
123
|
+
|
124
|
+
name: ARJDBC Tests (Postgres)
|
125
|
+
runs-on: ubuntu-latest
|
126
|
+
strategy:
|
127
|
+
fail-fast: false
|
128
|
+
matrix:
|
129
|
+
ruby-version: ['jruby-9.4.2.0']
|
130
|
+
db: ['postgresql']
|
131
|
+
test_targets: ["db:postgresql test_postgresql"]
|
132
|
+
prepared_statements: ['false', 'true']
|
133
|
+
insert_returning: ['false', 'true']
|
134
|
+
|
135
|
+
services:
|
136
|
+
postgres:
|
137
|
+
image: postgres:10
|
138
|
+
env:
|
139
|
+
POSTGRES_PASSWORD: postgres
|
140
|
+
POSTGRES_HOST_AUTH_METHOD: trust
|
141
|
+
ports:
|
142
|
+
- 5432:5432
|
143
|
+
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
|
144
|
+
|
145
|
+
env:
|
146
|
+
DB: ${{ matrix.db }}
|
147
|
+
JRUBY_OPTS: "-J-Xms64M -J-Xmx1024M"
|
148
|
+
PREPARED_STATEMENTS: ${{ matrix.prepared_statements }}
|
149
|
+
INSERT_RETURNING: ${{ matrix.insert_returning }}
|
150
|
+
PGHOST: localhost
|
151
|
+
PGPORT: 5432
|
152
|
+
PGUSER: postgres
|
153
|
+
|
154
|
+
steps:
|
155
|
+
- uses: actions/checkout@v3
|
156
|
+
- name: Set up Ruby
|
157
|
+
uses: ruby/setup-ruby@v1
|
158
|
+
with:
|
159
|
+
ruby-version: ${{ matrix.ruby-version }}
|
160
|
+
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
|
161
|
+
- name: Build
|
162
|
+
run: |
|
163
|
+
rake jar
|
164
|
+
- name: Run tests
|
165
|
+
run: |
|
166
|
+
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
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
|
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.
|
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="
|
51
|
+
- AR_VERSION="master"
|
53
52
|
matrix:
|
54
53
|
allow_failures:
|
55
54
|
- rvm: jruby-head
|
data/Gemfile
CHANGED
@@ -44,10 +44,10 @@ 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',
|
50
|
+
gem 'rake', require: nil
|
51
51
|
|
52
52
|
group :test do
|
53
53
|
gem 'test-unit', require: nil
|
@@ -55,7 +55,7 @@ group :test do
|
|
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', '~> 12.2
|
58
|
+
gem 'jdbc-mssql', '~> 12.2', require: nil
|
59
59
|
# gem 'pry-debugger-jruby', platform: :jruby
|
60
60
|
end
|
61
61
|
|
@@ -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', '~>
|
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 '
|
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', '~>
|
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"
|
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', '~>
|
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"
|
52
|
+
gem.rdoc_options = ["--main", "README.md"]
|
53
53
|
end
|
54
54
|
|
data/lib/arel/visitors/compat.rb
CHANGED
@@ -4,44 +4,16 @@ module Arel
|
|
4
4
|
|
5
5
|
protected
|
6
6
|
|
7
|
-
|
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
|
-
|
14
|
-
|
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
|
-
|
26
|
-
|
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
|
|
data/lib/arel/visitors/h2.rb
CHANGED
@@ -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
|
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
|
data/lib/arel/visitors/hsqldb.rb
CHANGED
@@ -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
|
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
|