Improve processing of SQLITE_NULL
null-atom can be configured on configure or make stage. For example ./configure --enable-null-atom=undefined && make
This commit is contained in:
@@ -50,12 +50,11 @@ col_type("DATE") ->
|
||||
%%--------------------------------------------------------------------
|
||||
-spec(write_value_sql/1::(any()) -> string()).
|
||||
write_value_sql(Values) ->
|
||||
StrValues = lists:map(fun(X) when is_integer(X) ->
|
||||
integer_to_list(X);
|
||||
(X) when is_float(X) ->
|
||||
float_to_list(X);
|
||||
(X) ->
|
||||
io_lib:format("'~s'", [X])
|
||||
StrValues = lists:map(fun
|
||||
(X) when is_integer(X) -> integer_to_list(X);
|
||||
(X) when is_float(X) -> float_to_list(X);
|
||||
(?NULL_ATOM) -> 'null';
|
||||
(X) -> io_lib:format("'~s'", [X])
|
||||
end, Values),
|
||||
string:join(StrValues, ",").
|
||||
|
||||
|
||||
Reference in New Issue
Block a user