#23753: Provide a set of SQL functions
-------------------------------------+-------------------------------------
Reporter: jarshwah | Owner: nobody
Type: New feature | Status: new
Component: Database layer | Version: master
(models, ORM) | Resolution:
Severity: Normal | Triage Stage:
Keywords: expressions | Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by jarshwah):
* needs_better_patch: => 0
* needs_tests: => 0
* needs_docs: => 0
Old description:
> When #14030 lands there will be an easy way to implement SQL functions
> like LENGTH() and COALESCE(). There are several tickets requesting the
> implementation of certain functions, and this ticket aims to collate
> those requests, and extend the number of functions to a useable minimum
> subset. There was a discussion on the mailing list that calls out some
> implementation details as well as the set of functions to implement:
> https://groups.google.com/forum/?utm_medium=email&utm_source=footer#!msg
> /django-developers/HggiPzwkono/SgXt4iNjTIYJ
>
> List of functions:
>
> - Coalesce
> - ToLower/Lower
> - ToUpper/Upper
> - Length
> - Case-When / IIF
> - Substring
>
> This list isn't necessarily complete or final. If there are other
> functions that you'd like to see implemented in core, please comment, and
> I'll update the list above. Particular implementation details can be
> discussed on the PR or below once a PR is submitted. I'll aim to have
> these completed very soon after #14030 lands, and I expect these to be
> available in the same django version that incorporates 14030.
>
> Linked tickets:
>
> - #23363 (Length)
> - #21208 (Coalesce in .extra)
> - #10929 (Coalesce for Aggregates - could also be done by customising the
> aggregate directly)
New description:
When #14030 lands there will be an easy way to implement SQL functions
like LENGTH() and COALESCE(). There are several tickets requesting the
implementation of certain functions, and this ticket aims to collate those
requests, and extend the number of functions to a useable minimum subset.
There was a discussion on the mailing list that calls out some
implementation details as well as the set of functions to implement:
https://groups.google.com/forum/?utm_medium=email&utm_source=footer#!msg
/django-developers/HggiPzwkono/SgXt4iNjTIYJ
List of functions:
- Coalesce
- ToLower/Lower
- ToUpper/Upper
- Length
- Case-When / IIF
- Substring
- As/Cast for casting the return value of a complex expression without
defining the output_field of each sub-component)
This list isn't necessarily complete or final. If there are other
functions that you'd like to see implemented in core, please comment, and
I'll update the list above. Particular implementation details can be
discussed on the PR or below once a PR is submitted. I'll aim to have
these completed very soon after #14030 lands, and I expect these to be
available in the same django version that incorporates 14030.
Linked tickets:
- #23363 (Length)
- #21208 (Coalesce in .extra)
- #10929 (Coalesce for Aggregates - could also be done by customising the
aggregate directly)
--
--
Ticket URL: <https://code.djangoproject.com/ticket/23753#comment:1>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/066.a3ee231fc9fe1d796a111da34394571c%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.