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.



1168
1169
1170
# File 'lib/google/apis/spanner_v1/classes.rb', line 1168

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)


1148
1149
1150
# File 'lib/google/apis/spanner_v1/classes.rb', line 1148

def is_primary_key
  @is_primary_key
end

#nameString

Name of the column. Corresponds to the JSON property name

Returns:

  • (String)


1154
1155
1156
# File 'lib/google/apis/spanner_v1/classes.rb', line 1154

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)


1160
1161
1162
# File 'lib/google/apis/spanner_v1/classes.rb', line 1160

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



1166
1167
1168
# File 'lib/google/apis/spanner_v1/classes.rb', line 1166

def type
  @type
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



1173
1174
1175
1176
1177
1178
# File 'lib/google/apis/spanner_v1/classes.rb', line 1173

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