-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathgreptimedb_values.erl
63 lines (47 loc) · 2.21 KB
/
greptimedb_values.erl
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
%% Copyright 2023 Greptime Team
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
%% You may obtain a copy of the License at
%%
%% http://www.apache.org/licenses/LICENSE-2.0
%%
%% Unless required by applicable law or agreed to in writing, software
%% distributed under the License is distributed on an "AS IS" BASIS,
%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
%% See the License for the specific language governing permissions and
%% limitations under the License.
-module(greptimedb_values).
-export([int32_value/1, int64_value/1, float64_value/1, boolean_value/1, binary_value/1,
string_value/1, date_value/1, datetime_value/1, timestamp_second_value/1, uint32_value/1,
uint64_value/1,
timestamp_millisecond_value/1, timestamp_microsecond_value/1,
timestamp_nanosecond_value/1]).
int32_value(V) ->
#{values => #{i32_values => [V]}, datatype => 'INT32'}.
int64_value(V) ->
#{values => #{i64_values => [V]}, datatype => 'INT64'}.
uint32_value(V) ->
#{values => #{u32_values => [V]}, datatype => 'UINT32'}.
uint64_value(V) ->
#{values => #{u64_values => [V]}, datatype => 'UINT64'}.
float64_value(V) ->
#{values => #{f64_values => [V]}, datatype => 'FLOAT64'}.
boolean_value(V) ->
#{values => #{bool_values => [V]}, datatype => 'BOOLEAN'}.
binary_value(V) ->
#{values => #{binary_values => [V]}, datatype => 'BINARY'}.
string_value(V) ->
#{values => #{string_values => [V]}, datatype => 'STRING'}.
date_value(V) ->
#{values => #{date_values => [V]}, datatype => 'DATE'}.
datetime_value(V) ->
#{values => #{datetime_values => [V]}, datatype => 'DATETIME'}.
timestamp_second_value(V) ->
#{values => #{timestamp_second_values => [V]}, datatype => 'TIMESTAMP_SECOND'}.
timestamp_millisecond_value(V) ->
#{values => #{timestamp_millisecond_values => [V]}, datatype => 'TIMESTAMP_MILLISECOND'}.
timestamp_microsecond_value(V) ->
#{values => #{timestamp_microsecond_values => [V]}, datatype => 'TIMESTAMP_MICROSECOND'}.
timestamp_nanosecond_value(V) ->
#{values => #{timestamp_nanosecond_values => [V]}, datatype => 'TIMESTAMP_NANOSECOND'}.