Class Type (3.55.0)

Type(mapping=None,*,ignore_unknown_fields=False,**kwargs)

Type indicates the type of a Cloud Spanner value, as might bestored in a table cell or returned from an SQL query.

Attributes

NameDescription
codegoogle.cloud.spanner_v1.types.TypeCode
Required. TheTypeCode][google.spanner.v1.TypeCode] for this type.
array_element_typegoogle.cloud.spanner_v1.types.Type
Ifcode][google.spanner.v1.Type.code] ==ARRAY][google.spanner.v1.TypeCode.ARRAY], thenarray_element_type is the type of the array elements.
struct_typegoogle.cloud.spanner_v1.types.StructType
Ifcode][google.spanner.v1.Type.code] ==STRUCT][google.spanner.v1.TypeCode.STRUCT], thenstruct_type provides type information for the struct's fields.
type_annotationgoogle.cloud.spanner_v1.types.TypeAnnotationCode
TheTypeAnnotationCode][google.spanner.v1.TypeAnnotationCode] that disambiguates SQL type that Spanner will use to represent values of this type during query processing. This is necessary for some type codes because a singleTypeCode][google.spanner.v1.TypeCode] can be mapped to different SQL types depending on the SQL dialect.type_annotation][google.spanner.v1.Type.type_annotation] typically is not needed to process the content of a value (it doesn't affect serialization) and clients can ignore it on the read path.
proto_type_fqnstr
Ifcode][google.spanner.v1.Type.code] ==PROTO][google.spanner.v1.TypeCode.PROTO] orcode][google.spanner.v1.Type.code] ==ENUM][google.spanner.v1.TypeCode.ENUM], thenproto_type_fqn is the fully qualified name of the proto type representing the proto/enum definition.

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025-07-18 UTC.