google-cloud-spanner 2.30.0 → 2.31.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: '0048ff04c4a29b66a58595d58a68c5be48f765d5aa8e0f6fd5c27b0ca7b1c088'
4
- data.tar.gz: 195570ee1bc8eb9b7c33d525df148aaa1a230693ae237b82f30d7e573866c3df
3
+ metadata.gz: 747996c4ee90317631f8648dbc5abefec1ef5dec80ab4e867475dfc465671cf6
4
+ data.tar.gz: 7316c929b5c69c3595e35780fe13ced837091de64de0da2ad13e41c2ccab065e
5
5
  SHA512:
6
- metadata.gz: 37b100e79176dfc4fa89f80832ae04f81b7f8d027704bed6e0dcf217708fcbf7be3a2632961f55eda21fd0a4de7804eb2bd6b47172fa9901039d71d9018db99d
7
- data.tar.gz: 5b308e03caf25c9b91ebb4c6433cb29a9eb4e3fe2c3fedbb81f624dc88a02858564ef2e1202ec4aca01021825db99a2fcf756ef978d6d18d23012428b568fa6b
6
+ metadata.gz: c5f2caed803fc1883c743c34b45a54383259d20749628d01af88cd94d6ac2b89195af9597d763a199b597066a1bee5999fa3b2c3e34b89b59d78c5e86a7cdee1
7
+ data.tar.gz: 8d40b705e2b0fa7b93f2aa334b8b034ad8cb320833d32d6c0bf7a1073966d6cc9d9b40192a86bd1d3fcacce64c020a60f7b4b4fa6b2b9ffdefbc6f308428b711
data/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Release History
2
2
 
3
+ ### 2.31.0 (2025-12-02)
4
+
5
+ #### Features
6
+
7
+ * Support isolation level in Transaction Options ([#206](https://github.com/googleapis/ruby-spanner/issues/206))
8
+
3
9
  ### 2.30.0 (2025-11-17)
4
10
 
5
11
  #### Features
@@ -1067,6 +1067,8 @@ module Google
1067
1067
  # @param [Boolean] exclude_txn_from_change_streams If set to true,
1068
1068
  # mutations will not be recorded in change streams with DDL option
1069
1069
  # `allow_txn_exclusion=true`.
1070
+ # @param [Google::Cloud::Spanner::V1::TransactionOptions::IsolationLevel] isolation_level Optional. The
1071
+ # isolation level for the transaction.
1070
1072
  # @param [Hash] commit_options A hash of commit options.
1071
1073
  # e.g., return_commit_stats. Commit options are optional.
1072
1074
  # The following options can be provided:
@@ -1158,13 +1160,15 @@ module Google
1158
1160
  #
1159
1161
  def upsert table, rows,
1160
1162
  exclude_txn_from_change_streams: false,
1161
- commit_options: nil, request_options: nil, call_options: nil
1163
+ isolation_level: nil, commit_options: nil, request_options: nil,
1164
+ call_options: nil
1162
1165
  request_options = Convert.to_request_options \
1163
1166
  request_options, tag_type: :transaction_tag
1164
1167
 
1165
1168
  @pool.with_session do |session|
1166
1169
  session.upsert table, rows,
1167
1170
  exclude_txn_from_change_streams: exclude_txn_from_change_streams,
1171
+ isolation_level: isolation_level,
1168
1172
  commit_options: commit_options,
1169
1173
  request_options: request_options,
1170
1174
  call_options: call_options
@@ -1214,6 +1218,8 @@ module Google
1214
1218
  # @param [Boolean] exclude_txn_from_change_streams If set to true,
1215
1219
  # mutations will not be recorded in change streams with DDL option
1216
1220
  # `allow_txn_exclusion=true`.
1221
+ # @param [Google::Cloud::Spanner::V1::TransactionOptions::IsolationLevel] isolation_level Optional. The
1222
+ # isolation level for the transaction.
1217
1223
  # @param [Hash] commit_options A hash of commit options.
1218
1224
  # e.g., return_commit_stats. Commit options are optional.
1219
1225
  # The following options can be provided:
@@ -1305,13 +1311,15 @@ module Google
1305
1311
  #
1306
1312
  def insert table, rows,
1307
1313
  exclude_txn_from_change_streams: false,
1308
- commit_options: nil, request_options: nil, call_options: nil
1314
+ isolation_level: nil, commit_options: nil, request_options: nil,
1315
+ call_options: nil
1309
1316
  request_options = Convert.to_request_options \
1310
1317
  request_options, tag_type: :transaction_tag
1311
1318
 
1312
1319
  @pool.with_session do |session|
1313
1320
  session.insert table, rows,
1314
1321
  exclude_txn_from_change_streams: exclude_txn_from_change_streams,
1322
+ isolation_level: isolation_level,
1315
1323
  commit_options: commit_options,
1316
1324
  request_options: request_options,
1317
1325
  call_options: call_options
@@ -1360,6 +1368,8 @@ module Google
1360
1368
  # @param [Boolean] exclude_txn_from_change_streams If set to true,
1361
1369
  # mutations will not be recorded in change streams with DDL option
1362
1370
  # `allow_txn_exclusion=true`.
1371
+ # @param [Google::Cloud::Spanner::V1::TransactionOptions::IsolationLevel] isolation_level Optional. The
1372
+ # isolation level for the transaction.
1363
1373
  # @param [Hash] commit_options A hash of commit options.
1364
1374
  # e.g., return_commit_stats. Commit options are optional.
1365
1375
  # The following options can be provided:
@@ -1450,13 +1460,15 @@ module Google
1450
1460
  #
1451
1461
  def update table, rows,
1452
1462
  exclude_txn_from_change_streams: false,
1453
- commit_options: nil, request_options: nil, call_options: nil
1463
+ isolation_level: nil, commit_options: nil, request_options: nil,
1464
+ call_options: nil
1454
1465
  request_options = Convert.to_request_options \
1455
1466
  request_options, tag_type: :transaction_tag
1456
1467
 
1457
1468
  @pool.with_session do |session|
1458
1469
  session.update table, rows,
1459
1470
  exclude_txn_from_change_streams: exclude_txn_from_change_streams,
1471
+ isolation_level: isolation_level,
1460
1472
  commit_options: commit_options,
1461
1473
  request_options: request_options,
1462
1474
  call_options: call_options
@@ -1507,6 +1519,8 @@ module Google
1507
1519
  # @param [Boolean] exclude_txn_from_change_streams If set to true,
1508
1520
  # mutations will not be recorded in change streams with DDL option
1509
1521
  # `allow_txn_exclusion=true`.
1522
+ # @param [Google::Cloud::Spanner::V1::TransactionOptions::IsolationLevel] isolation_level Optional. The
1523
+ # isolation level for the transaction.
1510
1524
  # @param [Hash] commit_options A hash of commit options.
1511
1525
  # e.g., return_commit_stats. Commit options are optional.
1512
1526
  # The following options can be provided:
@@ -1597,10 +1611,12 @@ module Google
1597
1611
  #
1598
1612
  def replace table, rows,
1599
1613
  exclude_txn_from_change_streams: false,
1600
- commit_options: nil, request_options: nil, call_options: nil
1614
+ isolation_level: nil, commit_options: nil, request_options: nil,
1615
+ call_options: nil
1601
1616
  @pool.with_session do |session|
1602
1617
  session.replace table, rows,
1603
1618
  exclude_txn_from_change_streams: exclude_txn_from_change_streams,
1619
+ isolation_level: isolation_level,
1604
1620
  commit_options: commit_options,
1605
1621
  request_options: request_options,
1606
1622
  call_options: call_options
@@ -1630,6 +1646,8 @@ module Google
1630
1646
  # @param [Boolean] exclude_txn_from_change_streams If set to true,
1631
1647
  # mutations will not be recorded in change streams with DDL option
1632
1648
  # `allow_txn_exclusion=true`.
1649
+ # @param [Google::Cloud::Spanner::V1::TransactionOptions::IsolationLevel] isolation_level Optional. The
1650
+ # isolation level for the transaction.
1633
1651
  # @param [Hash] commit_options A hash of commit options.
1634
1652
  # e.g., return_commit_stats. Commit options are optional.
1635
1653
  # The following options can be provided:
@@ -1713,13 +1731,15 @@ module Google
1713
1731
  #
1714
1732
  def delete table, keys = [],
1715
1733
  exclude_txn_from_change_streams: false,
1716
- commit_options: nil, request_options: nil, call_options: nil
1734
+ isolation_level: nil, commit_options: nil, request_options: nil,
1735
+ call_options: nil
1717
1736
  request_options = Convert.to_request_options \
1718
1737
  request_options, tag_type: :transaction_tag
1719
1738
 
1720
1739
  @pool.with_session do |session|
1721
1740
  session.delete table, keys,
1722
1741
  exclude_txn_from_change_streams: exclude_txn_from_change_streams,
1742
+ isolation_level: isolation_level,
1723
1743
  commit_options: commit_options,
1724
1744
  request_options: request_options,
1725
1745
  call_options: call_options
@@ -1744,6 +1764,8 @@ module Google
1744
1764
  # @param [Boolean] exclude_txn_from_change_streams If set to true,
1745
1765
  # mutations will not be recorded in change streams with DDL option
1746
1766
  # `allow_txn_exclusion=true`.
1767
+ # @param [Google::Cloud::Spanner::V1::TransactionOptions::IsolationLevel] isolation_level Optional. The
1768
+ # isolation level for the transaction.
1747
1769
  # @param [Hash] commit_options A hash of commit options.
1748
1770
  # e.g., return_commit_stats. Commit options are optional.
1749
1771
  # The following options can be provided:
@@ -1840,8 +1862,8 @@ module Google
1840
1862
  # end
1841
1863
  #
1842
1864
  def commit exclude_txn_from_change_streams: false,
1843
- commit_options: nil, request_options: nil, call_options: nil,
1844
- &block
1865
+ isolation_level: nil, commit_options: nil, request_options: nil,
1866
+ call_options: nil, &block
1845
1867
  raise ArgumentError, "Must provide a block" unless block_given?
1846
1868
 
1847
1869
  request_options = Convert.to_request_options \
@@ -1850,8 +1872,11 @@ module Google
1850
1872
  @pool.with_session do |session|
1851
1873
  session.commit(
1852
1874
  exclude_txn_from_change_streams: exclude_txn_from_change_streams,
1853
- commit_options: commit_options, request_options: request_options,
1854
- call_options: call_options, &block
1875
+ isolation_level: isolation_level,
1876
+ commit_options: commit_options,
1877
+ request_options: request_options,
1878
+ call_options: call_options,
1879
+ &block
1855
1880
  )
1856
1881
  end
1857
1882
  end
@@ -524,6 +524,8 @@ module Google
524
524
  # @param exclude_txn_from_change_streams [::Boolean] Optional. Defaults to `false`.
525
525
  # When `exclude_txn_from_change_streams` is set to `true`, it prevents read
526
526
  # or write transactions from being tracked in change streams.
527
+ # @param isolation_level [::Google::Cloud::Spanner::V1::TransactionOptions::IsolationLevel] Optional.
528
+ # The isolation level for the transaction.
527
529
  # @param commit_options [::Hash, nil] Optional. A hash of commit options.
528
530
  # Example option: `:return_commit_stats`.
529
531
  # @param request_options [::Hash, nil] Optional. Common request options.
@@ -537,14 +539,15 @@ module Google
537
539
  # @return [::Google::Cloud::Spanner::V1::CommitResponse]
538
540
  def commit session_name, mutations = [],
539
541
  transaction_id: nil, exclude_txn_from_change_streams: false,
540
- commit_options: nil, request_options: nil, call_options: nil,
541
- precommit_token: nil
542
+ isolation_level: nil, commit_options: nil, request_options: nil,
543
+ call_options: nil, precommit_token: nil
542
544
  route_to_leader = LARHeaders.commit
543
545
  tx_opts = nil
544
546
  if transaction_id.nil?
545
547
  tx_opts = V1::TransactionOptions.new(
546
548
  read_write: V1::TransactionOptions::ReadWrite.new,
547
- exclude_txn_from_change_streams: exclude_txn_from_change_streams
549
+ exclude_txn_from_change_streams: exclude_txn_from_change_streams,
550
+ isolation_level: isolation_level
548
551
  )
549
552
  end
550
553
  opts = default_options session_name: session_name,
@@ -603,6 +603,8 @@ module Google
603
603
  # @param [Boolean] exclude_txn_from_change_streams If set to true,
604
604
  # mutations will not be recorded in change streams with DDL option
605
605
  # `allow_txn_exclusion=true`. Used if starting a new transaction.
606
+ # @param [Google::Cloud::Spanner::V1::TransactionOptions::IsolationLevel] isolation_level Optional. The
607
+ # isolation level for the transaction.
606
608
  # @param [Hash] commit_options A hash of commit options.
607
609
  # e.g., return_commit_stats. Commit options are optional.
608
610
  # The following options can be provided:
@@ -681,7 +683,8 @@ module Google
681
683
  # puts commit_resp.stats.mutation_count
682
684
  #
683
685
  def commit transaction_id: nil, exclude_txn_from_change_streams: false,
684
- commit_options: nil, request_options: nil, call_options: nil
686
+ isolation_level: nil, commit_options: nil, request_options: nil,
687
+ call_options: nil
685
688
  ensure_service!
686
689
  commit = Commit.new
687
690
  yield commit
@@ -694,6 +697,7 @@ module Google
694
697
  commit.mutations,
695
698
  transaction_id: transaction_id,
696
699
  exclude_txn_from_change_streams: exclude_txn_from_change_streams,
700
+ isolation_level: isolation_level,
697
701
  commit_options: commit_options,
698
702
  request_options: request_options,
699
703
  call_options: call_options,
@@ -840,6 +844,8 @@ module Google
840
844
  # @param [Boolean] exclude_txn_from_change_streams If set to true,
841
845
  # mutations will not be recorded in change streams with DDL option
842
846
  # `allow_txn_exclusion=true`. Used if starting a new transaction.
847
+ # @param [Google::Cloud::Spanner::V1::TransactionOptions::IsolationLevel] isolation_level Optional. The
848
+ # isolation level for the transaction.
843
849
  # @param [Hash] commit_options A hash of commit options.
844
850
  # e.g., return_commit_stats. Commit options are optional.
845
851
  # The following options can be provided:
@@ -912,10 +918,12 @@ module Google
912
918
  #
913
919
  def upsert table, *rows,
914
920
  transaction_id: nil, exclude_txn_from_change_streams: false,
915
- commit_options: nil, request_options: nil, call_options: nil
921
+ isolation_level: nil, commit_options: nil, request_options: nil,
922
+ call_options: nil
916
923
  opts = {
917
924
  transaction_id: transaction_id,
918
925
  exclude_txn_from_change_streams: exclude_txn_from_change_streams,
926
+ isolation_level: isolation_level,
919
927
  commit_options: commit_options,
920
928
  request_options: request_options,
921
929
  call_options: call_options
@@ -960,6 +968,8 @@ module Google
960
968
  # @param [Boolean] exclude_txn_from_change_streams If set to true,
961
969
  # mutations will not be recorded in change streams with DDL option
962
970
  # `allow_txn_exclusion=true`. Used if starting a new transaction.
971
+ # @param [Google::Cloud::Spanner::V1::TransactionOptions::IsolationLevel] isolation_level Optional. The
972
+ # isolation level for the transaction.
963
973
  # @param [Hash] commit_options A hash of commit options.
964
974
  # e.g., return_commit_stats. Commit options are optional.
965
975
  # The following options can be provided:
@@ -1032,10 +1042,12 @@ module Google
1032
1042
  #
1033
1043
  def insert table, *rows,
1034
1044
  transaction_id: nil, exclude_txn_from_change_streams: false,
1035
- commit_options: nil, request_options: nil, call_options: nil
1045
+ isolation_level: nil, commit_options: nil, request_options: nil,
1046
+ call_options: nil
1036
1047
  opts = {
1037
1048
  transaction_id: transaction_id,
1038
1049
  exclude_txn_from_change_streams: exclude_txn_from_change_streams,
1050
+ isolation_level: isolation_level,
1039
1051
  commit_options: commit_options,
1040
1052
  request_options: request_options,
1041
1053
  call_options: call_options
@@ -1079,6 +1091,8 @@ module Google
1079
1091
  # @param [Boolean] exclude_txn_from_change_streams If set to true,
1080
1092
  # mutations will not be recorded in change streams with DDL option
1081
1093
  # `allow_txn_exclusion=true`. Used if starting a new transaction.
1094
+ # @param [Google::Cloud::Spanner::V1::TransactionOptions::IsolationLevel] isolation_level Optional. The
1095
+ # isolation level for the transaction.
1082
1096
  # @param [Hash] commit_options A hash of commit options.
1083
1097
  # e.g., return_commit_stats. Commit options are optional.
1084
1098
  # The following options can be provided:
@@ -1151,10 +1165,12 @@ module Google
1151
1165
  #
1152
1166
  def update table, *rows,
1153
1167
  transaction_id: nil, exclude_txn_from_change_streams: false,
1154
- commit_options: nil, request_options: nil, call_options: nil
1168
+ isolation_level: nil, commit_options: nil, request_options: nil,
1169
+ call_options: nil
1155
1170
  opts = {
1156
1171
  transaction_id: transaction_id,
1157
1172
  exclude_txn_from_change_streams: exclude_txn_from_change_streams,
1173
+ isolation_level: isolation_level,
1158
1174
  commit_options: commit_options,
1159
1175
  request_options: request_options,
1160
1176
  call_options: call_options
@@ -1200,6 +1216,8 @@ module Google
1200
1216
  # @param [Boolean] exclude_txn_from_change_streams If set to true,
1201
1217
  # mutations will not be recorded in change streams with DDL option
1202
1218
  # `allow_txn_exclusion=true`. Used if starting a new transaction.
1219
+ # @param [Google::Cloud::Spanner::V1::TransactionOptions::IsolationLevel] isolation_level Optional. The
1220
+ # isolation level for the transaction.
1203
1221
  # @param [Hash] commit_options A hash of commit options.
1204
1222
  # e.g., return_commit_stats. Commit options are optional.
1205
1223
  # The following options can be provided:
@@ -1273,10 +1291,11 @@ module Google
1273
1291
  #
1274
1292
  def replace table, *rows,
1275
1293
  transaction_id: nil, exclude_txn_from_change_streams: false,
1276
- commit_options: nil, request_options: nil, call_options: nil
1294
+ isolation_level: nil, commit_options: nil, request_options: nil, call_options: nil
1277
1295
  opts = {
1278
1296
  transaction_id: transaction_id,
1279
1297
  exclude_txn_from_change_streams: exclude_txn_from_change_streams,
1298
+ isolation_level: isolation_level,
1280
1299
  commit_options: commit_options,
1281
1300
  request_options: request_options,
1282
1301
  call_options: call_options
@@ -1301,6 +1320,8 @@ module Google
1301
1320
  # @param [Boolean] exclude_txn_from_change_streams If set to true,
1302
1321
  # mutations will not be recorded in change streams with DDL option
1303
1322
  # `allow_txn_exclusion=true`. Used if starting a new transaction.
1323
+ # @param [Google::Cloud::Spanner::V1::TransactionOptions::IsolationLevel] isolation_level Optional. The
1324
+ # isolation level for the transaction.
1304
1325
  # @param [Hash] commit_options A hash of commit options.
1305
1326
  # e.g., return_commit_stats. Commit options are optional.
1306
1327
  # The following options can be provided:
@@ -1370,10 +1391,12 @@ module Google
1370
1391
  #
1371
1392
  def delete table, keys = [],
1372
1393
  transaction_id: nil, exclude_txn_from_change_streams: false,
1373
- commit_options: nil, request_options: nil, call_options: nil
1394
+ isolation_level: nil, commit_options: nil, request_options: nil,
1395
+ call_options: nil
1374
1396
  opts = {
1375
1397
  transaction_id: transaction_id,
1376
1398
  exclude_txn_from_change_streams: exclude_txn_from_change_streams,
1399
+ isolation_level: isolation_level,
1377
1400
  commit_options: commit_options,
1378
1401
  request_options: request_options,
1379
1402
  call_options: call_options
@@ -16,7 +16,7 @@
16
16
  module Google
17
17
  module Cloud
18
18
  module Spanner
19
- VERSION = "2.30.0".freeze
19
+ VERSION = "2.31.0".freeze
20
20
  end
21
21
  end
22
22
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: google-cloud-spanner
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.30.0
4
+ version: 2.31.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mike Moore