google-cloud-spanner 1.14.0 → 2.0.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.
Files changed (102) hide show
  1. checksums.yaml +4 -4
  2. data/AUTHENTICATION.md +1 -1
  3. data/CHANGELOG.md +51 -0
  4. data/CONTRIBUTING.md +5 -5
  5. data/TROUBLESHOOTING.md +0 -6
  6. data/lib/google-cloud-spanner.rb +23 -13
  7. data/lib/google/cloud/spanner.rb +8 -9
  8. data/lib/google/cloud/spanner/admin/database/credentials.rb +2 -2
  9. data/lib/google/cloud/spanner/admin/instance/credentials.rb +2 -2
  10. data/lib/google/cloud/spanner/backup.rb +315 -0
  11. data/lib/google/cloud/spanner/backup/job.rb +274 -0
  12. data/lib/google/cloud/spanner/backup/job/list.rb +177 -0
  13. data/lib/google/cloud/spanner/backup/list.rb +169 -0
  14. data/lib/google/cloud/spanner/backup/restore/job.rb +246 -0
  15. data/lib/google/cloud/spanner/batch_client.rb +7 -5
  16. data/lib/google/cloud/spanner/batch_snapshot.rb +49 -16
  17. data/lib/google/cloud/spanner/batch_update.rb +1 -1
  18. data/lib/google/cloud/spanner/client.rb +65 -16
  19. data/lib/google/cloud/spanner/commit.rb +14 -14
  20. data/lib/google/cloud/spanner/convert.rb +7 -7
  21. data/lib/google/cloud/spanner/credentials.rb +2 -2
  22. data/lib/google/cloud/spanner/data.rb +2 -2
  23. data/lib/google/cloud/spanner/database.rb +275 -15
  24. data/lib/google/cloud/spanner/database/backup_info.rb +105 -0
  25. data/lib/google/cloud/spanner/database/job.rb +5 -2
  26. data/lib/google/cloud/spanner/database/job/list.rb +177 -0
  27. data/lib/google/cloud/spanner/database/list.rb +1 -1
  28. data/lib/google/cloud/spanner/database/restore_info.rb +63 -0
  29. data/lib/google/cloud/spanner/fields.rb +8 -8
  30. data/lib/google/cloud/spanner/instance.rb +401 -8
  31. data/lib/google/cloud/spanner/instance/config.rb +1 -1
  32. data/lib/google/cloud/spanner/instance/config/list.rb +1 -1
  33. data/lib/google/cloud/spanner/instance/job.rb +2 -2
  34. data/lib/google/cloud/spanner/instance/list.rb +1 -1
  35. data/lib/google/cloud/spanner/partition.rb +4 -4
  36. data/lib/google/cloud/spanner/policy.rb +2 -2
  37. data/lib/google/cloud/spanner/project.rb +31 -6
  38. data/lib/google/cloud/spanner/results.rb +4 -2
  39. data/lib/google/cloud/spanner/service.rb +231 -240
  40. data/lib/google/cloud/spanner/session.rb +46 -15
  41. data/lib/google/cloud/spanner/snapshot.rb +28 -5
  42. data/lib/google/cloud/spanner/transaction.rb +51 -7
  43. data/lib/google/cloud/spanner/version.rb +1 -1
  44. metadata +28 -104
  45. data/lib/google/cloud/spanner/admin/database.rb +0 -148
  46. data/lib/google/cloud/spanner/admin/database/v1.rb +0 -146
  47. data/lib/google/cloud/spanner/admin/database/v1/credentials.rb +0 -46
  48. data/lib/google/cloud/spanner/admin/database/v1/database_admin_client.rb +0 -791
  49. data/lib/google/cloud/spanner/admin/database/v1/database_admin_client_config.json +0 -71
  50. data/lib/google/cloud/spanner/admin/database/v1/doc/google/iam/v1/iam_policy.rb +0 -64
  51. data/lib/google/cloud/spanner/admin/database/v1/doc/google/iam/v1/options.rb +0 -33
  52. data/lib/google/cloud/spanner/admin/database/v1/doc/google/iam/v1/policy.rb +0 -151
  53. data/lib/google/cloud/spanner/admin/database/v1/doc/google/longrunning/operations.rb +0 -51
  54. data/lib/google/cloud/spanner/admin/database/v1/doc/google/protobuf/any.rb +0 -131
  55. data/lib/google/cloud/spanner/admin/database/v1/doc/google/protobuf/empty.rb +0 -29
  56. data/lib/google/cloud/spanner/admin/database/v1/doc/google/rpc/status.rb +0 -39
  57. data/lib/google/cloud/spanner/admin/database/v1/doc/google/spanner/admin/database/v1/spanner_database_admin.rb +0 -201
  58. data/lib/google/cloud/spanner/admin/database/v1/doc/google/type/expr.rb +0 -45
  59. data/lib/google/cloud/spanner/admin/instance.rb +0 -164
  60. data/lib/google/cloud/spanner/admin/instance/v1.rb +0 -162
  61. data/lib/google/cloud/spanner/admin/instance/v1/credentials.rb +0 -46
  62. data/lib/google/cloud/spanner/admin/instance/v1/doc/google/iam/v1/iam_policy.rb +0 -64
  63. data/lib/google/cloud/spanner/admin/instance/v1/doc/google/iam/v1/options.rb +0 -33
  64. data/lib/google/cloud/spanner/admin/instance/v1/doc/google/iam/v1/policy.rb +0 -151
  65. data/lib/google/cloud/spanner/admin/instance/v1/doc/google/longrunning/operations.rb +0 -51
  66. data/lib/google/cloud/spanner/admin/instance/v1/doc/google/protobuf/any.rb +0 -131
  67. data/lib/google/cloud/spanner/admin/instance/v1/doc/google/protobuf/empty.rb +0 -29
  68. data/lib/google/cloud/spanner/admin/instance/v1/doc/google/protobuf/field_mask.rb +0 -222
  69. data/lib/google/cloud/spanner/admin/instance/v1/doc/google/rpc/status.rb +0 -39
  70. data/lib/google/cloud/spanner/admin/instance/v1/doc/google/spanner/admin/instance/v1/spanner_instance_admin.rb +0 -341
  71. data/lib/google/cloud/spanner/admin/instance/v1/doc/google/type/expr.rb +0 -45
  72. data/lib/google/cloud/spanner/admin/instance/v1/instance_admin_client.rb +0 -972
  73. data/lib/google/cloud/spanner/admin/instance/v1/instance_admin_client_config.json +0 -76
  74. data/lib/google/cloud/spanner/v1.rb +0 -16
  75. data/lib/google/cloud/spanner/v1/credentials.rb +0 -42
  76. data/lib/google/cloud/spanner/v1/doc/google/protobuf/any.rb +0 -131
  77. data/lib/google/cloud/spanner/v1/doc/google/protobuf/duration.rb +0 -91
  78. data/lib/google/cloud/spanner/v1/doc/google/protobuf/empty.rb +0 -29
  79. data/lib/google/cloud/spanner/v1/doc/google/protobuf/struct.rb +0 -74
  80. data/lib/google/cloud/spanner/v1/doc/google/protobuf/timestamp.rb +0 -113
  81. data/lib/google/cloud/spanner/v1/doc/google/rpc/status.rb +0 -39
  82. data/lib/google/cloud/spanner/v1/doc/google/spanner/v1/keys.rb +0 -150
  83. data/lib/google/cloud/spanner/v1/doc/google/spanner/v1/mutation.rb +0 -88
  84. data/lib/google/cloud/spanner/v1/doc/google/spanner/v1/query_plan.rb +0 -121
  85. data/lib/google/cloud/spanner/v1/doc/google/spanner/v1/result_set.rb +0 -190
  86. data/lib/google/cloud/spanner/v1/doc/google/spanner/v1/spanner.rb +0 -581
  87. data/lib/google/cloud/spanner/v1/doc/google/spanner/v1/transaction.rb +0 -432
  88. data/lib/google/cloud/spanner/v1/doc/google/spanner/v1/type.rb +0 -112
  89. data/lib/google/cloud/spanner/v1/spanner_client.rb +0 -1509
  90. data/lib/google/cloud/spanner/v1/spanner_client_config.json +0 -121
  91. data/lib/google/spanner/admin/database/v1/spanner_database_admin_pb.rb +0 -88
  92. data/lib/google/spanner/admin/database/v1/spanner_database_admin_services_pb.rb +0 -99
  93. data/lib/google/spanner/admin/instance/v1/spanner_instance_admin_pb.rb +0 -125
  94. data/lib/google/spanner/admin/instance/v1/spanner_instance_admin_services_pb.rb +0 -182
  95. data/lib/google/spanner/v1/keys_pb.rb +0 -34
  96. data/lib/google/spanner/v1/mutation_pb.rb +0 -39
  97. data/lib/google/spanner/v1/query_plan_pb.rb +0 -48
  98. data/lib/google/spanner/v1/result_set_pb.rb +0 -48
  99. data/lib/google/spanner/v1/spanner_pb.rb +0 -174
  100. data/lib/google/spanner/v1/spanner_services_pb.rb +0 -188
  101. data/lib/google/spanner/v1/transaction_pb.rb +0 -56
  102. data/lib/google/spanner/v1/type_pb.rb +0 -44
@@ -1,34 +0,0 @@
1
- # Generated by the protocol buffer compiler. DO NOT EDIT!
2
- # source: google/spanner/v1/keys.proto
3
-
4
-
5
- require 'google/protobuf'
6
-
7
- require 'google/protobuf/struct_pb'
8
- require 'google/api/annotations_pb'
9
- Google::Protobuf::DescriptorPool.generated_pool.build do
10
- add_message "google.spanner.v1.KeyRange" do
11
- oneof :start_key_type do
12
- optional :start_closed, :message, 1, "google.protobuf.ListValue"
13
- optional :start_open, :message, 2, "google.protobuf.ListValue"
14
- end
15
- oneof :end_key_type do
16
- optional :end_closed, :message, 3, "google.protobuf.ListValue"
17
- optional :end_open, :message, 4, "google.protobuf.ListValue"
18
- end
19
- end
20
- add_message "google.spanner.v1.KeySet" do
21
- repeated :keys, :message, 1, "google.protobuf.ListValue"
22
- repeated :ranges, :message, 2, "google.spanner.v1.KeyRange"
23
- optional :all, :bool, 3
24
- end
25
- end
26
-
27
- module Google
28
- module Spanner
29
- module V1
30
- KeyRange = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.KeyRange").msgclass
31
- KeySet = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.KeySet").msgclass
32
- end
33
- end
34
- end
@@ -1,39 +0,0 @@
1
- # Generated by the protocol buffer compiler. DO NOT EDIT!
2
- # source: google/spanner/v1/mutation.proto
3
-
4
-
5
- require 'google/protobuf'
6
-
7
- require 'google/protobuf/struct_pb'
8
- require 'google/spanner/v1/keys_pb'
9
- require 'google/api/annotations_pb'
10
- Google::Protobuf::DescriptorPool.generated_pool.build do
11
- add_message "google.spanner.v1.Mutation" do
12
- oneof :operation do
13
- optional :insert, :message, 1, "google.spanner.v1.Mutation.Write"
14
- optional :update, :message, 2, "google.spanner.v1.Mutation.Write"
15
- optional :insert_or_update, :message, 3, "google.spanner.v1.Mutation.Write"
16
- optional :replace, :message, 4, "google.spanner.v1.Mutation.Write"
17
- optional :delete, :message, 5, "google.spanner.v1.Mutation.Delete"
18
- end
19
- end
20
- add_message "google.spanner.v1.Mutation.Write" do
21
- optional :table, :string, 1
22
- repeated :columns, :string, 2
23
- repeated :values, :message, 3, "google.protobuf.ListValue"
24
- end
25
- add_message "google.spanner.v1.Mutation.Delete" do
26
- optional :table, :string, 1
27
- optional :key_set, :message, 2, "google.spanner.v1.KeySet"
28
- end
29
- end
30
-
31
- module Google
32
- module Spanner
33
- module V1
34
- Mutation = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.Mutation").msgclass
35
- Mutation::Write = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.Mutation.Write").msgclass
36
- Mutation::Delete = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.Mutation.Delete").msgclass
37
- end
38
- end
39
- end
@@ -1,48 +0,0 @@
1
- # Generated by the protocol buffer compiler. DO NOT EDIT!
2
- # source: google/spanner/v1/query_plan.proto
3
-
4
-
5
- require 'google/protobuf'
6
-
7
- require 'google/protobuf/struct_pb'
8
- require 'google/api/annotations_pb'
9
- Google::Protobuf::DescriptorPool.generated_pool.build do
10
- add_message "google.spanner.v1.PlanNode" do
11
- optional :index, :int32, 1
12
- optional :kind, :enum, 2, "google.spanner.v1.PlanNode.Kind"
13
- optional :display_name, :string, 3
14
- repeated :child_links, :message, 4, "google.spanner.v1.PlanNode.ChildLink"
15
- optional :short_representation, :message, 5, "google.spanner.v1.PlanNode.ShortRepresentation"
16
- optional :metadata, :message, 6, "google.protobuf.Struct"
17
- optional :execution_stats, :message, 7, "google.protobuf.Struct"
18
- end
19
- add_message "google.spanner.v1.PlanNode.ChildLink" do
20
- optional :child_index, :int32, 1
21
- optional :type, :string, 2
22
- optional :variable, :string, 3
23
- end
24
- add_message "google.spanner.v1.PlanNode.ShortRepresentation" do
25
- optional :description, :string, 1
26
- map :subqueries, :string, :int32, 2
27
- end
28
- add_enum "google.spanner.v1.PlanNode.Kind" do
29
- value :KIND_UNSPECIFIED, 0
30
- value :RELATIONAL, 1
31
- value :SCALAR, 2
32
- end
33
- add_message "google.spanner.v1.QueryPlan" do
34
- repeated :plan_nodes, :message, 1, "google.spanner.v1.PlanNode"
35
- end
36
- end
37
-
38
- module Google
39
- module Spanner
40
- module V1
41
- PlanNode = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.PlanNode").msgclass
42
- PlanNode::ChildLink = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.PlanNode.ChildLink").msgclass
43
- PlanNode::ShortRepresentation = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.PlanNode.ShortRepresentation").msgclass
44
- PlanNode::Kind = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.PlanNode.Kind").enummodule
45
- QueryPlan = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.QueryPlan").msgclass
46
- end
47
- end
48
- end
@@ -1,48 +0,0 @@
1
- # Generated by the protocol buffer compiler. DO NOT EDIT!
2
- # source: google/spanner/v1/result_set.proto
3
-
4
-
5
- require 'google/protobuf'
6
-
7
- require 'google/protobuf/struct_pb'
8
- require 'google/spanner/v1/query_plan_pb'
9
- require 'google/spanner/v1/transaction_pb'
10
- require 'google/spanner/v1/type_pb'
11
- require 'google/api/annotations_pb'
12
- Google::Protobuf::DescriptorPool.generated_pool.build do
13
- add_message "google.spanner.v1.ResultSet" do
14
- optional :metadata, :message, 1, "google.spanner.v1.ResultSetMetadata"
15
- repeated :rows, :message, 2, "google.protobuf.ListValue"
16
- optional :stats, :message, 3, "google.spanner.v1.ResultSetStats"
17
- end
18
- add_message "google.spanner.v1.PartialResultSet" do
19
- optional :metadata, :message, 1, "google.spanner.v1.ResultSetMetadata"
20
- repeated :values, :message, 2, "google.protobuf.Value"
21
- optional :chunked_value, :bool, 3
22
- optional :resume_token, :bytes, 4
23
- optional :stats, :message, 5, "google.spanner.v1.ResultSetStats"
24
- end
25
- add_message "google.spanner.v1.ResultSetMetadata" do
26
- optional :row_type, :message, 1, "google.spanner.v1.StructType"
27
- optional :transaction, :message, 2, "google.spanner.v1.Transaction"
28
- end
29
- add_message "google.spanner.v1.ResultSetStats" do
30
- optional :query_plan, :message, 1, "google.spanner.v1.QueryPlan"
31
- optional :query_stats, :message, 2, "google.protobuf.Struct"
32
- oneof :row_count do
33
- optional :row_count_exact, :int64, 3
34
- optional :row_count_lower_bound, :int64, 4
35
- end
36
- end
37
- end
38
-
39
- module Google
40
- module Spanner
41
- module V1
42
- ResultSet = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.ResultSet").msgclass
43
- PartialResultSet = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.PartialResultSet").msgclass
44
- ResultSetMetadata = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.ResultSetMetadata").msgclass
45
- ResultSetStats = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.ResultSetStats").msgclass
46
- end
47
- end
48
- end
@@ -1,174 +0,0 @@
1
- # Generated by the protocol buffer compiler. DO NOT EDIT!
2
- # source: google/spanner/v1/spanner.proto
3
-
4
-
5
- require 'google/protobuf'
6
-
7
- require 'google/api/annotations_pb'
8
- require 'google/api/client_pb'
9
- require 'google/api/field_behavior_pb'
10
- require 'google/api/resource_pb'
11
- require 'google/protobuf/empty_pb'
12
- require 'google/protobuf/struct_pb'
13
- require 'google/protobuf/timestamp_pb'
14
- require 'google/rpc/status_pb'
15
- require 'google/spanner/v1/keys_pb'
16
- require 'google/spanner/v1/mutation_pb'
17
- require 'google/spanner/v1/result_set_pb'
18
- require 'google/spanner/v1/transaction_pb'
19
- require 'google/spanner/v1/type_pb'
20
- Google::Protobuf::DescriptorPool.generated_pool.build do
21
- add_message "google.spanner.v1.CreateSessionRequest" do
22
- optional :database, :string, 1
23
- optional :session, :message, 2, "google.spanner.v1.Session"
24
- end
25
- add_message "google.spanner.v1.BatchCreateSessionsRequest" do
26
- optional :database, :string, 1
27
- optional :session_template, :message, 2, "google.spanner.v1.Session"
28
- optional :session_count, :int32, 3
29
- end
30
- add_message "google.spanner.v1.BatchCreateSessionsResponse" do
31
- repeated :session, :message, 1, "google.spanner.v1.Session"
32
- end
33
- add_message "google.spanner.v1.Session" do
34
- optional :name, :string, 1
35
- map :labels, :string, :string, 2
36
- optional :create_time, :message, 3, "google.protobuf.Timestamp"
37
- optional :approximate_last_use_time, :message, 4, "google.protobuf.Timestamp"
38
- end
39
- add_message "google.spanner.v1.GetSessionRequest" do
40
- optional :name, :string, 1
41
- end
42
- add_message "google.spanner.v1.ListSessionsRequest" do
43
- optional :database, :string, 1
44
- optional :page_size, :int32, 2
45
- optional :page_token, :string, 3
46
- optional :filter, :string, 4
47
- end
48
- add_message "google.spanner.v1.ListSessionsResponse" do
49
- repeated :sessions, :message, 1, "google.spanner.v1.Session"
50
- optional :next_page_token, :string, 2
51
- end
52
- add_message "google.spanner.v1.DeleteSessionRequest" do
53
- optional :name, :string, 1
54
- end
55
- add_message "google.spanner.v1.ExecuteSqlRequest" do
56
- optional :session, :string, 1
57
- optional :transaction, :message, 2, "google.spanner.v1.TransactionSelector"
58
- optional :sql, :string, 3
59
- optional :params, :message, 4, "google.protobuf.Struct"
60
- map :param_types, :string, :message, 5, "google.spanner.v1.Type"
61
- optional :resume_token, :bytes, 6
62
- optional :query_mode, :enum, 7, "google.spanner.v1.ExecuteSqlRequest.QueryMode"
63
- optional :partition_token, :bytes, 8
64
- optional :seqno, :int64, 9
65
- end
66
- add_enum "google.spanner.v1.ExecuteSqlRequest.QueryMode" do
67
- value :NORMAL, 0
68
- value :PLAN, 1
69
- value :PROFILE, 2
70
- end
71
- add_message "google.spanner.v1.ExecuteBatchDmlRequest" do
72
- optional :session, :string, 1
73
- optional :transaction, :message, 2, "google.spanner.v1.TransactionSelector"
74
- repeated :statements, :message, 3, "google.spanner.v1.ExecuteBatchDmlRequest.Statement"
75
- optional :seqno, :int64, 4
76
- end
77
- add_message "google.spanner.v1.ExecuteBatchDmlRequest.Statement" do
78
- optional :sql, :string, 1
79
- optional :params, :message, 2, "google.protobuf.Struct"
80
- map :param_types, :string, :message, 3, "google.spanner.v1.Type"
81
- end
82
- add_message "google.spanner.v1.ExecuteBatchDmlResponse" do
83
- repeated :result_sets, :message, 1, "google.spanner.v1.ResultSet"
84
- optional :status, :message, 2, "google.rpc.Status"
85
- end
86
- add_message "google.spanner.v1.PartitionOptions" do
87
- optional :partition_size_bytes, :int64, 1
88
- optional :max_partitions, :int64, 2
89
- end
90
- add_message "google.spanner.v1.PartitionQueryRequest" do
91
- optional :session, :string, 1
92
- optional :transaction, :message, 2, "google.spanner.v1.TransactionSelector"
93
- optional :sql, :string, 3
94
- optional :params, :message, 4, "google.protobuf.Struct"
95
- map :param_types, :string, :message, 5, "google.spanner.v1.Type"
96
- optional :partition_options, :message, 6, "google.spanner.v1.PartitionOptions"
97
- end
98
- add_message "google.spanner.v1.PartitionReadRequest" do
99
- optional :session, :string, 1
100
- optional :transaction, :message, 2, "google.spanner.v1.TransactionSelector"
101
- optional :table, :string, 3
102
- optional :index, :string, 4
103
- repeated :columns, :string, 5
104
- optional :key_set, :message, 6, "google.spanner.v1.KeySet"
105
- optional :partition_options, :message, 9, "google.spanner.v1.PartitionOptions"
106
- end
107
- add_message "google.spanner.v1.Partition" do
108
- optional :partition_token, :bytes, 1
109
- end
110
- add_message "google.spanner.v1.PartitionResponse" do
111
- repeated :partitions, :message, 1, "google.spanner.v1.Partition"
112
- optional :transaction, :message, 2, "google.spanner.v1.Transaction"
113
- end
114
- add_message "google.spanner.v1.ReadRequest" do
115
- optional :session, :string, 1
116
- optional :transaction, :message, 2, "google.spanner.v1.TransactionSelector"
117
- optional :table, :string, 3
118
- optional :index, :string, 4
119
- repeated :columns, :string, 5
120
- optional :key_set, :message, 6, "google.spanner.v1.KeySet"
121
- optional :limit, :int64, 8
122
- optional :resume_token, :bytes, 9
123
- optional :partition_token, :bytes, 10
124
- end
125
- add_message "google.spanner.v1.BeginTransactionRequest" do
126
- optional :session, :string, 1
127
- optional :options, :message, 2, "google.spanner.v1.TransactionOptions"
128
- end
129
- add_message "google.spanner.v1.CommitRequest" do
130
- optional :session, :string, 1
131
- repeated :mutations, :message, 4, "google.spanner.v1.Mutation"
132
- oneof :transaction do
133
- optional :transaction_id, :bytes, 2
134
- optional :single_use_transaction, :message, 3, "google.spanner.v1.TransactionOptions"
135
- end
136
- end
137
- add_message "google.spanner.v1.CommitResponse" do
138
- optional :commit_timestamp, :message, 1, "google.protobuf.Timestamp"
139
- end
140
- add_message "google.spanner.v1.RollbackRequest" do
141
- optional :session, :string, 1
142
- optional :transaction_id, :bytes, 2
143
- end
144
- end
145
-
146
- module Google
147
- module Spanner
148
- module V1
149
- CreateSessionRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.CreateSessionRequest").msgclass
150
- BatchCreateSessionsRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.BatchCreateSessionsRequest").msgclass
151
- BatchCreateSessionsResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.BatchCreateSessionsResponse").msgclass
152
- Session = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.Session").msgclass
153
- GetSessionRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.GetSessionRequest").msgclass
154
- ListSessionsRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.ListSessionsRequest").msgclass
155
- ListSessionsResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.ListSessionsResponse").msgclass
156
- DeleteSessionRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.DeleteSessionRequest").msgclass
157
- ExecuteSqlRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.ExecuteSqlRequest").msgclass
158
- ExecuteSqlRequest::QueryMode = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.ExecuteSqlRequest.QueryMode").enummodule
159
- ExecuteBatchDmlRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.ExecuteBatchDmlRequest").msgclass
160
- ExecuteBatchDmlRequest::Statement = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.ExecuteBatchDmlRequest.Statement").msgclass
161
- ExecuteBatchDmlResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.ExecuteBatchDmlResponse").msgclass
162
- PartitionOptions = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.PartitionOptions").msgclass
163
- PartitionQueryRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.PartitionQueryRequest").msgclass
164
- PartitionReadRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.PartitionReadRequest").msgclass
165
- Partition = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.Partition").msgclass
166
- PartitionResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.PartitionResponse").msgclass
167
- ReadRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.ReadRequest").msgclass
168
- BeginTransactionRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.BeginTransactionRequest").msgclass
169
- CommitRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.CommitRequest").msgclass
170
- CommitResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.CommitResponse").msgclass
171
- RollbackRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.RollbackRequest").msgclass
172
- end
173
- end
174
- end
@@ -1,188 +0,0 @@
1
- # Generated by the protocol buffer compiler. DO NOT EDIT!
2
- # Source: google/spanner/v1/spanner.proto for package 'google.spanner.v1'
3
- # Original file comments:
4
- # Copyright 2019 Google LLC.
5
- #
6
- # Licensed under the Apache License, Version 2.0 (the "License");
7
- # you may not use this file except in compliance with the License.
8
- # You may obtain a copy of the License at
9
- #
10
- # http://www.apache.org/licenses/LICENSE-2.0
11
- #
12
- # Unless required by applicable law or agreed to in writing, software
13
- # distributed under the License is distributed on an "AS IS" BASIS,
14
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
- # See the License for the specific language governing permissions and
16
- # limitations under the License.
17
- #
18
- #
19
-
20
-
21
- require 'grpc'
22
- require 'google/spanner/v1/spanner_pb'
23
-
24
- module Google
25
- module Spanner
26
- module V1
27
- module Spanner
28
- # Cloud Spanner API
29
- #
30
- # The Cloud Spanner API can be used to manage sessions and execute
31
- # transactions on data stored in Cloud Spanner databases.
32
- class Service
33
-
34
- include GRPC::GenericService
35
-
36
- self.marshal_class_method = :encode
37
- self.unmarshal_class_method = :decode
38
- self.service_name = 'google.spanner.v1.Spanner'
39
-
40
- # Creates a new session. A session can be used to perform
41
- # transactions that read and/or modify data in a Cloud Spanner database.
42
- # Sessions are meant to be reused for many consecutive
43
- # transactions.
44
- #
45
- # Sessions can only execute one transaction at a time. To execute
46
- # multiple concurrent read-write/write-only transactions, create
47
- # multiple sessions. Note that standalone reads and queries use a
48
- # transaction internally, and count toward the one transaction
49
- # limit.
50
- #
51
- # Active sessions use additional server resources, so it is a good idea to
52
- # delete idle and unneeded sessions.
53
- # Aside from explicit deletes, Cloud Spanner can delete sessions for which no
54
- # operations are sent for more than an hour. If a session is deleted,
55
- # requests to it return `NOT_FOUND`.
56
- #
57
- # Idle sessions can be kept alive by sending a trivial SQL query
58
- # periodically, e.g., `"SELECT 1"`.
59
- rpc :CreateSession, CreateSessionRequest, Session
60
- # Creates multiple new sessions.
61
- #
62
- # This API can be used to initialize a session cache on the clients.
63
- # See https://goo.gl/TgSFN2 for best practices on session cache management.
64
- rpc :BatchCreateSessions, BatchCreateSessionsRequest, BatchCreateSessionsResponse
65
- # Gets a session. Returns `NOT_FOUND` if the session does not exist.
66
- # This is mainly useful for determining whether a session is still
67
- # alive.
68
- rpc :GetSession, GetSessionRequest, Session
69
- # Lists all sessions in a given database.
70
- rpc :ListSessions, ListSessionsRequest, ListSessionsResponse
71
- # Ends a session, releasing server resources associated with it. This will
72
- # asynchronously trigger cancellation of any operations that are running with
73
- # this session.
74
- rpc :DeleteSession, DeleteSessionRequest, Google::Protobuf::Empty
75
- # Executes an SQL statement, returning all results in a single reply. This
76
- # method cannot be used to return a result set larger than 10 MiB;
77
- # if the query yields more data than that, the query fails with
78
- # a `FAILED_PRECONDITION` error.
79
- #
80
- # Operations inside read-write transactions might return `ABORTED`. If
81
- # this occurs, the application should restart the transaction from
82
- # the beginning. See [Transaction][google.spanner.v1.Transaction] for more
83
- # details.
84
- #
85
- # Larger result sets can be fetched in streaming fashion by calling
86
- # [ExecuteStreamingSql][google.spanner.v1.Spanner.ExecuteStreamingSql]
87
- # instead.
88
- rpc :ExecuteSql, ExecuteSqlRequest, ResultSet
89
- # Like [ExecuteSql][google.spanner.v1.Spanner.ExecuteSql], except returns the
90
- # result set as a stream. Unlike
91
- # [ExecuteSql][google.spanner.v1.Spanner.ExecuteSql], there is no limit on
92
- # the size of the returned result set. However, no individual row in the
93
- # result set can exceed 100 MiB, and no column value can exceed 10 MiB.
94
- rpc :ExecuteStreamingSql, ExecuteSqlRequest, stream(PartialResultSet)
95
- # Executes a batch of SQL DML statements. This method allows many statements
96
- # to be run with lower latency than submitting them sequentially with
97
- # [ExecuteSql][google.spanner.v1.Spanner.ExecuteSql].
98
- #
99
- # Statements are executed in sequential order. A request can succeed even if
100
- # a statement fails. The
101
- # [ExecuteBatchDmlResponse.status][google.spanner.v1.ExecuteBatchDmlResponse.status]
102
- # field in the response provides information about the statement that failed.
103
- # Clients must inspect this field to determine whether an error occurred.
104
- #
105
- # Execution stops after the first failed statement; the remaining statements
106
- # are not executed.
107
- rpc :ExecuteBatchDml, ExecuteBatchDmlRequest, ExecuteBatchDmlResponse
108
- # Reads rows from the database using key lookups and scans, as a
109
- # simple key/value style alternative to
110
- # [ExecuteSql][google.spanner.v1.Spanner.ExecuteSql]. This method cannot be
111
- # used to return a result set larger than 10 MiB; if the read matches more
112
- # data than that, the read fails with a `FAILED_PRECONDITION`
113
- # error.
114
- #
115
- # Reads inside read-write transactions might return `ABORTED`. If
116
- # this occurs, the application should restart the transaction from
117
- # the beginning. See [Transaction][google.spanner.v1.Transaction] for more
118
- # details.
119
- #
120
- # Larger result sets can be yielded in streaming fashion by calling
121
- # [StreamingRead][google.spanner.v1.Spanner.StreamingRead] instead.
122
- rpc :Read, ReadRequest, ResultSet
123
- # Like [Read][google.spanner.v1.Spanner.Read], except returns the result set
124
- # as a stream. Unlike [Read][google.spanner.v1.Spanner.Read], there is no
125
- # limit on the size of the returned result set. However, no individual row in
126
- # the result set can exceed 100 MiB, and no column value can exceed
127
- # 10 MiB.
128
- rpc :StreamingRead, ReadRequest, stream(PartialResultSet)
129
- # Begins a new transaction. This step can often be skipped:
130
- # [Read][google.spanner.v1.Spanner.Read],
131
- # [ExecuteSql][google.spanner.v1.Spanner.ExecuteSql] and
132
- # [Commit][google.spanner.v1.Spanner.Commit] can begin a new transaction as a
133
- # side-effect.
134
- rpc :BeginTransaction, BeginTransactionRequest, Transaction
135
- # Commits a transaction. The request includes the mutations to be
136
- # applied to rows in the database.
137
- #
138
- # `Commit` might return an `ABORTED` error. This can occur at any time;
139
- # commonly, the cause is conflicts with concurrent
140
- # transactions. However, it can also happen for a variety of other
141
- # reasons. If `Commit` returns `ABORTED`, the caller should re-attempt
142
- # the transaction from the beginning, re-using the same session.
143
- rpc :Commit, CommitRequest, CommitResponse
144
- # Rolls back a transaction, releasing any locks it holds. It is a good
145
- # idea to call this for any transaction that includes one or more
146
- # [Read][google.spanner.v1.Spanner.Read] or
147
- # [ExecuteSql][google.spanner.v1.Spanner.ExecuteSql] requests and ultimately
148
- # decides not to commit.
149
- #
150
- # `Rollback` returns `OK` if it successfully aborts the transaction, the
151
- # transaction was already aborted, or the transaction is not
152
- # found. `Rollback` never returns `ABORTED`.
153
- rpc :Rollback, RollbackRequest, Google::Protobuf::Empty
154
- # Creates a set of partition tokens that can be used to execute a query
155
- # operation in parallel. Each of the returned partition tokens can be used
156
- # by [ExecuteStreamingSql][google.spanner.v1.Spanner.ExecuteStreamingSql] to
157
- # specify a subset of the query result to read. The same session and
158
- # read-only transaction must be used by the PartitionQueryRequest used to
159
- # create the partition tokens and the ExecuteSqlRequests that use the
160
- # partition tokens.
161
- #
162
- # Partition tokens become invalid when the session used to create them
163
- # is deleted, is idle for too long, begins a new transaction, or becomes too
164
- # old. When any of these happen, it is not possible to resume the query, and
165
- # the whole operation must be restarted from the beginning.
166
- rpc :PartitionQuery, PartitionQueryRequest, PartitionResponse
167
- # Creates a set of partition tokens that can be used to execute a read
168
- # operation in parallel. Each of the returned partition tokens can be used
169
- # by [StreamingRead][google.spanner.v1.Spanner.StreamingRead] to specify a
170
- # subset of the read result to read. The same session and read-only
171
- # transaction must be used by the PartitionReadRequest used to create the
172
- # partition tokens and the ReadRequests that use the partition tokens. There
173
- # are no ordering guarantees on rows returned among the returned partition
174
- # tokens, or even within each individual StreamingRead call issued with a
175
- # partition_token.
176
- #
177
- # Partition tokens become invalid when the session used to create them
178
- # is deleted, is idle for too long, begins a new transaction, or becomes too
179
- # old. When any of these happen, it is not possible to resume the read, and
180
- # the whole operation must be restarted from the beginning.
181
- rpc :PartitionRead, PartitionReadRequest, PartitionResponse
182
- end
183
-
184
- Stub = Service.rpc_stub_class
185
- end
186
- end
187
- end
188
- end