New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for statement variants of prepared statement comands #5685
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
@dataclasses.dataclass(frozen=True) | ||
class SQLSource: | ||
chunks: list[str] | ||
param_index: dict[int, list[int]] | ||
translation_data: Optional[SQLSourceGeneratorTranslationData] = None |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've opened a PR that does a refactor of codegen, which will conflict with these changes.
The changes are in the same light (adding dataclasses as such), and should not be hard to update the these changes.
@@ -156,25 +165,30 @@ def ctes_to_source(cls, ctes: List[pgast.CommonTableExpr]) -> str: | |||
return ''.join(generator.result) | |||
|
|||
@classmethod | |||
def to_source_with_translation( | |||
def to_source_ex( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what's _ex
? Extended?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah. "extended" or "expert" (I'm not sure what the origin for Ex
was in WinAPI). Suggestions for a better name welcome.
This adds support for `PREPARE`, `EXECUTE` and `DEALLOCATE` at SQL level. There is a fair bit of cleanup as well, removing unnecessary duplication in the form of `sql_simple_query` as we translate client simple query requests to extended query requests anyway.
This adds support for `PREPARE`, `EXECUTE` and `DEALLOCATE` at SQL level. There is a fair bit of cleanup as well, removing unnecessary duplication in the form of `sql_simple_query` as we translate client simple query requests to extended query requests anyway.
This adds support for
PREPARE
,EXECUTE
andDEALLOCATE
at SQLlevel. There is a fair bit of cleanup as well, removing unnecessary
duplication in the form of
sql_simple_query
as we translate clientsimple query requests to extended query requests anyway.