From 132254fa537dfece87f3b836c51ed5248c230db4 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Tue, 1 Oct 2024 09:43:38 -0700 Subject: [PATCH] feat: add INTERVAL API (#7712) PiperOrigin-RevId: 680405503 Source-Link: https://github.com/googleapis/googleapis/commit/2c9fb377810d80ef2a14159229a68cdeab26351e Source-Link: https://github.com/googleapis/googleapis-gen/commit/317c7d1b1b801fe663f87bfd0bae54fd6526de87 Copy-Tag: eyJwIjoiU3Bhbm5lci8uT3dsQm90LnlhbWwiLCJoIjoiMzE3YzdkMWIxYjgwMWZlNjYzZjg3YmZkMGJhZTU0ZmQ2NTI2ZGU4NyJ9 feat: add new QueryMode enum values (WITH_STATS, WITH_PLAN_AND_STATS) docs: update comment for PROFILE QueryMode PiperOrigin-RevId: 680628448 Source-Link: https://github.com/googleapis/googleapis/commit/72a51519aec11b9ee28842b4a58ba4a4a82bc2e5 Source-Link: https://github.com/googleapis/googleapis-gen/commit/146c3e8da87738804709b7f3d264a8e33ae38d71 Copy-Tag: eyJwIjoiU3Bhbm5lci8uT3dsQm90LnlhbWwiLCJoIjoiMTQ2YzNlOGRhODc3Mzg4MDQ3MDliN2YzZDI2NGE4ZTMzYWUzOGQ3MSJ9 --- Spanner/metadata/V1/Spanner.php | Bin 11701 -> 11742 bytes Spanner/metadata/V1/Type.php | Bin 1501 -> 1515 bytes .../src/V1/ExecuteSqlRequest/QueryMode.php | 22 +++- Spanner/src/V1/StructType.php | 27 ++--- Spanner/src/V1/Type.php | 96 ++++++++++-------- Spanner/src/V1/TypeAnnotationCode.php | 21 ++-- Spanner/src/V1/TypeCode.php | 23 +++-- 7 files changed, 118 insertions(+), 71 deletions(-) diff --git a/Spanner/metadata/V1/Spanner.php b/Spanner/metadata/V1/Spanner.php index c5904d92a6e986818242f4f20afd005295b8d52f..fc4f6b042fe2b4b236ce5512d20ca6619dfaaa4f 100644 GIT binary patch delta 74 zcmdlQeJ^^01uNsl&6cdUI2k`|7U7p-W(=RKFQlg_#K*-I?iu0{9~|Ns5-h+hB+exa W<_GvV`o%l?xj-dYHpdD@NCN;r$rOqJ delta 46 zcmcZ?y)}A+1uNr<&6cdUI2n&`7U7p-X4IRkFQmt+w19<6Y_gt+*klcUtIfBCn56+= C0u49- diff --git a/Spanner/metadata/V1/Type.php b/Spanner/metadata/V1/Type.php index c024bfdf43aab9259f2e23e0981ca62f23d62c77..c5f753723320ba0517a5981065c346156a688a6b 100644 GIT binary patch delta 39 vcmcc1{hE6L6XU|oj7;ko8Lv*>zPROFILE = 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)