Skip to content

Provide query read-only property on dbapi cursor#323

Merged
hashhar merged 3 commits intotrinodb:masterfrom
mdesmet:feat/sql_property
Feb 18, 2023
Merged

Provide query read-only property on dbapi cursor#323
hashhar merged 3 commits intotrinodb:masterfrom
mdesmet:feat/sql_property

Conversation

@mdesmet
Copy link
Contributor

@mdesmet mdesmet commented Jan 18, 2023

Description

Provide sql read-only property on dbapi cursor

Non-technical explanation

Release notes

( ) This is not user-visible or docs only and no release notes are required.
( ) Release notes are required, please propose a release note for me.
(x) Release notes are required, with the following suggested text:

* Provide executed SQL statement as a read-only property on dbapi's cursor

trino/client.py Outdated
return self._query_id

@property
def sql(self) -> Optional[str]:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps a better name is query, it will follow the convention as used in query_id. Psycopg follow this as well.

@mdesmet mdesmet changed the title Provide sql read-only property on dbapi cursor Provide query read-only property on dbapi cursor Jan 19, 2023
@mdesmet mdesmet self-assigned this Jan 19, 2023
Copy link
Member

@hovaesco hovaesco left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM % Please change a commit message to "Provide query read-only property on dbapi"

@hashhar
Copy link
Member

hashhar commented Feb 18, 2023

rebased

@hashhar
Copy link
Member

hashhar commented Feb 18, 2023

pre-commit failures would be fixed in #336

@hashhar hashhar merged commit fcdce94 into trinodb:master Feb 18, 2023
@hashhar hashhar mentioned this pull request Mar 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

3 participants