diff --git a/src/sqlite3_lib.erl b/src/sqlite3_lib.erl index 2ab6aa3..75b1698 100644 --- a/src/sqlite3_lib.erl +++ b/src/sqlite3_lib.erl @@ -382,7 +382,7 @@ pk_constraint_sql(Constraint) -> desc -> "DESC"; asc -> "ASC"; autoincrement -> "AUTOINCREMENT"; - L -> lists:map(fun pk_constraint_sql/1, L) + List -> map_intersperse(fun pk_constraint_sql/1, List, " ") end. -spec constraint_sql(any()) -> iolist(). diff --git a/test/sqlite3_test.erl b/test/sqlite3_test.erl index dcde337..29a4ab2 100644 --- a/test/sqlite3_test.erl +++ b/test/sqlite3_test.erl @@ -62,7 +62,7 @@ basic_functionality() -> Columns = ["id", "name", "age", "wage"], AllRows = [{1, <<"abby">>, 20, 2000}, {2, <<"marge">>, 30, 2000}], AbbyOnly = [{1, <<"abby">>, 20, 2000}], - TableInfo = [{id, integer, [{primary_key, [autoincrement]}]}, {name, text, [not_null, unique]}, {age, integer}, {wage, integer}], + TableInfo = [{id, integer, [{primary_key, [asc, autoincrement]}]}, {name, text, [not_null, unique]}, {age, integer}, {wage, integer}], drop_all_tables(ct), ?WARN_ERROR_MESSAGE, ?assertEqual(