(self, compiler, connection)
| 551 | return super().as_sql(compiler, connection) |
| 552 | |
| 553 | def split_parameter_list_as_sql(self, compiler, connection): |
| 554 | # This is a special case for databases which limit the number of |
| 555 | # elements which can appear in an 'IN' clause. |
| 556 | max_in_list_size = connection.ops.max_in_list_size() |
| 557 | lhs, lhs_params = self.process_lhs(compiler, connection) |
| 558 | rhs, rhs_params = self.batch_process_rhs(compiler, connection) |
| 559 | in_clause_elements = ["("] |
| 560 | params = [] |
| 561 | for offset in range(0, len(rhs_params), max_in_list_size): |
| 562 | if offset > 0: |
| 563 | in_clause_elements.append(" OR ") |
| 564 | in_clause_elements.append("%s IN (" % lhs) |
| 565 | params.extend(lhs_params) |
| 566 | sqls = rhs[offset : offset + max_in_list_size] |
| 567 | sqls_params = rhs_params[offset : offset + max_in_list_size] |
| 568 | param_group = ", ".join(sqls) |
| 569 | in_clause_elements.append(param_group) |
| 570 | in_clause_elements.append(")") |
| 571 | params.extend(sqls_params) |
| 572 | in_clause_elements.append(")") |
| 573 | return "".join(in_clause_elements), params |
| 574 | |
| 575 | |
| 576 | class PatternLookup(BuiltinLookup): |
no test coverage detected