-
Notifications
You must be signed in to change notification settings - Fork 3
/
functions.go
120 lines (114 loc) · 2.69 KB
/
functions.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
package sqlparser
// AllowedFunctions is a map of allowed functions in Tableland.
// The value indicates if the function is custom.
var AllowedFunctions = map[string]bool{
// core functions
"abs": false,
//"changes": false,
"char": false,
"coalesce": false,
"format": false,
"glob": false,
"hex": false,
"ifnull": false,
"iif": false,
"instr": false,
//"last_insert_rowid": false,
"length": false,
"like": false,
//"likelihood": false,
//"likely": false,
//"load_extension": false,
"lower": false,
"ltrim": false,
"max": false,
"min": false,
"nullif": false,
"printf": false,
"quote": false,
//"random": false,
//"randomblob": false,
"replace": false,
"round": false,
"rtrim": false,
"sign": false,
//"soundex": false,
//"sqlite_compileoption_get": false,
//"sqlite_compileoption_used": false,
//"sqlite_offset": false,
//"sqlite_source_id": false,
//"sqlite_version": false,
"substr": false,
"substring": false,
//"total_changes": false,
"trim": false,
"typeof": false,
"unicode": false,
//"unlikely": false,
"upper": false,
//"zeroblob": false,
// math functions
"acos": false,
"acosh": false,
"asin": false,
"asinh": false,
"atan": false,
"atan2": false,
"atanh": false,
"ceil": false,
"ceiling": false,
"cos": false,
"cosh": false,
"degrees": false,
"exp": false,
"floor": false,
"ln": false,
"log": false,
"log10": false,
"log2": false,
"mod": false,
"pi": false,
"pow": false,
"power": false,
"radians": false,
"sin": false,
"sinh": false,
"sqrt": false,
"tan": false,
"tanh": false,
"trunc": false,
// date & time functions
// "date": false,
// "time": false,
// "datetime": false,
// "julianday": false,
// "unixepoch": false,
// "strftime": false,
// json functions
"json": false,
"json_array": false,
"json_array_length": false,
"json_extract": false,
"json_insert": false,
"json_object": false,
"json_patch": false,
"json_remove": false,
"json_replace": false,
"json_set": false,
"json_type": false,
"json_valid": false,
"json_quote": false,
"json_group_array": false,
"json_group_object": false,
// aggregate functions
"avg": false,
"count": false,
"group_concat": false,
// "max": false,
// "min": false,
"sum": false,
"total": false,
// custom Tableland functions
"txn_hash": true,
"block_num": true,
}