Class: Google::Cloud::Spanner::V1::KeyRecipe

Inherits:
Object
  • Object
show all
Extended by:
Protobuf::MessageExts::ClassMethods
Includes:
Protobuf::MessageExts
Defined in:
proto_docs/google/spanner/v1/location.rb

Overview

A KeyRecipe provides the metadata required to translate reads, mutations, and queries into a byte array in "sortable string format" (ssformat)that can be used with Ranges to route requests. Note that the client must tolerate KeyRecipes that appear to be invalid, since the KeyRecipe format may change over time. Requests with invalid KeyRecipes should be routed to a default server.

Defined Under Namespace

Classes: Part

Instance Attribute Summary collapse

Instance Attribute Details

#index_name::String

Returns An index name, matching the name from the database schema.

Note: The following fields are mutually exclusive: index_name, table_name, operation_uid. If a field in that set is populated, all other fields in the set will automatically be cleared.

Returns:

  • (::String)

    An index name, matching the name from the database schema.

    Note: The following fields are mutually exclusive: index_name, table_name, operation_uid. If a field in that set is populated, all other fields in the set will automatically be cleared.



200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
# File 'proto_docs/google/spanner/v1/location.rb', line 200

class KeyRecipe
  include ::Google::Protobuf::MessageExts
  extend ::Google::Protobuf::MessageExts::ClassMethods

  # An ssformat key is composed of a sequence of tag numbers and key column
  # values. `Part` represents a single tag or key column value.
  # @!attribute [rw] tag
  #   @return [::Integer]
  #     If non-zero, `tag` is the only field present in this `Part`. The part
  #     is encoded by appending `tag` to the ssformat key.
  # @!attribute [rw] order
  #   @return [::Google::Cloud::Spanner::V1::KeyRecipe::Part::Order]
  #     Whether the key column is sorted ascending or descending. Only present
  #     if `tag` is zero.
  # @!attribute [rw] null_order
  #   @return [::Google::Cloud::Spanner::V1::KeyRecipe::Part::NullOrder]
  #     How NULLs are represented in the encoded key part. Only present if `tag`
  #     is zero.
  # @!attribute [rw] type
  #   @return [::Google::Cloud::Spanner::V1::Type]
  #     The type of the key part. Only present if `tag` is zero.
  # @!attribute [rw] identifier
  #   @return [::String]
  #     `identifier` is the name of the column or query parameter.
  #
  #     Note: The following fields are mutually exclusive: `identifier`, `value`, `random`. If a field in that set is populated, all other fields in the set will automatically be cleared.
  # @!attribute [rw] value
  #   @return [::Google::Protobuf::Value]
  #     The constant value of the key part.
  #     It is present when query uses a constant as a part of the key.
  #
  #     Note: The following fields are mutually exclusive: `value`, `identifier`, `random`. If a field in that set is populated, all other fields in the set will automatically be cleared.
  # @!attribute [rw] random
  #   @return [::Boolean]
  #     If true, the client is responsible to fill in the value randomly.
  #     It's relevant only for the INT64 type.
  #
  #     Note: The following fields are mutually exclusive: `random`, `identifier`, `value`. If a field in that set is populated, all other fields in the set will automatically be cleared.
  # @!attribute [rw] struct_identifiers
  #   @return [::Array<::Integer>]
  #     It is a repeated field to support fetching key columns from nested
  #     structs, such as `STRUCT` query parameters.
  class Part
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # The remaining fields encode column values.
    module Order
      # Default value, equivalent to `ASCENDING`.
      ORDER_UNSPECIFIED = 0

      # The key is ascending - corresponds to `ASC` in the schema definition.
      ASCENDING = 1

      # The key is descending - corresponds to `DESC` in the schema definition.
      DESCENDING = 2
    end

    # The null order of the key column. This dictates where NULL values sort
    # in the sorted order. Note that columns which are `NOT NULL` can have a
    # special encoding.
    module NullOrder
      # Default value. This value is unused.
      NULL_ORDER_UNSPECIFIED = 0

      # NULL values sort before any non-NULL values.
      NULLS_FIRST = 1

      # NULL values sort after any non-NULL values.
      NULLS_LAST = 2

      # The column does not support NULL values.
      NOT_NULL = 3
    end
  end
end

#operation_uid::Integer

Returns The UID of a query, matching the UID from RoutingHint.

Note: The following fields are mutually exclusive: operation_uid, table_name, index_name. If a field in that set is populated, all other fields in the set will automatically be cleared.

Returns:

  • (::Integer)

    The UID of a query, matching the UID from RoutingHint.

    Note: The following fields are mutually exclusive: operation_uid, table_name, index_name. If a field in that set is populated, all other fields in the set will automatically be cleared.



200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
# File 'proto_docs/google/spanner/v1/location.rb', line 200

class KeyRecipe
  include ::Google::Protobuf::MessageExts
  extend ::Google::Protobuf::MessageExts::ClassMethods

  # An ssformat key is composed of a sequence of tag numbers and key column
  # values. `Part` represents a single tag or key column value.
  # @!attribute [rw] tag
  #   @return [::Integer]
  #     If non-zero, `tag` is the only field present in this `Part`. The part
  #     is encoded by appending `tag` to the ssformat key.
  # @!attribute [rw] order
  #   @return [::Google::Cloud::Spanner::V1::KeyRecipe::Part::Order]
  #     Whether the key column is sorted ascending or descending. Only present
  #     if `tag` is zero.
  # @!attribute [rw] null_order
  #   @return [::Google::Cloud::Spanner::V1::KeyRecipe::Part::NullOrder]
  #     How NULLs are represented in the encoded key part. Only present if `tag`
  #     is zero.
  # @!attribute [rw] type
  #   @return [::Google::Cloud::Spanner::V1::Type]
  #     The type of the key part. Only present if `tag` is zero.
  # @!attribute [rw] identifier
  #   @return [::String]
  #     `identifier` is the name of the column or query parameter.
  #
  #     Note: The following fields are mutually exclusive: `identifier`, `value`, `random`. If a field in that set is populated, all other fields in the set will automatically be cleared.
  # @!attribute [rw] value
  #   @return [::Google::Protobuf::Value]
  #     The constant value of the key part.
  #     It is present when query uses a constant as a part of the key.
  #
  #     Note: The following fields are mutually exclusive: `value`, `identifier`, `random`. If a field in that set is populated, all other fields in the set will automatically be cleared.
  # @!attribute [rw] random
  #   @return [::Boolean]
  #     If true, the client is responsible to fill in the value randomly.
  #     It's relevant only for the INT64 type.
  #
  #     Note: The following fields are mutually exclusive: `random`, `identifier`, `value`. If a field in that set is populated, all other fields in the set will automatically be cleared.
  # @!attribute [rw] struct_identifiers
  #   @return [::Array<::Integer>]
  #     It is a repeated field to support fetching key columns from nested
  #     structs, such as `STRUCT` query parameters.
  class Part
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # The remaining fields encode column values.
    module Order
      # Default value, equivalent to `ASCENDING`.
      ORDER_UNSPECIFIED = 0

      # The key is ascending - corresponds to `ASC` in the schema definition.
      ASCENDING = 1

      # The key is descending - corresponds to `DESC` in the schema definition.
      DESCENDING = 2
    end

    # The null order of the key column. This dictates where NULL values sort
    # in the sorted order. Note that columns which are `NOT NULL` can have a
    # special encoding.
    module NullOrder
      # Default value. This value is unused.
      NULL_ORDER_UNSPECIFIED = 0

      # NULL values sort before any non-NULL values.
      NULLS_FIRST = 1

      # NULL values sort after any non-NULL values.
      NULLS_LAST = 2

      # The column does not support NULL values.
      NOT_NULL = 3
    end
  end
end

#part::Array<::Google::Cloud::Spanner::V1::KeyRecipe::Part>

Returns Parts are in the order they should appear in the encoded key.

Returns:



200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
# File 'proto_docs/google/spanner/v1/location.rb', line 200

class KeyRecipe
  include ::Google::Protobuf::MessageExts
  extend ::Google::Protobuf::MessageExts::ClassMethods

  # An ssformat key is composed of a sequence of tag numbers and key column
  # values. `Part` represents a single tag or key column value.
  # @!attribute [rw] tag
  #   @return [::Integer]
  #     If non-zero, `tag` is the only field present in this `Part`. The part
  #     is encoded by appending `tag` to the ssformat key.
  # @!attribute [rw] order
  #   @return [::Google::Cloud::Spanner::V1::KeyRecipe::Part::Order]
  #     Whether the key column is sorted ascending or descending. Only present
  #     if `tag` is zero.
  # @!attribute [rw] null_order
  #   @return [::Google::Cloud::Spanner::V1::KeyRecipe::Part::NullOrder]
  #     How NULLs are represented in the encoded key part. Only present if `tag`
  #     is zero.
  # @!attribute [rw] type
  #   @return [::Google::Cloud::Spanner::V1::Type]
  #     The type of the key part. Only present if `tag` is zero.
  # @!attribute [rw] identifier
  #   @return [::String]
  #     `identifier` is the name of the column or query parameter.
  #
  #     Note: The following fields are mutually exclusive: `identifier`, `value`, `random`. If a field in that set is populated, all other fields in the set will automatically be cleared.
  # @!attribute [rw] value
  #   @return [::Google::Protobuf::Value]
  #     The constant value of the key part.
  #     It is present when query uses a constant as a part of the key.
  #
  #     Note: The following fields are mutually exclusive: `value`, `identifier`, `random`. If a field in that set is populated, all other fields in the set will automatically be cleared.
  # @!attribute [rw] random
  #   @return [::Boolean]
  #     If true, the client is responsible to fill in the value randomly.
  #     It's relevant only for the INT64 type.
  #
  #     Note: The following fields are mutually exclusive: `random`, `identifier`, `value`. If a field in that set is populated, all other fields in the set will automatically be cleared.
  # @!attribute [rw] struct_identifiers
  #   @return [::Array<::Integer>]
  #     It is a repeated field to support fetching key columns from nested
  #     structs, such as `STRUCT` query parameters.
  class Part
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # The remaining fields encode column values.
    module Order
      # Default value, equivalent to `ASCENDING`.
      ORDER_UNSPECIFIED = 0

      # The key is ascending - corresponds to `ASC` in the schema definition.
      ASCENDING = 1

      # The key is descending - corresponds to `DESC` in the schema definition.
      DESCENDING = 2
    end

    # The null order of the key column. This dictates where NULL values sort
    # in the sorted order. Note that columns which are `NOT NULL` can have a
    # special encoding.
    module NullOrder
      # Default value. This value is unused.
      NULL_ORDER_UNSPECIFIED = 0

      # NULL values sort before any non-NULL values.
      NULLS_FIRST = 1

      # NULL values sort after any non-NULL values.
      NULLS_LAST = 2

      # The column does not support NULL values.
      NOT_NULL = 3
    end
  end
end

#table_name::String

Returns A table name, matching the name from the database schema.

Note: The following fields are mutually exclusive: table_name, index_name, operation_uid. If a field in that set is populated, all other fields in the set will automatically be cleared.

Returns:

  • (::String)

    A table name, matching the name from the database schema.

    Note: The following fields are mutually exclusive: table_name, index_name, operation_uid. If a field in that set is populated, all other fields in the set will automatically be cleared.



200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
# File 'proto_docs/google/spanner/v1/location.rb', line 200

class KeyRecipe
  include ::Google::Protobuf::MessageExts
  extend ::Google::Protobuf::MessageExts::ClassMethods

  # An ssformat key is composed of a sequence of tag numbers and key column
  # values. `Part` represents a single tag or key column value.
  # @!attribute [rw] tag
  #   @return [::Integer]
  #     If non-zero, `tag` is the only field present in this `Part`. The part
  #     is encoded by appending `tag` to the ssformat key.
  # @!attribute [rw] order
  #   @return [::Google::Cloud::Spanner::V1::KeyRecipe::Part::Order]
  #     Whether the key column is sorted ascending or descending. Only present
  #     if `tag` is zero.
  # @!attribute [rw] null_order
  #   @return [::Google::Cloud::Spanner::V1::KeyRecipe::Part::NullOrder]
  #     How NULLs are represented in the encoded key part. Only present if `tag`
  #     is zero.
  # @!attribute [rw] type
  #   @return [::Google::Cloud::Spanner::V1::Type]
  #     The type of the key part. Only present if `tag` is zero.
  # @!attribute [rw] identifier
  #   @return [::String]
  #     `identifier` is the name of the column or query parameter.
  #
  #     Note: The following fields are mutually exclusive: `identifier`, `value`, `random`. If a field in that set is populated, all other fields in the set will automatically be cleared.
  # @!attribute [rw] value
  #   @return [::Google::Protobuf::Value]
  #     The constant value of the key part.
  #     It is present when query uses a constant as a part of the key.
  #
  #     Note: The following fields are mutually exclusive: `value`, `identifier`, `random`. If a field in that set is populated, all other fields in the set will automatically be cleared.
  # @!attribute [rw] random
  #   @return [::Boolean]
  #     If true, the client is responsible to fill in the value randomly.
  #     It's relevant only for the INT64 type.
  #
  #     Note: The following fields are mutually exclusive: `random`, `identifier`, `value`. If a field in that set is populated, all other fields in the set will automatically be cleared.
  # @!attribute [rw] struct_identifiers
  #   @return [::Array<::Integer>]
  #     It is a repeated field to support fetching key columns from nested
  #     structs, such as `STRUCT` query parameters.
  class Part
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # The remaining fields encode column values.
    module Order
      # Default value, equivalent to `ASCENDING`.
      ORDER_UNSPECIFIED = 0

      # The key is ascending - corresponds to `ASC` in the schema definition.
      ASCENDING = 1

      # The key is descending - corresponds to `DESC` in the schema definition.
      DESCENDING = 2
    end

    # The null order of the key column. This dictates where NULL values sort
    # in the sorted order. Note that columns which are `NOT NULL` can have a
    # special encoding.
    module NullOrder
      # Default value. This value is unused.
      NULL_ORDER_UNSPECIFIED = 0

      # NULL values sort before any non-NULL values.
      NULLS_FIRST = 1

      # NULL values sort after any non-NULL values.
      NULLS_LAST = 2

      # The column does not support NULL values.
      NOT_NULL = 3
    end
  end
end