Browse Source

Fix typo in typespec, plus minor cleanup

Сергей Прохоров 7 years ago
parent
commit
2eb52c4e3f
1 changed files with 2 additions and 3 deletions
  1. 2 3
      src/epgsql.erl

+ 2 - 3
src/epgsql.erl

@@ -344,8 +344,7 @@ with_transaction(C, F) ->
 %%   https://www.postgresql.org/docs/current/static/sql-begin.html)
 %%   Beware of SQL injections! No escaping is made on begin_opts!
 -spec with_transaction(
-        connection(), fun((connection) -> Reply), Opts) -> Reply | {rollback, any()}
-                                                               when
+        connection(), fun((connection()) -> Reply), Opts) -> Reply | {rollback, any()} | no_return() when
       Reply :: any(),
       Opts :: [{reraise, boolean()} |
                {ensure_committed, boolean()} |
@@ -360,7 +359,7 @@ with_transaction(C, F, Opts0) ->
     try
         {ok, [], []} = squery(C, Begin),
         R = F(C),
-        {ok, [], []} = squery(C, "COMMIT"),
+        {ok, [], []} = squery(C, <<"COMMIT">>),
         case proplists:get_value(ensure_committed, Opts, false) of
             true ->
                 {ok, CmdStatus} = get_cmd_status(C),