Skip to content

Commit 0aa4cad

Browse files
feat: Update result_set.proto to return undeclared parameters in ExecuteSql 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 <[email protected]>
1 parent 30a0666 commit 0aa4cad

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

google/cloud/spanner_v1/types/result_set.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,20 @@ class ResultSetMetadata(proto.Message):
238238
If the read or SQL query began a transaction
239239
as a side-effect, the information about the new
240240
transaction is yielded here.
241+
undeclared_parameters (google.cloud.spanner_v1.types.StructType):
242+
A SQL query can be parameterized. In PLAN mode, these
243+
parameters can be undeclared. This indicates the field names
244+
and types for those undeclared parameters in the SQL query.
245+
For example, a SQL query like
246+
``"SELECT * FROM Users where UserId = @userId and UserName = @userName "``
247+
could return a ``undeclared_parameters`` value like:
248+
249+
::
250+
251+
"fields": [
252+
{ "name": "UserId", "type": { "code": "INT64" } },
253+
{ "name": "UserName", "type": { "code": "STRING" } },
254+
]
241255
"""
242256

243257
row_type = proto.Field(
@@ -250,6 +264,11 @@ class ResultSetMetadata(proto.Message):
250264
number=2,
251265
message=gs_transaction.Transaction,
252266
)
267+
undeclared_parameters = proto.Field(
268+
proto.MESSAGE,
269+
number=3,
270+
message=gs_type.StructType,
271+
)
253272

254273

255274
class ResultSetStats(proto.Message):

0 commit comments

Comments
 (0)