diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2022-03-23 10:07:13 -0400 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2022-03-23 10:26:12 -0400 |
commit | 04dcc5c704dbf0b22705523e263e512c24936175 (patch) | |
tree | 646f90741239bb76e584d28382ef96f1fa255ccb /lib/sqlalchemy/sql/compiler.py | |
parent | 6652c62bd90a455843c77f41acd50af920126351 (diff) | |
download | sqlalchemy-04dcc5c704dbf0b22705523e263e512c24936175.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
Diffstat (limited to 'lib/sqlalchemy/sql/compiler.py')
-rw-r--r-- | lib/sqlalchemy/sql/compiler.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/sqlalchemy/sql/compiler.py b/lib/sqlalchemy/sql/compiler.py index f8019b9c6..d3e91a8d5 100644 --- a/lib/sqlalchemy/sql/compiler.py +++ b/lib/sqlalchemy/sql/compiler.py @@ -3173,6 +3173,8 @@ class SQLCompiler(Compiled): return None 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: |