activerecord-jdbc-adapter 80.0.pre1-java → 81.0.pre1-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.
- checksums.yaml +4 -4
- data/.github/workflows/ruby.yml +3 -3
- data/README.md +3 -2
- data/RUNNING_TESTS.md +9 -1
- data/Rakefile +1 -1
- data/activerecord-jdbc-adapter.gemspec +1 -1
- data/lib/arjdbc/abstract/database_statements.rb +11 -0
- data/lib/arjdbc/jdbc/adapter_java.jar +0 -0
- data/lib/arjdbc/postgresql/schema_statements.rb +17 -0
- data/lib/arjdbc/sqlite3/adapter.rb +13 -4
- data/lib/arjdbc/sqlite3/column.rb +1 -1
- data/lib/arjdbc/version.rb +1 -1
- 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: ffdbea8302a2c3049c57ade1e0fdd453ccb55f2d71648d08c7cda8c73db6ad4d
|
|
4
|
+
data.tar.gz: a9748358df5fb32f141d3bcee61ed3b578f1f7bcc55c57ca19f10c66934f25f7
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: fe6be99838a8b20e72d93822179ee2d38c188ccfac4f38e036cc7f2ee72c2c14b800aa077d9df6c4f8280b4994237fb4350f4dc8c1c2fe5d6b72ff9ba2a95d03
|
|
7
|
+
data.tar.gz: d13f9c3807685214330867d70855129f7491b9d62897b8c37b8dda609b4957e318ddb1eedf888a90af238c438133091e1b4823fcd0766aa84a5b029670e84dcb
|
data/.github/workflows/ruby.yml
CHANGED
|
@@ -23,7 +23,7 @@ jobs:
|
|
|
23
23
|
ruby-version: ['jruby-head']
|
|
24
24
|
db: ['mysql2']
|
|
25
25
|
test_targets: ["rails:test_mysql2"]
|
|
26
|
-
ar_version: ["8-
|
|
26
|
+
ar_version: ["8-1-stable"]
|
|
27
27
|
prepared_statements: ['false', 'true']
|
|
28
28
|
driver: ['MySQL']
|
|
29
29
|
|
|
@@ -83,7 +83,7 @@ jobs:
|
|
|
83
83
|
ruby-version: [ 'jruby-head' ]
|
|
84
84
|
db: [ 'postgresql' ]
|
|
85
85
|
test_targets: [ "rails:test_postgresql" ]
|
|
86
|
-
ar_version: ["8-
|
|
86
|
+
ar_version: ["8-1-stable"]
|
|
87
87
|
prepared_statements: [ 'false', 'true' ]
|
|
88
88
|
|
|
89
89
|
services:
|
|
@@ -152,7 +152,7 @@ jobs:
|
|
|
152
152
|
ruby-version: ['jruby-head']
|
|
153
153
|
db: ['sqlite3']
|
|
154
154
|
test_targets: ["rails:test_sqlite3"]
|
|
155
|
-
ar_version: ["8-
|
|
155
|
+
ar_version: ["8-1-stable"]
|
|
156
156
|
|
|
157
157
|
env:
|
|
158
158
|
DB: ${{ matrix.db }}
|
data/README.md
CHANGED
|
@@ -28,9 +28,10 @@ Versions are targeted at certain versions of Rails and live on their own branche
|
|
|
28
28
|
| 70.x | 7.0.x | 70-stable | 9.3.0 | 8 |
|
|
29
29
|
| 71.x | 7.1.x | 71-stable | 9.4.3 | 8 |
|
|
30
30
|
| 72.x | 7.2.x | 72-stable | 9.4.3 | 8 |
|
|
31
|
-
| 80.x | 8.0.x |
|
|
31
|
+
| 80.x | 8.0.x | 80-stable | 10.0.0 | 21 |
|
|
32
|
+
| 81.x | 8.1.x | master | 10.0.0 | 21 |
|
|
32
33
|
|
|
33
|
-
Note: 80.x
|
|
34
|
+
Note: 80.x and 81.x are still under development and not supported yet.
|
|
34
35
|
|
|
35
36
|
Note that JRuby 9.1.x and JRuby 9.2.x are at end-of-life. We recommend Java 8
|
|
36
37
|
at a minimum for all versions.
|
data/RUNNING_TESTS.md
CHANGED
|
@@ -83,7 +83,15 @@ CREATE DATABASE activerecord_unittest2;
|
|
|
83
83
|
GRANT ALL PRIVILEGES ON activerecord_unittest2.* TO 'rails'@'localhost';
|
|
84
84
|
```
|
|
85
85
|
|
|
86
|
-
Then edit test/rails/config.yml for the appropriate configuration credentials.
|
|
86
|
+
Then edit test/rails/config.yml for the appropriate configuration credentials. You may need to add a "password: testtest9" entry to authenticate.
|
|
87
|
+
|
|
88
|
+
Additionally, you may need to add the following to the config.yml file to disable SSL and allow public key retrieval:
|
|
89
|
+
|
|
90
|
+
```yaml
|
|
91
|
+
properties:
|
|
92
|
+
useSSL: false
|
|
93
|
+
allowPublicKeyRetrieval: true
|
|
94
|
+
```
|
|
87
95
|
|
|
88
96
|
### ActiveRecord (Rails) Tests
|
|
89
97
|
|
data/Rakefile
CHANGED
|
@@ -284,7 +284,7 @@ if defined? JRUBY_VERSION
|
|
|
284
284
|
if match = requirement.match(/^jar\s+([\w\-\.]+):([\w\-]+),\s+?([\w\.\-]+)?/)
|
|
285
285
|
matched_jar = Jars.send :to_jar, match[1], match[2], match[3], nil
|
|
286
286
|
matched_jar = File.join( Jars.home, matched_jar )
|
|
287
|
-
matched_jars << matched_jar if File.
|
|
287
|
+
matched_jars << matched_jar if File.exist?( matched_jar )
|
|
288
288
|
end
|
|
289
289
|
end
|
|
290
290
|
matched_jars
|
|
@@ -41,7 +41,7 @@ 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", "~> 8.
|
|
44
|
+
gem.add_dependency "activerecord", "~> 8.1"
|
|
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'
|
|
@@ -9,6 +9,17 @@ module ArJdbc
|
|
|
9
9
|
|
|
10
10
|
NO_BINDS = [].freeze
|
|
11
11
|
|
|
12
|
+
def mark_transaction_written_if_write(sql)
|
|
13
|
+
if write_query?(sql)
|
|
14
|
+
ensure_writes_are_allowed(sql)
|
|
15
|
+
mark_transaction_written
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
def check_if_write_query(sql)
|
|
20
|
+
ensure_writes_are_allowed(sql) if write_query?(sql)
|
|
21
|
+
end
|
|
22
|
+
|
|
12
23
|
def exec_insert(sql, name = nil, binds = NO_BINDS, pk = nil, sequence_name = nil, returning: nil)
|
|
13
24
|
if preventing_writes?
|
|
14
25
|
raise ActiveRecord::ReadOnlyError, "Write query attempted while in readonly mode: #{sql}"
|
|
Binary file
|
|
@@ -6,6 +6,23 @@ module ArJdbc
|
|
|
6
6
|
ForeignKeyDefinition = ActiveRecord::ConnectionAdapters::ForeignKeyDefinition
|
|
7
7
|
Utils = ActiveRecord::ConnectionAdapters::PostgreSQL::Utils
|
|
8
8
|
|
|
9
|
+
def decode_string_array(value)
|
|
10
|
+
return value if value.is_a?(Array)
|
|
11
|
+
_arjdbc_array_parser.parse_pg_array(value)
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
private
|
|
15
|
+
|
|
16
|
+
def _arjdbc_array_parser
|
|
17
|
+
@_arjdbc_array_parser ||= begin
|
|
18
|
+
obj = Object.new
|
|
19
|
+
obj.extend(ActiveRecord::ConnectionAdapters::PostgreSQL::ArrayParser)
|
|
20
|
+
obj
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
public
|
|
25
|
+
|
|
9
26
|
def foreign_keys(table_name)
|
|
10
27
|
scope = quoted_scope(table_name)
|
|
11
28
|
fk_info = internal_exec_query(<<~SQL, "SCHEMA", allow_retry: true, materialize_transactions: false)
|
|
@@ -471,12 +471,17 @@ module ArJdbc
|
|
|
471
471
|
|
|
472
472
|
rowid = is_column_the_rowid?(field, definitions)
|
|
473
473
|
|
|
474
|
-
|
|
475
|
-
|
|
474
|
+
column_args = [field["name"]]
|
|
475
|
+
column_args << lookup_cast_type(field["type"])
|
|
476
|
+
column_args.push(
|
|
476
477
|
default_value,
|
|
477
478
|
type_metadata,
|
|
478
479
|
field["notnull"].to_i == 0,
|
|
479
|
-
default_function
|
|
480
|
+
default_function
|
|
481
|
+
)
|
|
482
|
+
|
|
483
|
+
ActiveRecord::ConnectionAdapters::SQLite3Column.new(
|
|
484
|
+
*column_args,
|
|
480
485
|
collation: field["collation"],
|
|
481
486
|
auto_increment: field["auto_increment"],
|
|
482
487
|
rowid: rowid,
|
|
@@ -609,7 +614,7 @@ module ArJdbc
|
|
|
609
614
|
column_options[:stored] = column.virtual_stored?
|
|
610
615
|
column_options[:type] = column.type
|
|
611
616
|
elsif column.has_default?
|
|
612
|
-
type =
|
|
617
|
+
type = column.fetch_cast_type(self)
|
|
613
618
|
default = type.deserialize(column.default)
|
|
614
619
|
default = -> { column.default_function } if default.nil?
|
|
615
620
|
|
|
@@ -870,6 +875,10 @@ module ActiveRecord::ConnectionAdapters
|
|
|
870
875
|
def jdbc_connection_class
|
|
871
876
|
::ActiveRecord::ConnectionAdapters::SQLite3JdbcConnection
|
|
872
877
|
end
|
|
878
|
+
|
|
879
|
+
def native_database_types # :nodoc:
|
|
880
|
+
ArJdbc::SQLite3::NATIVE_DATABASE_TYPES
|
|
881
|
+
end
|
|
873
882
|
end
|
|
874
883
|
|
|
875
884
|
# NOTE: include these modules before all then override some methods with the
|
data/lib/arjdbc/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: activerecord-jdbc-adapter
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version:
|
|
4
|
+
version: 81.0.pre1
|
|
5
5
|
platform: java
|
|
6
6
|
authors:
|
|
7
7
|
- Nick Sieger, Ola Bini, Karol Bucek and JRuby contributors
|
|
@@ -15,14 +15,14 @@ dependencies:
|
|
|
15
15
|
requirements:
|
|
16
16
|
- - "~>"
|
|
17
17
|
- !ruby/object:Gem::Version
|
|
18
|
-
version: 8.
|
|
18
|
+
version: '8.1'
|
|
19
19
|
type: :runtime
|
|
20
20
|
prerelease: false
|
|
21
21
|
version_requirements: !ruby/object:Gem::Requirement
|
|
22
22
|
requirements:
|
|
23
23
|
- - "~>"
|
|
24
24
|
- !ruby/object:Gem::Version
|
|
25
|
-
version: 8.
|
|
25
|
+
version: '8.1'
|
|
26
26
|
description: 'AR-JDBC is a database adapter for Rails'' ActiveRecord component designed
|
|
27
27
|
to be used with JRuby built upon Java''s JDBC API for database access. Provides
|
|
28
28
|
(ActiveRecord) built-in adapters: MySQL, PostgreSQL, and SQLite3.'
|
|
@@ -203,7 +203,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
203
203
|
- !ruby/object:Gem::Version
|
|
204
204
|
version: '0'
|
|
205
205
|
requirements: []
|
|
206
|
-
rubygems_version: 4.0.
|
|
206
|
+
rubygems_version: 4.0.21
|
|
207
207
|
specification_version: 4
|
|
208
208
|
summary: JDBC adapter for ActiveRecord, for use within JRuby on Rails.
|
|
209
209
|
test_files: []
|