Class: Google::Apis::SpannerV1::ColumnMetadata

Inherits:
Object
  • Object
show all
Includes:
Core::Hashable, Core::JsonObjectSupport
Defined in:
lib/google/apis/spanner_v1/classes.rb,
lib/google/apis/spanner_v1/representations.rb,
lib/google/apis/spanner_v1/representations.rb

Overview

Metadata for a column.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ ColumnMetadata

Returns a new instance of ColumnMetadata.



1133
1134
1135
# File 'lib/google/apis/spanner_v1/classes.rb', line 1133

def initialize(**args)
   update!(**args)
end

Instance Attribute Details

#is_primary_keyBoolean Also known as: is_primary_key?

Indicates whether the column is a primary key column. Corresponds to the JSON property isPrimaryKey

Returns:

  • (Boolean)


1113
1114
1115
# File 'lib/google/apis/spanner_v1/classes.rb', line 1113

def is_primary_key
  @is_primary_key
end

#nameString

Name of the column. Corresponds to the JSON property name

Returns:

  • (String)


1119
1120
1121
# File 'lib/google/apis/spanner_v1/classes.rb', line 1119

def name
  @name
end

#ordinal_positionFixnum

Ordinal position of the column based on the original table definition in the schema starting with a value of 1. Corresponds to the JSON property ordinalPosition

Returns:

  • (Fixnum)


1125
1126
1127
# File 'lib/google/apis/spanner_v1/classes.rb', line 1125

def ordinal_position
  @ordinal_position
end

#typeGoogle::Apis::SpannerV1::Type

Type indicates the type of a Cloud Spanner value, as might be stored in a table cell or returned from an SQL query. Corresponds to the JSON property type



1131
1132
1133
# File 'lib/google/apis/spanner_v1/classes.rb', line 1131

def type
  @type
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



1138
1139
1140
1141
1142
1143
# File 'lib/google/apis/spanner_v1/classes.rb', line 1138

def update!(**args)
  @is_primary_key = args[:is_primary_key] if args.key?(:is_primary_key)
  @name = args[:name] if args.key?(:name)
  @ordinal_position = args[:ordinal_position] if args.key?(:ordinal_position)
  @type = args[:type] if args.key?(:type)
end