feat(rule_engine): rule sql add null function

This commit is contained in:
Turtle 2021-05-08 16:32:17 +08:00 committed by Yudai Kiyofuji
parent cc6f43aea7
commit a58357cfe3
2 changed files with 5 additions and 0 deletions

View File

@ -35,6 +35,7 @@
, contains_topic/3
, contains_topic_match/2
, contains_topic_match/3
, null/0
]).
%% Arithmetic Funcs
@ -300,6 +301,9 @@ find_topic_filter(Filter, TopicFilters, Func) ->
throw:Result -> Result
end.
null() ->
undefined.
%%------------------------------------------------------------------------------
%% Arithmetic Funcs
%%------------------------------------------------------------------------------

View File

@ -228,6 +228,7 @@ tcp_connectivity(Host, Port, Timeout) ->
unwrap(<<"${", Val/binary>>) ->
binary:part(Val, {0, byte_size(Val)-1}).
sql_data(undefined) -> null;
sql_data(List) when is_list(List) -> List;
sql_data(Bin) when is_binary(Bin) -> Bin;
sql_data(Num) when is_number(Num) -> Num;