Opened 5 years ago
Last modified 5 years ago
#31839 closed New feature
Add additional database functions. — at Version 3
| Reported by: | Nick Pope | Owned by: | Nick Pope |
|---|---|---|---|
| Component: | Database layer (models, ORM) | Version: | dev |
| Severity: | Normal | Keywords: | functions, random, truncate, log2, log10, bit length, octet length, hyperbolic |
| Cc: | Triage Stage: | Unreviewed | |
| Has patch: | yes | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | no | UI/UX: | no |
Description (last modified by )
I propose adding some additional database functions:
Random-- generate random numbers in the range[0.0, 0.1).Truncate-- round number towards zero. (SQL function isTRUNC, butTruncis used for date truncation in Django.)Log2andLog10-- simple logarithm functions without needing to provide the base.ACosh,ASinh,ATanh,Cosh,Sinh, andTanh-- hyperbolic functions.BitLengthandByteLength-- length of string in bits and bytes, complement toLengthwhich is character length.
Change History (3)
comment:1 by , 5 years ago
| Has patch: | set |
|---|
comment:2 by , 5 years ago
I'm not sure if it's worth adding extra database functions:
-
Log2andLog10can be achieved with proving base toLogso I'm against them, - hyperbolic functions are supported only on PostgreSQL 12+, we need to emulate them on other DBs, it's not worth, IMO,
BitLengthandOctetLengthwill probably not work on Oracle.
Truncate and Random sound reasonable.
comment:3 by , 5 years ago
| Description: | modified (diff) |
|---|
Note:
See TracTickets
for help on using tickets.
PR