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:
sergey-miryanov
2010-07-14 12:47:46 +06:00
parent 7876c0f568
commit b65d2f8bcb
8 changed files with 1775 additions and 2642 deletions

View File

@@ -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, ",").