Skip to content

Commit

Permalink
feat: Update result_set.proto to return undeclared parameters in Exec…
Browse files Browse the repository at this point in the history
…uteSql API (#841)

* feat: Update result_set.proto to return undeclared parameters in ExecuteSql API

PiperOrigin-RevId: 480025979

Source-Link: googleapis/googleapis@cb6fbe8

Source-Link: googleapis/googleapis-gen@bf166b8
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiYmYxNjZiODlkMmE2YWEzNTEwMzc0Mzg3YWYwZjQ1ZTQ4MjhkZWEwMyJ9

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
Co-authored-by: Anthonios Partheniou <partheniou@google.com>
  • Loading branch information
3 people authored Oct 16, 2022
1 parent 30a0666 commit 0aa4cad
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions google/cloud/spanner_v1/types/result_set.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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):
Expand Down

0 comments on commit 0aa4cad

Please sign in to comment.