activerecord-spanner-adapter 1.4.3 → 1.4.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/nightly-acceptance-tests-on-emulator.yaml +5 -1
- data/.github/workflows/nightly-acceptance-tests-on-production.yaml +1 -1
- data/.release-please-manifest.json +1 -1
- data/CHANGELOG.md +6 -0
- data/acceptance/cases/migration/rename_column_test.rb +17 -15
- data/acceptance/test_helpers/with_separate_database.rb +1 -0
- data/lib/active_record/connection_adapters/spanner/quoting.rb +5 -2
- data/lib/activerecord_spanner_adapter/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f1a935693a8621d55fd7f51a17ba93dcc598f97789e6b7825ca7c916fbc0c9e1
|
4
|
+
data.tar.gz: 671717a9df5b2d7b6bbf388faea2c9ec6f982906a6456271a8696c2980d62684
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5fa701ba551c2072ad60e6a7aadde8a4c4e20e3262d091c4854fd37d3663cfa353595017a8de229404c37dc7145ef5852c4ac16f531655c54462e419b217d86b
|
7
|
+
data.tar.gz: 24733bae08d92cd3ad8c7ae4cbbdbf016dc845f3f8b1a962bdde535b8df2627c9dc8a62d4d41cad3ec58a295c22de9ccb01924f95c985d1bf6741d647a0fcf4d
|
@@ -20,7 +20,7 @@ jobs:
|
|
20
20
|
matrix:
|
21
21
|
# Run acceptance tests all supported combinations of Ruby and ActiveRecord.
|
22
22
|
ruby: [2.6, 2.7, 3.0, 3.1, 3.2]
|
23
|
-
ar: [6.0.0, 6.0.1, 6.0.2.2, 6.0.3.7, 6.0.4, 6.1.3.2, 6.1.4.7, 6.1.5.1, 6.1.6.1, 7.0.2.4, 7.0.3.1, 7.0.4, 7.0.5]
|
23
|
+
ar: [6.0.0, 6.0.1, 6.0.2.2, 6.0.3.7, 6.0.4, 6.1.3.2, 6.1.4.7, 6.1.5.1, 6.1.6.1, 7.0.2.4, 7.0.3.1, 7.0.4, 7.0.5, 7.0.6, 7.0.7]
|
24
24
|
# Exclude combinations that are not supported.
|
25
25
|
exclude:
|
26
26
|
- ruby: 3.0
|
@@ -61,6 +61,10 @@ jobs:
|
|
61
61
|
ar: 7.0.4
|
62
62
|
- ruby: 2.6
|
63
63
|
ar: 7.0.5
|
64
|
+
- ruby: 2.6
|
65
|
+
ar: 7.0.6
|
66
|
+
- ruby: 2.6
|
67
|
+
ar: 7.0.7
|
64
68
|
env:
|
65
69
|
AR_VERSION: ${{ matrix.ar }}
|
66
70
|
steps:
|
@@ -29,7 +29,7 @@ jobs:
|
|
29
29
|
- name: Install dependencies
|
30
30
|
run: bundle install
|
31
31
|
- name: Run acceptance tests on production
|
32
|
-
run: bundle exec rake acceptance
|
32
|
+
run: bundle exec rake acceptance\[,,,"exclude cases/migration"\]
|
33
33
|
env:
|
34
34
|
SPANNER_TEST_PROJECT: ${{ secrets.GCP_PROJECT_ID }}
|
35
35
|
SPANNER_TEST_INSTANCE: ruby-activerecord-test
|
data/CHANGELOG.md
CHANGED
@@ -23,21 +23,23 @@ module ActiveRecord
|
|
23
23
|
skip_test_table_create!
|
24
24
|
super
|
25
25
|
|
26
|
-
connection.
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
26
|
+
connection.ddl_batch do
|
27
|
+
connection.drop_table :rename_column_comments, if_exists: true
|
28
|
+
connection.drop_table :rename_column_posts, if_exists: true
|
29
|
+
|
30
|
+
connection.create_table(:rename_column_posts) do |t|
|
31
|
+
t.string :name, limit: 128
|
32
|
+
t.integer :comment_count
|
33
|
+
end
|
34
|
+
|
35
|
+
connection.create_table(:rename_column_comments) do |t|
|
36
|
+
t.string :comment
|
37
|
+
# The Spanner ActiveRecord adapter does not support creating an index on a column that also has a foreign key,
|
38
|
+
# as Cloud Spanner automatically creates a managed index for the foreign key. The index is therefore created
|
39
|
+
# separately.
|
40
|
+
t.references :rename_column_post, foreign_key: true
|
41
|
+
t.index :rename_column_post_id
|
42
|
+
end
|
41
43
|
end
|
42
44
|
|
43
45
|
RenameColumnPost.reset_column_information
|
@@ -32,12 +32,15 @@ module ActiveRecord
|
|
32
32
|
module ConnectionAdapters
|
33
33
|
module Spanner
|
34
34
|
module Quoting
|
35
|
+
QUOTED_COLUMN_NAMES = Concurrent::Map.new # :nodoc:
|
36
|
+
QUOTED_TABLE_NAMES = Concurrent::Map.new # :nodoc:
|
37
|
+
|
35
38
|
def quote_column_name name
|
36
|
-
|
39
|
+
QUOTED_COLUMN_NAMES[name] ||= "`#{super.gsub '`', '``'}`".freeze
|
37
40
|
end
|
38
41
|
|
39
42
|
def quote_table_name name
|
40
|
-
|
43
|
+
QUOTED_TABLE_NAMES[name] ||= super.gsub(".", "`.`").freeze
|
41
44
|
end
|
42
45
|
|
43
46
|
STR_ESCAPE_REGX = /[\n\r'\\]/.freeze
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: activerecord-spanner-adapter
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.4.
|
4
|
+
version: 1.4.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Google LLC
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-06
|
11
|
+
date: 2023-09-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: google-cloud-spanner
|
@@ -539,7 +539,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
539
539
|
- !ruby/object:Gem::Version
|
540
540
|
version: '0'
|
541
541
|
requirements: []
|
542
|
-
rubygems_version: 3.4.
|
542
|
+
rubygems_version: 3.4.19
|
543
543
|
signing_key:
|
544
544
|
specification_version: 4
|
545
545
|
summary: Rails ActiveRecord connector for Google Spanner Database
|