(self, compiler, connection)
| 603 | # can_use_none_as_rhs = True |
| 604 | |
| 605 | def process_rhs(self, compiler, connection): |
| 606 | if isinstance(self.rhs, KeyTransform): |
| 607 | return super(lookups.Exact, self).process_rhs(compiler, connection) |
| 608 | rhs, rhs_params = super().process_rhs(compiler, connection) |
| 609 | if connection.vendor == "oracle": |
| 610 | func = [] |
| 611 | sql = "%s(JSON_OBJECT('value' VALUE %%s FORMAT JSON), '$.value')" |
| 612 | for value in rhs_params: |
| 613 | value = json.loads(value) |
| 614 | if isinstance(value, (list, dict)): |
| 615 | func.append(sql % "JSON_QUERY") |
| 616 | else: |
| 617 | func.append(sql % "JSON_VALUE") |
| 618 | rhs %= tuple(func) |
| 619 | elif connection.vendor == "sqlite": |
| 620 | func = [] |
| 621 | for value in rhs_params: |
| 622 | if value in connection.ops.jsonfield_datatype_values: |
| 623 | func.append("%s") |
| 624 | else: |
| 625 | func.append("JSON_EXTRACT(%s, '$')") |
| 626 | rhs %= tuple(func) |
| 627 | return rhs, rhs_params |
| 628 | |
| 629 | def as_oracle(self, compiler, connection): |
| 630 | rhs, rhs_params = super().process_rhs(compiler, connection) |
nothing calls this directly
no test coverage detected