Commit 30e7f96
authored
Query param for attaching fields to response json (#469)
This PR adds query parameters to format response output.
Mainly duplicating existing fill null option to query param
and adding a withFields param options.
Attaching schema to output can benefit cases where client
wants to display table but the table API wants all table
columns to be defined first.
Example: {{endpoint}}/api/v1/query?fields=true
"query": "select min(p_timestamp), max(p_timestamp) from {{stream_name}}",
```
{
"fields": [
"MIN(app.p_timestamp)",
"MAX(app.p_timestamp)"
],
"records": [
{
"MAX(app.p_timestamp)": "2023-08-07T05:55:59.738",
"MIN(app.p_timestamp)": "2023-08-07T05:55:20.335"
}
]
}
```1 parent cdeb9e8 commit 30e7f96
2 files changed
+36
-22
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
| 21 | + | |
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
| 27 | + | |
27 | 28 | | |
28 | 29 | | |
29 | 30 | | |
| |||
36 | 37 | | |
37 | 38 | | |
38 | 39 | | |
39 | | - | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
40 | 44 | | |
41 | 45 | | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
42 | 55 | | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
48 | 64 | | |
49 | 65 | | |
50 | 66 | | |
51 | 67 | | |
52 | 68 | | |
53 | 69 | | |
54 | | - | |
| 70 | + | |
55 | 71 | | |
56 | 72 | | |
57 | 73 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
20 | 19 | | |
21 | 20 | | |
22 | 21 | | |
23 | 22 | | |
24 | | - | |
| 23 | + | |
25 | 24 | | |
26 | 25 | | |
27 | | - | |
28 | 26 | | |
29 | 27 | | |
30 | 28 | | |
| 29 | + | |
31 | 30 | | |
32 | 31 | | |
33 | 32 | | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | 33 | | |
44 | 34 | | |
45 | 35 | | |
| |||
53 | 43 | | |
54 | 44 | | |
55 | 45 | | |
56 | | - | |
57 | 46 | | |
58 | | - | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
59 | 57 | | |
60 | 58 | | |
0 commit comments