support for encoding true/false to sqlite

This commit is contained in:
Max Lapshin
2013-08-15 14:22:11 +04:00
parent a1dc034b3e
commit 3e306069c8

View File

@@ -77,6 +77,8 @@ value_to_sql_unsafe(X) ->
case X of
_ when is_integer(X) -> integer_to_list(X);
_ when is_float(X) -> float_to_list(X);
true -> "1";
false -> "0";
undefined -> "NULL";
?NULL_ATOM -> "NULL";
{blob, Blob} -> ["x'", bin_to_hex(Blob), $'];
@@ -97,6 +99,8 @@ value_to_sql(X) ->
case X of
_ when is_integer(X) -> integer_to_list(X);
_ when is_float(X) -> float_to_list(X);
true -> "1";
false -> "0";
undefined -> "NULL";
?NULL_ATOM -> "NULL";
{blob, Blob} -> ["x'", bin_to_hex(Blob), $'];