google-cloud-spanner 1.0.0 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (44) hide show
  1. checksums.yaml +5 -5
  2. data/lib/google-cloud-spanner.rb +13 -10
  3. data/lib/google/cloud/spanner.rb +21 -18
  4. data/lib/google/cloud/spanner/admin/database.rb +111 -0
  5. data/lib/google/cloud/spanner/admin/database/credentials.rb +35 -0
  6. data/lib/google/cloud/spanner/admin/database/v1.rb +100 -3
  7. data/lib/google/cloud/spanner/admin/database/v1/database_admin_client.rb +129 -138
  8. data/lib/google/cloud/spanner/admin/database/v1/doc/google/iam/v1/policy.rb +8 -8
  9. data/lib/google/cloud/spanner/admin/database/v1/doc/google/protobuf/any.rb +12 -2
  10. data/lib/google/cloud/spanner/admin/database/v1/doc/google/rpc/status.rb +22 -22
  11. data/lib/google/cloud/spanner/admin/database/v1/doc/google/spanner/admin/database/v1/spanner_database_admin.rb +33 -20
  12. data/lib/google/cloud/spanner/admin/database/v1/doc/overview.rb +57 -0
  13. data/lib/google/cloud/spanner/admin/instance.rb +127 -0
  14. data/lib/google/cloud/spanner/admin/instance/credentials.rb +35 -0
  15. data/lib/google/cloud/spanner/admin/instance/v1.rb +116 -3
  16. data/lib/google/cloud/spanner/admin/instance/v1/doc/google/iam/v1/policy.rb +8 -8
  17. data/lib/google/cloud/spanner/admin/instance/v1/doc/google/protobuf/any.rb +12 -2
  18. data/lib/google/cloud/spanner/admin/instance/v1/doc/google/rpc/status.rb +22 -22
  19. data/lib/google/cloud/spanner/admin/instance/v1/doc/google/spanner/admin/instance/v1/spanner_instance_admin.rb +58 -43
  20. data/lib/google/cloud/spanner/admin/instance/v1/doc/overview.rb +57 -0
  21. data/lib/google/cloud/spanner/admin/instance/v1/instance_admin_client.rb +180 -189
  22. data/lib/google/cloud/spanner/client.rb +3 -3
  23. data/lib/google/cloud/spanner/credentials.rb +33 -7
  24. data/lib/google/cloud/spanner/database.rb +3 -6
  25. data/lib/google/cloud/spanner/instance.rb +2 -4
  26. data/lib/google/cloud/spanner/instance/config.rb +2 -4
  27. data/lib/google/cloud/spanner/project.rb +6 -6
  28. data/lib/google/cloud/spanner/service.rb +5 -26
  29. data/lib/google/cloud/spanner/session.rb +4 -4
  30. data/lib/google/cloud/spanner/v1/doc/google/protobuf/duration.rb +14 -1
  31. data/lib/google/cloud/spanner/v1/doc/google/protobuf/timestamp.rb +26 -1
  32. data/lib/google/cloud/spanner/v1/doc/google/spanner/v1/keys.rb +3 -3
  33. data/lib/google/cloud/spanner/v1/doc/google/spanner/v1/mutation.rb +12 -12
  34. data/lib/google/cloud/spanner/v1/doc/google/spanner/v1/query_plan.rb +9 -9
  35. data/lib/google/cloud/spanner/v1/doc/google/spanner/v1/result_set.rb +33 -33
  36. data/lib/google/cloud/spanner/v1/doc/google/spanner/v1/spanner.rb +99 -28
  37. data/lib/google/cloud/spanner/v1/doc/google/spanner/v1/transaction.rb +41 -31
  38. data/lib/google/cloud/spanner/v1/doc/overview.rb +54 -0
  39. data/lib/google/cloud/spanner/v1/spanner_client.rb +277 -195
  40. data/lib/google/cloud/spanner/v1/spanner_client_config.json +5 -0
  41. data/lib/google/cloud/spanner/version.rb +1 -1
  42. data/lib/google/spanner/v1/spanner_pb.rb +16 -1
  43. data/lib/google/spanner/v1/spanner_services_pb.rb +2 -0
  44. metadata +16 -23
@@ -788,8 +788,8 @@ module Google
788
788
  # [TransactionOptions](https://cloud.google.com/spanner/docs/reference/rpc/google.spanner.v1#transactionoptions).)
789
789
  # @param [Time, DateTime] read_timestamp Same as `timestamp`.
790
790
  # @param [Numeric] staleness Executes all reads at a timestamp that is
791
- # +staleness+ old. The timestamp is chosen soon after the read
792
- # is started.
791
+ # `staleness` seconds old. For example, the number 10.1 is translated
792
+ # to 10 seconds and 100 milliseconds.
793
793
  #
794
794
  # Guarantees that all writes that have committed more than the
795
795
  # specified number of seconds ago are visible. Because Cloud Spanner
@@ -798,7 +798,7 @@ module Google
798
798
  # timestamps.
799
799
  #
800
800
  # Useful for reading at nearby replicas without the distributed
801
- # timestamp negotiation overhead of single-use +staleness+. (See
801
+ # timestamp negotiation overhead of single-use `staleness`. (See
802
802
  # [TransactionOptions](https://cloud.google.com/spanner/docs/reference/rpc/google.spanner.v1#transactionoptions).)
803
803
  # @param [Numeric] exact_staleness Same as `staleness`.
804
804
  #
@@ -13,19 +13,45 @@
13
13
  # limitations under the License.
14
14
 
15
15
 
16
- require "google/cloud/credentials"
17
- require "google/cloud/spanner/v1"
16
+ require "googleauth"
18
17
 
19
18
  module Google
20
19
  module Cloud
21
20
  module Spanner
22
21
  ##
23
- # @private Represents the OAuth 2.0 signing logic for Spanner.
24
- class Credentials < Google::Cloud::Credentials
25
- SCOPE = V1::SpannerClient::ALL_SCOPES
26
- PATH_ENV_VARS = %w(SPANNER_KEYFILE GOOGLE_CLOUD_KEYFILE GCLOUD_KEYFILE)
27
- JSON_ENV_VARS = %w(SPANNER_KEYFILE_JSON GOOGLE_CLOUD_KEYFILE_JSON
22
+ # # Credentials
23
+ #
24
+ # Represents the authentication and authorization used to connect to the
25
+ # Spanner API.
26
+ #
27
+ # @example
28
+ # require "google/cloud/spanner"
29
+ #
30
+ # keyfile = "/path/to/keyfile.json"
31
+ # creds = Google::Cloud::Spanner::Credentials.new keyfile
32
+ #
33
+ # spanner = Google::Cloud::Spanner.new(
34
+ # project_id: "my-project",
35
+ # credentials: creds
36
+ # )
37
+ #
38
+ # spanner.project_id #=> "my-project"
39
+ #
40
+ class Credentials < Google::Auth::Credentials
41
+ SCOPE = %w(https://www.googleapis.com/auth/cloud-platform
42
+ https://www.googleapis.com/auth/spanner.data)
43
+ PATH_ENV_VARS = %w(SPANNER_CREDENTIALS
44
+ SPANNER_KEYFILE
45
+ GOOGLE_CLOUD_CREDENTIALS
46
+ GOOGLE_CLOUD_KEYFILE
47
+ GCLOUD_KEYFILE)
48
+ JSON_ENV_VARS = %w(SPANNER_CREDENTIALS_JSON
49
+ SPANNER_KEYFILE_JSON
50
+ GOOGLE_CLOUD_CREDENTIALS_JSON
51
+ GOOGLE_CLOUD_KEYFILE_JSON
28
52
  GCLOUD_KEYFILE_JSON)
53
+ DEFAULT_PATHS = \
54
+ ["~/.config/gcloud/application_default_credentials.json"]
29
55
  end
30
56
  end
31
57
  end
@@ -64,22 +64,19 @@ module Google
64
64
  # The unique identifier for the project.
65
65
  # @return [String]
66
66
  def project_id
67
- Admin::Database::V1::DatabaseAdminClient
68
- .match_project_from_database_name @grpc.name
67
+ @grpc.name.split("/")[1]
69
68
  end
70
69
 
71
70
  # The unique identifier for the instance.
72
71
  # @return [String]
73
72
  def instance_id
74
- Admin::Database::V1::DatabaseAdminClient
75
- .match_instance_from_database_name @grpc.name
73
+ @grpc.name.split("/")[3]
76
74
  end
77
75
 
78
76
  # The unique identifier for the database.
79
77
  # @return [String]
80
78
  def database_id
81
- Admin::Database::V1::DatabaseAdminClient
82
- .match_database_from_database_name @grpc.name
79
+ @grpc.name.split("/")[5]
83
80
  end
84
81
 
85
82
  # rubocop:disable LineLength
@@ -69,15 +69,13 @@ module Google
69
69
  # The unique identifier for the project.
70
70
  # @return [String]
71
71
  def project_id
72
- Admin::Instance::V1::InstanceAdminClient
73
- .match_project_from_instance_name @grpc.name
72
+ @grpc.name.split("/")[1]
74
73
  end
75
74
 
76
75
  # The unique identifier for the instance.
77
76
  # @return [String]
78
77
  def instance_id
79
- Admin::Instance::V1::InstanceAdminClient
80
- .match_instance_from_instance_name @grpc.name
78
+ @grpc.name.split("/")[3]
81
79
  end
82
80
 
83
81
  ##
@@ -49,16 +49,14 @@ module Google
49
49
  # The unique identifier for the project.
50
50
  # @return [String]
51
51
  def project_id
52
- Admin::Instance::V1::InstanceAdminClient
53
- .match_project_from_instance_config_name @grpc.name
52
+ @grpc.name.split("/")[1]
54
53
  end
55
54
 
56
55
  ##
57
56
  # A unique identifier for the instance configuration.
58
57
  # @return [String]
59
58
  def instance_config_id
60
- Admin::Instance::V1::InstanceAdminClient
61
- .match_instance_config_from_instance_config_name @grpc.name
59
+ @grpc.name.split("/")[3]
62
60
  end
63
61
 
64
62
  ##
@@ -83,20 +83,20 @@ module Google
83
83
  # require "google/cloud"
84
84
  #
85
85
  # spanner = Google::Cloud::Spanner.new(
86
- # project: "my-project-id",
87
- # keyfile: "/path/to/keyfile.json"
86
+ # project_id: "my-project",
87
+ # credentials: "/path/to/keyfile.json"
88
88
  # )
89
89
  #
90
- # spanner.project #=> "my-project-id"
90
+ # spanner.project_id #=> "my-project"
91
91
  #
92
- def project
92
+ def project_id
93
93
  service.project
94
94
  end
95
- alias_method :project_id, :project
95
+ alias_method :project, :project_id
96
96
 
97
97
  ##
98
98
  # @private Default project.
99
- def self.default_project
99
+ def self.default_project_id
100
100
  ENV["SPANNER_PROJECT"] ||
101
101
  ENV["GOOGLE_CLOUD_PROJECT"] ||
102
102
  ENV["GCLOUD_PROJECT"] ||
@@ -28,37 +28,22 @@ module Google
28
28
  # @private Represents the gRPC Spanner service, including all the API
29
29
  # methods.
30
30
  class Service
31
- attr_accessor :project, :credentials, :host, :timeout, :client_config
31
+ attr_accessor :project, :credentials, :timeout, :client_config
32
32
 
33
33
  ##
34
34
  # Creates a new Service instance.
35
- def initialize project, credentials, host: nil, timeout: nil,
36
- client_config: nil
35
+ def initialize project, credentials, timeout: nil, client_config: nil
37
36
  @project = project
38
37
  @credentials = credentials
39
- @host = host || V1::SpannerClient::SERVICE_ADDRESS
40
38
  @timeout = timeout
41
39
  @client_config = client_config || {}
42
40
  end
43
41
 
44
- def channel
45
- require "grpc"
46
- GRPC::Core::Channel.new host, nil, chan_creds
47
- end
48
-
49
- def chan_creds
50
- return credentials if insecure?
51
- require "grpc"
52
- GRPC::Core::ChannelCredentials.new.compose \
53
- GRPC::Core::CallCredentials.new credentials.client.updater_proc
54
- end
55
-
56
42
  def service
57
43
  return mocked_service if mocked_service
58
44
  @service ||= \
59
45
  V1::SpannerClient.new(
60
- service_path: host,
61
- channel: channel,
46
+ credentials: credentials,
62
47
  timeout: timeout,
63
48
  client_config: client_config,
64
49
  lib_name: "gccl",
@@ -70,8 +55,7 @@ module Google
70
55
  return mocked_instances if mocked_instances
71
56
  @instances ||= \
72
57
  Admin::Instance::V1::InstanceAdminClient.new(
73
- service_path: host,
74
- channel: channel,
58
+ credentials: credentials,
75
59
  timeout: timeout,
76
60
  client_config: client_config,
77
61
  lib_name: "gccl",
@@ -83,8 +67,7 @@ module Google
83
67
  return mocked_databases if mocked_databases
84
68
  @databases ||= \
85
69
  Admin::Database::V1::DatabaseAdminClient.new(
86
- service_path: host,
87
- channel: channel,
70
+ credentials: credentials,
88
71
  timeout: timeout,
89
72
  client_config: client_config,
90
73
  lib_name: "gccl",
@@ -92,10 +75,6 @@ module Google
92
75
  end
93
76
  attr_accessor :mocked_databases
94
77
 
95
- def insecure?
96
- credentials == :this_channel_is_insecure
97
- end
98
-
99
78
  def list_instances token: nil, max: nil
100
79
  call_options = nil
101
80
  call_options = Google::Gax::CallOptions.new page_token: token if token
@@ -57,25 +57,25 @@ module Google
57
57
  # The unique identifier for the project.
58
58
  # @return [String]
59
59
  def project_id
60
- V1::SpannerClient.match_project_from_session_name @grpc.name
60
+ @grpc.name.split("/")[1]
61
61
  end
62
62
 
63
63
  # The unique identifier for the instance.
64
64
  # @return [String]
65
65
  def instance_id
66
- V1::SpannerClient.match_instance_from_session_name @grpc.name
66
+ @grpc.name.split("/")[3]
67
67
  end
68
68
 
69
69
  # The unique identifier for the database.
70
70
  # @return [String]
71
71
  def database_id
72
- V1::SpannerClient.match_database_from_session_name @grpc.name
72
+ @grpc.name.split("/")[5]
73
73
  end
74
74
 
75
75
  # The unique identifier for the session.
76
76
  # @return [String]
77
77
  def session_id
78
- V1::SpannerClient.match_session_from_session_name @grpc.name
78
+ @grpc.name.split("/")[7]
79
79
  end
80
80
 
81
81
  # rubocop:disable LineLength
@@ -21,6 +21,8 @@ module Google
21
21
  # two Timestamp values is a Duration and it can be added or subtracted
22
22
  # from a Timestamp. Range is approximately +-10,000 years.
23
23
  #
24
+ # = Examples
25
+ #
24
26
  # Example 1: Compute Duration from two Timestamps in pseudo code.
25
27
  #
26
28
  # Timestamp start = ...;
@@ -60,10 +62,21 @@ module Google
60
62
  # td = datetime.timedelta(days=3, minutes=10)
61
63
  # duration = Duration()
62
64
  # duration.FromTimedelta(td)
65
+ #
66
+ # = JSON Mapping
67
+ #
68
+ # In JSON format, the Duration type is encoded as a string rather than an
69
+ # object, where the string ends in the suffix "s" (indicating seconds) and
70
+ # is preceded by the number of seconds, with nanoseconds expressed as
71
+ # fractional seconds. For example, 3 seconds with 0 nanoseconds should be
72
+ # encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should
73
+ # be expressed in JSON format as "3.000000001s", and 3 seconds and 1
74
+ # microsecond should be expressed in JSON format as "3.000001s".
63
75
  # @!attribute [rw] seconds
64
76
  # @return [Integer]
65
77
  # Signed seconds of the span of time. Must be from -315,576,000,000
66
- # to +315,576,000,000 inclusive.
78
+ # to +315,576,000,000 inclusive. Note: these bounds are computed from:
79
+ # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years
67
80
  # @!attribute [rw] nanos
68
81
  # @return [Integer]
69
82
  # Signed fractions of a second at nanosecond resolution of the span
@@ -24,7 +24,9 @@ module Google
24
24
  # 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z.
25
25
  # By restricting to that range, we ensure that we can convert to
26
26
  # and from RFC 3339 date strings.
27
- # See {https://www.ietf.org/rfc/rfc3339.txt}[https://www.ietf.org/rfc/rfc3339.txt].
27
+ # See [https://www.ietf.org/rfc/rfc3339.txt](https://www.ietf.org/rfc/rfc3339.txt).
28
+ #
29
+ # = Examples
28
30
  #
29
31
  # Example 1: Compute Timestamp from POSIX +time()+.
30
32
  #
@@ -65,6 +67,29 @@ module Google
65
67
  #
66
68
  # timestamp = Timestamp()
67
69
  # timestamp.GetCurrentTime()
70
+ #
71
+ # = JSON Mapping
72
+ #
73
+ # In JSON format, the Timestamp type is encoded as a string in the
74
+ # [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the
75
+ # format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z"
76
+ # where {year} is always expressed using four digits while {month}, {day},
77
+ # {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional
78
+ # seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution),
79
+ # are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone
80
+ # is required, though only UTC (as indicated by "Z") is presently supported.
81
+ #
82
+ # For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past
83
+ # 01:30 UTC on January 15, 2017.
84
+ #
85
+ # In JavaScript, one can convert a Date object to this format using the
86
+ # standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString]
87
+ # method. In Python, a standard +datetime.datetime+ object can be converted
88
+ # to this format using [+strftime+](https://docs.python.org/2/library/time.html#time.strftime)
89
+ # with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one
90
+ # can use the Joda Time's [+ISODateTimeFormat.dateTime()+](
91
+ # http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime())
92
+ # to obtain a formatter capable of generating timestamps in this format.
68
93
  # @!attribute [rw] seconds
69
94
  # @return [Integer]
70
95
  # Represents seconds of UTC time since Unix epoch
@@ -22,7 +22,7 @@ module Google
22
22
  #
23
23
  # Keys are represented by lists, where the ith value in the list
24
24
  # corresponds to the ith component of the table or index primary key.
25
- # Individual values are encoded as described Here.
25
+ # Individual values are encoded as described {Google::Spanner::V1::TypeCode here}.
26
26
  #
27
27
  # For example, consider the following table definition:
28
28
  #
@@ -132,10 +132,10 @@ module Google
132
132
  # A list of specific keys. Entries in +keys+ should have exactly as
133
133
  # many elements as there are columns in the primary or index key
134
134
  # with which this +KeySet+ is used. Individual key values are
135
- # encoded as described Here.
135
+ # encoded as described {Google::Spanner::V1::TypeCode here}.
136
136
  # @!attribute [rw] ranges
137
137
  # @return [Array<Google::Spanner::V1::KeyRange>]
138
- # A list of key ranges. See KeyRange for more information about
138
+ # A list of key ranges. See {Google::Spanner::V1::KeyRange KeyRange} for more information about
139
139
  # key range specifications.
140
140
  # @!attribute [rw] all
141
141
  # @return [true, false]
@@ -17,7 +17,7 @@ module Google
17
17
  module V1
18
18
  # A modification to one or more Cloud Spanner rows. Mutations can be
19
19
  # applied to a Cloud Spanner database by sending them in a
20
- # Commit call.
20
+ # {Google::Spanner::V1::Spanner::Commit Commit} call.
21
21
  # @!attribute [rw] insert
22
22
  # @return [Google::Spanner::V1::Mutation::Write]
23
23
  # Insert new rows in a table. If any of the rows already exist,
@@ -28,28 +28,28 @@ module Google
28
28
  # already exist, the transaction fails with error +NOT_FOUND+.
29
29
  # @!attribute [rw] insert_or_update
30
30
  # @return [Google::Spanner::V1::Mutation::Write]
31
- # Like Insert, except that if the row already exists, then
31
+ # Like {Google::Spanner::V1::Mutation#insert insert}, except that if the row already exists, then
32
32
  # its column values are overwritten with the ones provided. Any
33
33
  # column values not explicitly written are preserved.
34
34
  # @!attribute [rw] replace
35
35
  # @return [Google::Spanner::V1::Mutation::Write]
36
- # Like Insert, except that if the row already exists, it is
36
+ # Like {Google::Spanner::V1::Mutation#insert insert}, except that if the row already exists, it is
37
37
  # deleted, and the column values provided are inserted
38
- # instead. Unlike Insert_or_update, this means any values not
38
+ # instead. Unlike {Google::Spanner::V1::Mutation#insert_or_update insert_or_update}, this means any values not
39
39
  # explicitly written become +NULL+.
40
40
  # @!attribute [rw] delete
41
41
  # @return [Google::Spanner::V1::Mutation::Delete]
42
42
  # Delete rows from a table. Succeeds whether or not the named
43
43
  # rows were present.
44
44
  class Mutation
45
- # Arguments to Insert, Update, Insert_or_update, and
46
- # Replace operations.
45
+ # Arguments to {Google::Spanner::V1::Mutation#insert insert}, {Google::Spanner::V1::Mutation#update update}, {Google::Spanner::V1::Mutation#insert_or_update insert_or_update}, and
46
+ # {Google::Spanner::V1::Mutation#replace replace} operations.
47
47
  # @!attribute [rw] table
48
48
  # @return [String]
49
49
  # Required. The table whose rows will be written.
50
50
  # @!attribute [rw] columns
51
51
  # @return [Array<String>]
52
- # The names of the columns in Table to be written.
52
+ # The names of the columns in {Google::Spanner::V1::Mutation::Write#table table} to be written.
53
53
  #
54
54
  # The list of columns must contain enough columns to allow
55
55
  # Cloud Spanner to derive values for all primary key columns in the
@@ -59,20 +59,20 @@ module Google
59
59
  # The values to be written. +values+ can contain more than one
60
60
  # list of values. If it does, then multiple rows are written, one
61
61
  # for each entry in +values+. Each list in +values+ must have
62
- # exactly as many entries as there are entries in Columns
62
+ # exactly as many entries as there are entries in {Google::Spanner::V1::Mutation::Write#columns columns}
63
63
  # above. Sending multiple lists is equivalent to sending multiple
64
64
  # +Mutation+s, each containing one +values+ entry and repeating
65
- # Table and Columns. Individual values in each list are
66
- # encoded as described Here.
65
+ # {Google::Spanner::V1::Mutation::Write#table table} and {Google::Spanner::V1::Mutation::Write#columns columns}. Individual values in each list are
66
+ # encoded as described {Google::Spanner::V1::TypeCode here}.
67
67
  class Write; end
68
68
 
69
- # Arguments to Delete operations.
69
+ # Arguments to {Google::Spanner::V1::Mutation#delete delete} operations.
70
70
  # @!attribute [rw] table
71
71
  # @return [String]
72
72
  # Required. The table whose rows will be deleted.
73
73
  # @!attribute [rw] key_set
74
74
  # @return [Google::Spanner::V1::KeySet]
75
- # Required. The primary keys of the rows within Table to delete.
75
+ # Required. The primary keys of the rows within {Google::Spanner::V1::Mutation::Delete#table table} to delete.
76
76
  class Delete; end
77
77
  end
78
78
  end
@@ -15,15 +15,15 @@
15
15
  module Google
16
16
  module Spanner
17
17
  module V1
18
- # Node information for nodes appearing in a QueryPlan#plan_nodes.
18
+ # Node information for nodes appearing in a {Google::Spanner::V1::QueryPlan#plan_nodes QueryPlan#plan_nodes}.
19
19
  # @!attribute [rw] index
20
20
  # @return [Integer]
21
- # The +PlanNode+'s index in Node list.
21
+ # The +PlanNode+'s index in {Google::Spanner::V1::QueryPlan#plan_nodes node list}.
22
22
  # @!attribute [rw] kind
23
23
  # @return [Google::Spanner::V1::PlanNode::Kind]
24
24
  # Used to determine the type of node. May be needed for visualizing
25
25
  # different kinds of nodes differently. For example, If the node is a
26
- # SCALAR node, it will have a condensed representation
26
+ # {Google::Spanner::V1::PlanNode::Kind::SCALAR SCALAR} node, it will have a condensed representation
27
27
  # which can be used to directly embed a description of the node in its
28
28
  # parent.
29
29
  # @!attribute [rw] display_name
@@ -34,7 +34,7 @@ module Google
34
34
  # List of child node +index+es and their relationship to this parent.
35
35
  # @!attribute [rw] short_representation
36
36
  # @return [Google::Spanner::V1::PlanNode::ShortRepresentation]
37
- # Condensed representation for SCALAR nodes.
37
+ # Condensed representation for {Google::Spanner::V1::PlanNode::Kind::SCALAR SCALAR} nodes.
38
38
  # @!attribute [rw] metadata
39
39
  # @return [Google::Protobuf::Struct]
40
40
  # Attributes relevant to the node contained in a group of key-value pairs.
@@ -53,7 +53,7 @@ module Google
53
53
  # execution etc.
54
54
  class PlanNode
55
55
  # Metadata associated with a parent-child relationship appearing in a
56
- # PlanNode.
56
+ # {Google::Spanner::V1::PlanNode PlanNode}.
57
57
  # @!attribute [rw] child_index
58
58
  # @return [Integer]
59
59
  # The node to which the link points.
@@ -65,7 +65,7 @@ module Google
65
65
  # with the output variable.
66
66
  # @!attribute [rw] variable
67
67
  # @return [String]
68
- # Only present if the child node is SCALAR and corresponds
68
+ # Only present if the child node is {Google::Spanner::V1::PlanNode::Kind::SCALAR SCALAR} and corresponds
69
69
  # to an output variable of the parent node. The field carries the name of
70
70
  # the output variable.
71
71
  # For example, a +TableScan+ operator that reads rows from a table will
@@ -76,7 +76,7 @@ module Google
76
76
  class ChildLink; end
77
77
 
78
78
  # Condensed representation of a node and its subtree. Only present for
79
- # +SCALAR+ PlanNode(s).
79
+ # +SCALAR+ {Google::Spanner::V1::PlanNode PlanNode(s)}.
80
80
  # @!attribute [rw] description
81
81
  # @return [String]
82
82
  # A string representation of the expression subtree rooted at this node.
@@ -89,7 +89,7 @@ module Google
89
89
  # this node.
90
90
  class ShortRepresentation; end
91
91
 
92
- # The kind of PlanNode. Distinguishes between the two different kinds of
92
+ # The kind of {Google::Spanner::V1::PlanNode PlanNode}. Distinguishes between the two different kinds of
93
93
  # nodes that can appear in a query plan.
94
94
  module Kind
95
95
  # Not specified.
@@ -112,7 +112,7 @@ module Google
112
112
  # @!attribute [rw] plan_nodes
113
113
  # @return [Array<Google::Spanner::V1::PlanNode>]
114
114
  # The nodes in the query plan. Plan nodes are returned in pre-order starting
115
- # with the plan root. Each PlanNode's +id+ corresponds to its index in
115
+ # with the plan root. Each {Google::Spanner::V1::PlanNode PlanNode}'s +id+ corresponds to its index in
116
116
  # +plan_nodes+.
117
117
  class QueryPlan; end
118
118
  end