MCPcopy
hub / github.com/django/django / as_oracle

Method as_oracle

django/db/models/expressions.py:1980–1995  ·  view source on GitHub ↗
(self, compiler, connection)

Source from the content-addressed store, hash-verified

1978 return (template % placeholders).rstrip(), params
1979
1980 def as_oracle(self, compiler, connection):
1981 # Oracle < 23c doesn't allow ORDER BY EXISTS() or filters unless it's
1982 # wrapped in a CASE WHEN.
1983 if (
1984 not connection.features.supports_boolean_expr_in_select_clause
1985 and connection.ops.conditional_expression_supported_in_where_clause(
1986 self.expression
1987 )
1988 ):
1989 copy = self.copy()
1990 copy.expression = Case(
1991 When(self.expression, then=True),
1992 default=False,
1993 )
1994 return copy.as_sql(compiler, connection)
1995 return self.as_sql(compiler, connection)
1996
1997 def get_group_by_cols(self):
1998 cols = []

Callers

nothing calls this directly

Calls 6

as_sqlMethod · 0.95
CaseClass · 0.85
WhenClass · 0.85
copyMethod · 0.45
as_sqlMethod · 0.45

Tested by

no test coverage detected