diff --git a/google/cloud/spanner_v1/types/result_set.py b/google/cloud/spanner_v1/types/result_set.py index 68ff3700c5..2990a015b5 100644 --- a/google/cloud/spanner_v1/types/result_set.py +++ b/google/cloud/spanner_v1/types/result_set.py @@ -238,6 +238,20 @@ class ResultSetMetadata(proto.Message): If the read or SQL query began a transaction as a side-effect, the information about the new transaction is yielded here. + undeclared_parameters (google.cloud.spanner_v1.types.StructType): + A SQL query can be parameterized. In PLAN mode, these + parameters can be undeclared. This indicates the field names + and types for those undeclared parameters in the SQL query. + For example, a SQL query like + ``"SELECT * FROM Users where UserId = @userId and UserName = @userName "`` + could return a ``undeclared_parameters`` value like: + + :: + + "fields": [ + { "name": "UserId", "type": { "code": "INT64" } }, + { "name": "UserName", "type": { "code": "STRING" } }, + ] """ row_type = proto.Field( @@ -250,6 +264,11 @@ class ResultSetMetadata(proto.Message): number=2, message=gs_transaction.Transaction, ) + undeclared_parameters = proto.Field( + proto.MESSAGE, + number=3, + message=gs_type.StructType, + ) class ResultSetStats(proto.Message):