Merge pull request #27 from maxlapshin/patch-1

support for encoding true/false to sqlite
This commit is contained in:
Alexey Romanov
2013-08-15 06:46:25 -07:00

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), $'];