This method overrides django.db.models.expressions.Func.as_sql.
Different backends can provide their own implementation, by
providing an `as_{vendor}` method and patching the Expression:
```
def override_as_sql(self, compiler, connection):
# custom logic
return super().as_sql(compiler, connection)
setattr(Expression, 'as_' + connection.vendor, override_as_sql)
```
Arguments:
* compiler: the query compiler responsible for generating the query.
Must have a compile method, returning a (sql, [params]) tuple.
Calling compiler(value) will return a quoted `value`.
* connection: the database connection used for the current query.
Return: (sql, params)
Where `sql` is a string containing ordered sql parameters to be
replaced with the elements of the list `params`.This method overrides django.db.models.expressions.BaseExpression.get_group_by_cols.
This method overrides django.db.models.expressions.Func.get_source_expressions.
This method overrides django.db.models.expressions.BaseExpression.get_source_fields.
This method overrides django.db.models.expressions.Func.resolve_expression.
Arguments: * query: the backend query implementation * allow_joins: boolean allowing or denying use of joins in this query * reuse: a set of reusable joins for multijoins * summarize: a terminal aggregate clause * for_save: whether this expression about to be used in a save or update Return: an Expression to be added to the query.
This method overrides django.db.models.expressions.Func.set_source_expressions.