Skip to content

Commit 02b0022

Browse files
Implement scalar functions: abs, upper, lower, reverse (#61)
* Implement scalar functions: abs, upper, lower, reverse Closes #32 * Update cratedb_django/models/functions.py Co-authored-by: Ivan <surister98@gmail.com> --------- Co-authored-by: Ivan <surister98@gmail.com>
1 parent c558760 commit 02b0022

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

cratedb_django/models/functions.py

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,28 @@ class UUID(Func):
1010
output_field = TextField(
1111
max_length=20
1212
) # the length of a CrateDB random uid.
13+
14+
class Abs(Func):
15+
"""
16+
https://cratedb.com/docs/crate/reference/en/latest/general/builtins/scalar-functions.html#abs
17+
"""
18+
function = "abs"
19+
20+
class Upper(Func):
21+
"""
22+
https://cratedb.com/docs/crate/reference/en/latest/general/builtins/scalar-functions.html#upper
23+
"""
24+
function = "upper"
25+
26+
class Lower(Func):
27+
"""
28+
https://cratedb.com/docs/crate/reference/en/latest/general/builtins/scalar-functions.html#lower
29+
"""
30+
function = "lower"
31+
32+
class Reverse(Func):
33+
"""
34+
https://cratedb.com/docs/crate/reference/en/latest/general/builtins/scalar-functions.html#reverse
35+
"""
36+
function = "reverse"
37+

0 commit comments

Comments
 (0)