activerecord-spanner-adapter 1.5.1 → 1.6.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/acceptance-tests-on-emulator.yaml +1 -1
- data/.github/workflows/acceptance-tests-on-production.yaml +5 -3
- data/.github/workflows/ci.yaml +1 -1
- data/.github/workflows/nightly-acceptance-tests-on-emulator.yaml +1 -1
- data/.github/workflows/nightly-acceptance-tests-on-production.yaml +5 -3
- data/.github/workflows/nightly-unit-tests.yaml +1 -1
- data/.github/workflows/release-please-label.yml +1 -1
- data/.github/workflows/rubocop.yaml +1 -1
- data/.release-please-manifest.json +1 -1
- data/.rubocop.yml +1 -1
- data/CHANGELOG.md +14 -0
- data/Gemfile +7 -2
- data/README.md +10 -10
- data/acceptance/cases/interleaved_associations/has_many_associations_using_interleaved_test.rb +6 -0
- data/acceptance/cases/migration/change_schema_test.rb +19 -3
- data/acceptance/cases/migration/schema_dumper_test.rb +10 -1
- data/acceptance/cases/models/interleave_test.rb +6 -0
- data/acceptance/cases/tasks/database_tasks_test.rb +340 -2
- data/acceptance/cases/transactions/optimistic_locking_test.rb +6 -0
- data/acceptance/cases/transactions/read_write_transactions_test.rb +24 -0
- data/acceptance/models/table_with_sequence.rb +10 -0
- data/acceptance/schema/schema.rb +65 -19
- data/acceptance/test_helper.rb +1 -1
- data/activerecord-spanner-adapter.gemspec +1 -1
- data/benchmarks/application.rb +1 -1
- data/examples/snippets/bit-reversed-sequence/README.md +103 -0
- data/examples/snippets/bit-reversed-sequence/Rakefile +13 -0
- data/examples/snippets/bit-reversed-sequence/application.rb +68 -0
- data/examples/snippets/bit-reversed-sequence/config/database.yml +8 -0
- data/examples/snippets/bit-reversed-sequence/db/migrate/01_create_tables.rb +33 -0
- data/examples/snippets/bit-reversed-sequence/db/schema.rb +31 -0
- data/examples/snippets/bit-reversed-sequence/db/seeds.rb +31 -0
- data/examples/snippets/bit-reversed-sequence/models/album.rb +11 -0
- data/examples/snippets/bit-reversed-sequence/models/singer.rb +15 -0
- data/examples/snippets/interleaved-tables/README.md +44 -53
- data/examples/snippets/interleaved-tables/Rakefile +2 -2
- data/examples/snippets/interleaved-tables/application.rb +2 -2
- data/examples/snippets/interleaved-tables/db/migrate/01_create_tables.rb +12 -18
- data/examples/snippets/interleaved-tables/db/schema.rb +9 -7
- data/examples/snippets/interleaved-tables/db/seeds.rb +1 -1
- data/examples/snippets/interleaved-tables/models/album.rb +3 -7
- data/examples/snippets/interleaved-tables/models/singer.rb +1 -1
- data/examples/snippets/interleaved-tables/models/track.rb +6 -7
- data/examples/snippets/interleaved-tables-before-7.1/README.md +167 -0
- data/examples/snippets/interleaved-tables-before-7.1/Rakefile +13 -0
- data/examples/snippets/interleaved-tables-before-7.1/application.rb +126 -0
- data/examples/snippets/interleaved-tables-before-7.1/config/database.yml +8 -0
- data/examples/snippets/interleaved-tables-before-7.1/db/migrate/01_create_tables.rb +44 -0
- data/examples/snippets/interleaved-tables-before-7.1/db/schema.rb +37 -0
- data/examples/snippets/interleaved-tables-before-7.1/db/seeds.rb +40 -0
- data/examples/snippets/interleaved-tables-before-7.1/models/album.rb +20 -0
- data/examples/snippets/interleaved-tables-before-7.1/models/singer.rb +18 -0
- data/examples/snippets/interleaved-tables-before-7.1/models/track.rb +28 -0
- data/examples/snippets/query-logs/README.md +43 -0
- data/examples/snippets/query-logs/Rakefile +13 -0
- data/examples/snippets/query-logs/application.rb +63 -0
- data/examples/snippets/query-logs/config/database.yml +8 -0
- data/examples/snippets/query-logs/db/migrate/01_create_tables.rb +21 -0
- data/examples/snippets/query-logs/db/schema.rb +31 -0
- data/examples/snippets/query-logs/db/seeds.rb +24 -0
- data/examples/snippets/query-logs/models/album.rb +9 -0
- data/examples/snippets/query-logs/models/singer.rb +9 -0
- data/examples/snippets/read-only-transactions/application.rb +1 -1
- data/lib/active_record/connection_adapters/spanner/column.rb +13 -0
- data/lib/active_record/connection_adapters/spanner/database_statements.rb +144 -35
- data/lib/active_record/connection_adapters/spanner/schema_cache.rb +3 -21
- data/lib/active_record/connection_adapters/spanner/schema_creation.rb +11 -2
- data/lib/active_record/connection_adapters/spanner/schema_definitions.rb +4 -0
- data/lib/active_record/connection_adapters/spanner/schema_statements.rb +12 -2
- data/lib/active_record/connection_adapters/spanner_adapter.rb +28 -9
- data/lib/activerecord_spanner_adapter/base.rb +64 -20
- data/lib/activerecord_spanner_adapter/foreign_key.rb +6 -2
- data/lib/activerecord_spanner_adapter/index/column.rb +3 -1
- data/lib/activerecord_spanner_adapter/index.rb +4 -2
- data/lib/activerecord_spanner_adapter/information_schema.rb +124 -72
- data/lib/activerecord_spanner_adapter/primary_key.rb +1 -1
- data/lib/activerecord_spanner_adapter/table/column.rb +7 -10
- data/lib/activerecord_spanner_adapter/version.rb +1 -1
- data/lib/arel/visitors/spanner.rb +3 -1
- data/lib/spanner_client_ext.rb +6 -1
- metadata +34 -5
@@ -139,7 +139,9 @@ module Arel # :nodoc: all
|
|
139
139
|
# Do not generate a query parameter if the value should be set to the PENDING_COMMIT_TIMESTAMP(), as that is
|
140
140
|
# not supported as a parameter value by Cloud Spanner.
|
141
141
|
return collector << "PENDING_COMMIT_TIMESTAMP()" \
|
142
|
-
|
142
|
+
if o.value.respond_to?(:type) \
|
143
|
+
&& o.value.type.is_a?(ActiveRecord::Type::Spanner::Time) \
|
144
|
+
&& o.value.value == :commit_timestamp
|
143
145
|
collector.add_bind(o.value, &bind_block)
|
144
146
|
end
|
145
147
|
# rubocop:enable Naming/MethodName
|
data/lib/spanner_client_ext.rb
CHANGED
@@ -68,7 +68,12 @@ module Google
|
|
68
68
|
snp_grpc = service.create_snapshot \
|
69
69
|
path, timestamp: (timestamp || read_timestamp),
|
70
70
|
staleness: (staleness || exact_staleness)
|
71
|
-
Snapshot.from_grpc
|
71
|
+
num_args = Snapshot.method(:from_grpc).arity
|
72
|
+
if num_args == 3
|
73
|
+
Snapshot.from_grpc snp_grpc, self, nil
|
74
|
+
else
|
75
|
+
Snapshot.from_grpc snp_grpc, self
|
76
|
+
end
|
72
77
|
end
|
73
78
|
|
74
79
|
def create_pdml
|
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
|
+
version: 1.6.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Google LLC
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-02-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: google-cloud-spanner
|
@@ -33,7 +33,7 @@ dependencies:
|
|
33
33
|
version: 6.0.0
|
34
34
|
- - "<"
|
35
35
|
- !ruby/object:Gem::Version
|
36
|
-
version: '7.
|
36
|
+
version: '7.2'
|
37
37
|
type: :runtime
|
38
38
|
prerelease: false
|
39
39
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -43,7 +43,7 @@ dependencies:
|
|
43
43
|
version: 6.0.0
|
44
44
|
- - "<"
|
45
45
|
- !ruby/object:Gem::Version
|
46
|
-
version: '7.
|
46
|
+
version: '7.2'
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: autotest-suffix
|
49
49
|
requirement: !ruby/object:Gem::Requirement
|
@@ -312,6 +312,7 @@ files:
|
|
312
312
|
- acceptance/models/organization.rb
|
313
313
|
- acceptance/models/post.rb
|
314
314
|
- acceptance/models/singer.rb
|
315
|
+
- acceptance/models/table_with_sequence.rb
|
315
316
|
- acceptance/models/track.rb
|
316
317
|
- acceptance/models/transaction.rb
|
317
318
|
- acceptance/schema/schema.rb
|
@@ -342,6 +343,15 @@ files:
|
|
342
343
|
- examples/snippets/array-data-type/db/seeds.rb
|
343
344
|
- examples/snippets/array-data-type/models/entity_with_array_types.rb
|
344
345
|
- examples/snippets/bin/create_emulator_instance.rb
|
346
|
+
- examples/snippets/bit-reversed-sequence/README.md
|
347
|
+
- examples/snippets/bit-reversed-sequence/Rakefile
|
348
|
+
- examples/snippets/bit-reversed-sequence/application.rb
|
349
|
+
- examples/snippets/bit-reversed-sequence/config/database.yml
|
350
|
+
- examples/snippets/bit-reversed-sequence/db/migrate/01_create_tables.rb
|
351
|
+
- examples/snippets/bit-reversed-sequence/db/schema.rb
|
352
|
+
- examples/snippets/bit-reversed-sequence/db/seeds.rb
|
353
|
+
- examples/snippets/bit-reversed-sequence/models/album.rb
|
354
|
+
- examples/snippets/bit-reversed-sequence/models/singer.rb
|
345
355
|
- examples/snippets/bulk-insert/README.md
|
346
356
|
- examples/snippets/bulk-insert/Rakefile
|
347
357
|
- examples/snippets/bulk-insert/application.rb
|
@@ -395,6 +405,16 @@ files:
|
|
395
405
|
- examples/snippets/hints/db/seeds.rb
|
396
406
|
- examples/snippets/hints/models/album.rb
|
397
407
|
- examples/snippets/hints/models/singer.rb
|
408
|
+
- examples/snippets/interleaved-tables-before-7.1/README.md
|
409
|
+
- examples/snippets/interleaved-tables-before-7.1/Rakefile
|
410
|
+
- examples/snippets/interleaved-tables-before-7.1/application.rb
|
411
|
+
- examples/snippets/interleaved-tables-before-7.1/config/database.yml
|
412
|
+
- examples/snippets/interleaved-tables-before-7.1/db/migrate/01_create_tables.rb
|
413
|
+
- examples/snippets/interleaved-tables-before-7.1/db/schema.rb
|
414
|
+
- examples/snippets/interleaved-tables-before-7.1/db/seeds.rb
|
415
|
+
- examples/snippets/interleaved-tables-before-7.1/models/album.rb
|
416
|
+
- examples/snippets/interleaved-tables-before-7.1/models/singer.rb
|
417
|
+
- examples/snippets/interleaved-tables-before-7.1/models/track.rb
|
398
418
|
- examples/snippets/interleaved-tables/README.md
|
399
419
|
- examples/snippets/interleaved-tables/Rakefile
|
400
420
|
- examples/snippets/interleaved-tables/application.rb
|
@@ -442,6 +462,15 @@ files:
|
|
442
462
|
- examples/snippets/partitioned-dml/db/seeds.rb
|
443
463
|
- examples/snippets/partitioned-dml/models/album.rb
|
444
464
|
- examples/snippets/partitioned-dml/models/singer.rb
|
465
|
+
- examples/snippets/query-logs/README.md
|
466
|
+
- examples/snippets/query-logs/Rakefile
|
467
|
+
- examples/snippets/query-logs/application.rb
|
468
|
+
- examples/snippets/query-logs/config/database.yml
|
469
|
+
- examples/snippets/query-logs/db/migrate/01_create_tables.rb
|
470
|
+
- examples/snippets/query-logs/db/schema.rb
|
471
|
+
- examples/snippets/query-logs/db/seeds.rb
|
472
|
+
- examples/snippets/query-logs/models/album.rb
|
473
|
+
- examples/snippets/query-logs/models/singer.rb
|
445
474
|
- examples/snippets/quickstart/README.md
|
446
475
|
- examples/snippets/quickstart/Rakefile
|
447
476
|
- examples/snippets/quickstart/application.rb
|
@@ -548,7 +577,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
548
577
|
- !ruby/object:Gem::Version
|
549
578
|
version: '0'
|
550
579
|
requirements: []
|
551
|
-
rubygems_version: 3.
|
580
|
+
rubygems_version: 3.5.3
|
552
581
|
signing_key:
|
553
582
|
specification_version: 4
|
554
583
|
summary: Rails ActiveRecord connector for Google Spanner Database
|