feat(rule_engine): rule sql add null function

This commit is contained in:
Turtle 2021-05-08 16:32:17 +08:00 committed by turtleDeng
parent c5aeeb3b40
commit 80ef076cee
2 changed files with 5 additions and 0 deletions

View File

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

View File

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