summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/sql/compiler.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2022-03-23 10:07:13 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2022-03-23 10:26:54 -0400
commit58fad097209e37d727988d03a60367b6e7dbc917 (patch)
tree8dc237d81fbb3b539497f839a1e12b3744eb74fd /lib/sqlalchemy/sql/compiler.py
parent845aacd5fc8fdc7839597c0e75c447180f7b438d (diff)
downloadsqlalchemy-58fad097209e37d727988d03a60367b6e7dbc917.tar.gz
Add option to disable from linting for table valued function
Added new parameter :paramref:`.FunctionElement.table_valued.joins_implicitly`, for the :meth:`.FunctionElement.table_valued` construct. This parameter indicates that the given table-valued function implicitly joins to the table it refers towards, essentially disabling the "from linting" feature, i.e. the "cartesian product" warning, from taking effect due to the presence of this parameter. May be used for functions such as ``func.json_each()``. Fixes: #7845 Change-Id: I80edcb74efbd4417172132c0db4d9c756fdd5eae (cherry picked from commit 04dcc5c704dbf0b22705523e263e512c24936175)
Diffstat (limited to 'lib/sqlalchemy/sql/compiler.py')
-rw-r--r--lib/sqlalchemy/sql/compiler.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/sqlalchemy/sql/compiler.py b/lib/sqlalchemy/sql/compiler.py
index 7780d3782..671ca6749 100644
--- a/lib/sqlalchemy/sql/compiler.py
+++ b/lib/sqlalchemy/sql/compiler.py
@@ -2805,6 +2805,8 @@ class SQLCompiler(Compiled):
return self.preparer.format_alias(cte, cte_name)
def visit_table_valued_alias(self, element, **kw):
+ if element.joins_implicitly:
+ kw["from_linter"] = None
if element._is_lateral:
return self.visit_lateral(element, **kw)
else: