1
0
mirror of https://github.com/django/django.git synced 2025-04-07 23:16:46 +00:00

Refs #373 -- Delegated Tuple compilation to compiler.

This should allow third-party backends to define Tuple.as_vendor()
overrides that are taken into consideration which calling as_sql()
directly prevents.
This commit is contained in:
Simon Charette 2025-02-08 21:05:50 -05:00 committed by Mariusz Felisiak
parent 17160819f3
commit c326cfe3b1

View File

@ -87,7 +87,7 @@ class TupleLookupMixin:
Value(val, output_field=col.output_field)
for col, val in zip(self.lhs, self.rhs)
]
return Tuple(*args).as_sql(compiler, connection)
return compiler.compile(Tuple(*args))
else:
sql, params = compiler.compile(self.rhs)
if not isinstance(self.rhs, ColPairs):
@ -313,7 +313,7 @@ class TupleIn(TupleLookupMixin, In):
)
)
return Tuple(*result).as_sql(compiler, connection)
return compiler.compile(Tuple(*result))
def as_sql(self, compiler, connection):
if not self.rhs_is_direct_value():