Merging upstream version 9.0.3.
Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
parent
66ef36a209
commit
b1dc5c6faf
22 changed files with 742 additions and 223 deletions
|
@ -47,7 +47,8 @@ class Generator:
|
|||
The default is on the smaller end because the length only represents a segment and not the true
|
||||
line length.
|
||||
Default: 80
|
||||
annotations: Whether or not to show annotations in the SQL.
|
||||
annotations: Whether or not to show annotations in the SQL when `pretty` is True.
|
||||
Annotations can only be shown in pretty mode otherwise they may clobber resulting sql.
|
||||
Default: True
|
||||
"""
|
||||
|
||||
|
@ -280,7 +281,7 @@ class Generator:
|
|||
raise ValueError(f"Unsupported expression type {expression.__class__.__name__}")
|
||||
|
||||
def annotation_sql(self, expression):
|
||||
if self._annotations:
|
||||
if self._annotations and self.pretty:
|
||||
return f"{self.sql(expression, 'expression')} # {expression.name}"
|
||||
return self.sql(expression, "expression")
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue