diff --git a/Spanner/metadata/V1/Spanner.php b/Spanner/metadata/V1/Spanner.php index c5904d92a6e9..fc4f6b042fe2 100644 Binary files a/Spanner/metadata/V1/Spanner.php and b/Spanner/metadata/V1/Spanner.php differ diff --git a/Spanner/metadata/V1/Type.php b/Spanner/metadata/V1/Type.php index c024bfdf43aa..c5f753723320 100644 Binary files a/Spanner/metadata/V1/Type.php and b/Spanner/metadata/V1/Type.php differ diff --git a/Spanner/src/V1/ExecuteSqlRequest/QueryMode.php b/Spanner/src/V1/ExecuteSqlRequest/QueryMode.php index c1d1be3f1fa5..43c3ed48f97b 100644 --- a/Spanner/src/V1/ExecuteSqlRequest/QueryMode.php +++ b/Spanner/src/V1/ExecuteSqlRequest/QueryMode.php @@ -27,17 +27,35 @@ class QueryMode */ const PLAN = 1; /** - * This mode returns both the query plan and the execution statistics along - * with the results. + * This mode returns the query plan, overall execution statistics, + * operator level execution statistics along with the results. This has a + * performance overhead compared to the other modes. It is not recommended + * to use this mode for production traffic. * * Generated from protobuf enum PROFILE = 2; */ const PROFILE = 2; + /** + * This mode returns the overall (but not operator-level) execution + * statistics along with the results. + * + * Generated from protobuf enum WITH_STATS = 3; + */ + const WITH_STATS = 3; + /** + * This mode returns the query plan, overall (but not operator-level) + * execution statistics along with the results. + * + * Generated from protobuf enum WITH_PLAN_AND_STATS = 4; + */ + const WITH_PLAN_AND_STATS = 4; private static $valueToName = [ self::NORMAL => 'NORMAL', self::PLAN => 'PLAN', self::PROFILE => 'PROFILE', + self::WITH_STATS => 'WITH_STATS', + self::WITH_PLAN_AND_STATS => 'WITH_PLAN_AND_STATS', ]; public static function name($value) diff --git a/Spanner/src/V1/StructType.php b/Spanner/src/V1/StructType.php index fd5d1b31fb0e..a67da0c0d598 100644 --- a/Spanner/src/V1/StructType.php +++ b/Spanner/src/V1/StructType.php @@ -9,7 +9,8 @@ use Google\Protobuf\Internal\GPBUtil; /** - * `StructType` defines the fields of a [STRUCT][google.spanner.v1.TypeCode.STRUCT] type. + * `StructType` defines the fields of a + * [STRUCT][google.spanner.v1.TypeCode.STRUCT] type. * * Generated from protobuf message google.spanner.v1.StructType */ @@ -19,9 +20,9 @@ class StructType extends \Google\Protobuf\Internal\Message * The list of fields that make up this struct. Order is * significant, because values of this struct type are represented as * lists, where the order of field values matches the order of - * fields in the [StructType][google.spanner.v1.StructType]. In turn, the order of fields - * matches the order of columns in a read request, or the order of - * fields in the `SELECT` clause of a query. + * fields in the [StructType][google.spanner.v1.StructType]. In turn, the + * order of fields matches the order of columns in a read request, or the + * order of fields in the `SELECT` clause of a query. * * Generated from protobuf field repeated .google.spanner.v1.StructType.Field fields = 1; */ @@ -37,9 +38,9 @@ class StructType extends \Google\Protobuf\Internal\Message * The list of fields that make up this struct. Order is * significant, because values of this struct type are represented as * lists, where the order of field values matches the order of - * fields in the [StructType][google.spanner.v1.StructType]. In turn, the order of fields - * matches the order of columns in a read request, or the order of - * fields in the `SELECT` clause of a query. + * fields in the [StructType][google.spanner.v1.StructType]. In turn, the + * order of fields matches the order of columns in a read request, or the + * order of fields in the `SELECT` clause of a query. * } */ public function __construct($data = NULL) { @@ -51,9 +52,9 @@ public function __construct($data = NULL) { * The list of fields that make up this struct. Order is * significant, because values of this struct type are represented as * lists, where the order of field values matches the order of - * fields in the [StructType][google.spanner.v1.StructType]. In turn, the order of fields - * matches the order of columns in a read request, or the order of - * fields in the `SELECT` clause of a query. + * fields in the [StructType][google.spanner.v1.StructType]. In turn, the + * order of fields matches the order of columns in a read request, or the + * order of fields in the `SELECT` clause of a query. * * Generated from protobuf field repeated .google.spanner.v1.StructType.Field fields = 1; * @return \Google\Protobuf\Internal\RepeatedField @@ -67,9 +68,9 @@ public function getFields() * The list of fields that make up this struct. Order is * significant, because values of this struct type are represented as * lists, where the order of field values matches the order of - * fields in the [StructType][google.spanner.v1.StructType]. In turn, the order of fields - * matches the order of columns in a read request, or the order of - * fields in the `SELECT` clause of a query. + * fields in the [StructType][google.spanner.v1.StructType]. In turn, the + * order of fields matches the order of columns in a read request, or the + * order of fields in the `SELECT` clause of a query. * * Generated from protobuf field repeated .google.spanner.v1.StructType.Field fields = 1; * @param array<\Google\Cloud\Spanner\V1\StructType\Field>|\Google\Protobuf\Internal\RepeatedField $var diff --git a/Spanner/src/V1/Type.php b/Spanner/src/V1/Type.php index 1a7c2f3a2f21..843c86552523 100644 --- a/Spanner/src/V1/Type.php +++ b/Spanner/src/V1/Type.php @@ -23,26 +23,30 @@ class Type extends \Google\Protobuf\Internal\Message */ private $code = 0; /** - * If [code][google.spanner.v1.Type.code] == [ARRAY][google.spanner.v1.TypeCode.ARRAY], then `array_element_type` - * is the type of the array elements. + * If [code][google.spanner.v1.Type.code] == + * [ARRAY][google.spanner.v1.TypeCode.ARRAY], then `array_element_type` is the + * type of the array elements. * * Generated from protobuf field .google.spanner.v1.Type array_element_type = 2; */ private $array_element_type = null; /** - * If [code][google.spanner.v1.Type.code] == [STRUCT][google.spanner.v1.TypeCode.STRUCT], then `struct_type` - * provides type information for the struct's fields. + * If [code][google.spanner.v1.Type.code] == + * [STRUCT][google.spanner.v1.TypeCode.STRUCT], then `struct_type` provides + * type information for the struct's fields. * * Generated from protobuf field .google.spanner.v1.StructType struct_type = 3; */ private $struct_type = null; /** - * The [TypeAnnotationCode][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 single [TypeCode][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. + * The [TypeAnnotationCode][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 single [TypeCode][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. * * Generated from protobuf field .google.spanner.v1.TypeAnnotationCode type_annotation = 4; */ @@ -67,18 +71,22 @@ class Type extends \Google\Protobuf\Internal\Message * @type int $code * Required. The [TypeCode][google.spanner.v1.TypeCode] for this type. * @type \Google\Cloud\Spanner\V1\Type $array_element_type - * If [code][google.spanner.v1.Type.code] == [ARRAY][google.spanner.v1.TypeCode.ARRAY], then `array_element_type` - * is the type of the array elements. + * If [code][google.spanner.v1.Type.code] == + * [ARRAY][google.spanner.v1.TypeCode.ARRAY], then `array_element_type` is the + * type of the array elements. * @type \Google\Cloud\Spanner\V1\StructType $struct_type - * If [code][google.spanner.v1.Type.code] == [STRUCT][google.spanner.v1.TypeCode.STRUCT], then `struct_type` - * provides type information for the struct's fields. + * If [code][google.spanner.v1.Type.code] == + * [STRUCT][google.spanner.v1.TypeCode.STRUCT], then `struct_type` provides + * type information for the struct's fields. * @type int $type_annotation - * The [TypeAnnotationCode][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 single [TypeCode][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. + * The [TypeAnnotationCode][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 single [TypeCode][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. * @type string $proto_type_fqn * If [code][google.spanner.v1.Type.code] == * [PROTO][google.spanner.v1.TypeCode.PROTO] or @@ -119,8 +127,9 @@ public function setCode($var) } /** - * If [code][google.spanner.v1.Type.code] == [ARRAY][google.spanner.v1.TypeCode.ARRAY], then `array_element_type` - * is the type of the array elements. + * If [code][google.spanner.v1.Type.code] == + * [ARRAY][google.spanner.v1.TypeCode.ARRAY], then `array_element_type` is the + * type of the array elements. * * Generated from protobuf field .google.spanner.v1.Type array_element_type = 2; * @return \Google\Cloud\Spanner\V1\Type|null @@ -141,8 +150,9 @@ public function clearArrayElementType() } /** - * If [code][google.spanner.v1.Type.code] == [ARRAY][google.spanner.v1.TypeCode.ARRAY], then `array_element_type` - * is the type of the array elements. + * If [code][google.spanner.v1.Type.code] == + * [ARRAY][google.spanner.v1.TypeCode.ARRAY], then `array_element_type` is the + * type of the array elements. * * Generated from protobuf field .google.spanner.v1.Type array_element_type = 2; * @param \Google\Cloud\Spanner\V1\Type $var @@ -157,8 +167,9 @@ public function setArrayElementType($var) } /** - * If [code][google.spanner.v1.Type.code] == [STRUCT][google.spanner.v1.TypeCode.STRUCT], then `struct_type` - * provides type information for the struct's fields. + * If [code][google.spanner.v1.Type.code] == + * [STRUCT][google.spanner.v1.TypeCode.STRUCT], then `struct_type` provides + * type information for the struct's fields. * * Generated from protobuf field .google.spanner.v1.StructType struct_type = 3; * @return \Google\Cloud\Spanner\V1\StructType|null @@ -179,8 +190,9 @@ public function clearStructType() } /** - * If [code][google.spanner.v1.Type.code] == [STRUCT][google.spanner.v1.TypeCode.STRUCT], then `struct_type` - * provides type information for the struct's fields. + * If [code][google.spanner.v1.Type.code] == + * [STRUCT][google.spanner.v1.TypeCode.STRUCT], then `struct_type` provides + * type information for the struct's fields. * * Generated from protobuf field .google.spanner.v1.StructType struct_type = 3; * @param \Google\Cloud\Spanner\V1\StructType $var @@ -195,12 +207,14 @@ public function setStructType($var) } /** - * The [TypeAnnotationCode][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 single [TypeCode][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. + * The [TypeAnnotationCode][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 single [TypeCode][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. * * Generated from protobuf field .google.spanner.v1.TypeAnnotationCode type_annotation = 4; * @return int @@ -211,12 +225,14 @@ public function getTypeAnnotation() } /** - * The [TypeAnnotationCode][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 single [TypeCode][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. + * The [TypeAnnotationCode][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 single [TypeCode][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. * * Generated from protobuf field .google.spanner.v1.TypeAnnotationCode type_annotation = 4; * @param int $var diff --git a/Spanner/src/V1/TypeAnnotationCode.php b/Spanner/src/V1/TypeAnnotationCode.php index 6575fb750544..5aa003011f3d 100644 --- a/Spanner/src/V1/TypeAnnotationCode.php +++ b/Spanner/src/V1/TypeAnnotationCode.php @@ -25,22 +25,23 @@ class TypeAnnotationCode const TYPE_ANNOTATION_CODE_UNSPECIFIED = 0; /** * PostgreSQL compatible NUMERIC type. This annotation needs to be applied to - * [Type][google.spanner.v1.Type] instances having [NUMERIC][google.spanner.v1.TypeCode.NUMERIC] - * type code to specify that values of this type should be treated as - * PostgreSQL NUMERIC values. Currently this annotation is always needed for - * [NUMERIC][google.spanner.v1.TypeCode.NUMERIC] when a client interacts with PostgreSQL-enabled - * Spanner databases. + * [Type][google.spanner.v1.Type] instances having + * [NUMERIC][google.spanner.v1.TypeCode.NUMERIC] type code to specify that + * values of this type should be treated as PostgreSQL NUMERIC values. + * Currently this annotation is always needed for + * [NUMERIC][google.spanner.v1.TypeCode.NUMERIC] when a client interacts with + * PostgreSQL-enabled Spanner databases. * * Generated from protobuf enum PG_NUMERIC = 2; */ const PG_NUMERIC = 2; /** * PostgreSQL compatible JSONB type. This annotation needs to be applied to - * [Type][google.spanner.v1.Type] instances having [JSON][google.spanner.v1.TypeCode.JSON] - * type code to specify that values of this type should be treated as - * PostgreSQL JSONB values. Currently this annotation is always needed for - * [JSON][google.spanner.v1.TypeCode.JSON] when a client interacts with PostgreSQL-enabled - * Spanner databases. + * [Type][google.spanner.v1.Type] instances having + * [JSON][google.spanner.v1.TypeCode.JSON] type code to specify that values of + * this type should be treated as PostgreSQL JSONB values. Currently this + * annotation is always needed for [JSON][google.spanner.v1.TypeCode.JSON] + * when a client interacts with PostgreSQL-enabled Spanner databases. * * Generated from protobuf enum PG_JSONB = 3; */ diff --git a/Spanner/src/V1/TypeCode.php b/Spanner/src/V1/TypeCode.php index 21c35fb44bd8..d3dd16b93303 100644 --- a/Spanner/src/V1/TypeCode.php +++ b/Spanner/src/V1/TypeCode.php @@ -98,13 +98,13 @@ class TypeCode const STRUCT = 9; /** * Encoded as `string`, in decimal format or scientific notation format. - *
Decimal format: - *
`[+-]Digits[.[Digits]]` or - *
`[+-][Digits].Digits` + * Decimal format: + * `[+-]Digits[.[Digits]]` or + * `[+-][Digits].Digits` * Scientific notation: - *
`[+-]Digits[.[Digits]][ExponentIndicator[+-]Digits]` or - *
`[+-][Digits].Digits[ExponentIndicator[+-]Digits]` - *
(ExponentIndicator is `"e"` or `"E"`) + * `[+-]Digits[.[Digits]][ExponentIndicator[+-]Digits]` or + * `[+-][Digits].Digits[ExponentIndicator[+-]Digits]` + * (ExponentIndicator is `"e"` or `"E"`) * * Generated from protobuf enum NUMERIC = 10; */ @@ -134,6 +134,16 @@ class TypeCode * Generated from protobuf enum ENUM = 14; */ const ENUM = 14; + /** + * Encoded as `string`, in `ISO8601` duration format - + * `P[n]Y[n]M[n]DT[n]H[n]M[n[.fraction]]S` + * where `n` is an integer. + * For example, `P1Y2M3DT4H5M6.5S` represents time duration of 1 year, 2 + * months, 3 days, 4 hours, 5 minutes, and 6.5 seconds. + * + * Generated from protobuf enum INTERVAL = 16; + */ + const INTERVAL = 16; private static $valueToName = [ self::TYPE_CODE_UNSPECIFIED => 'TYPE_CODE_UNSPECIFIED', @@ -151,6 +161,7 @@ class TypeCode self::JSON => 'JSON', self::PROTO => 'PROTO', self::ENUM => 'ENUM', + self::INTERVAL => 'INTERVAL', ]; public static function name($value)