Add ejabberd_sql:abort/1 and ejabberd_sql:restart/1
This commit is contained in:
parent
f449df161a
commit
316da00345
|
@ -39,6 +39,8 @@
|
|||
sql_query_t/1,
|
||||
sql_transaction/2,
|
||||
sql_bloc/2,
|
||||
abort/1,
|
||||
restart/1,
|
||||
sql_query_to_iolist/1,
|
||||
escape/1,
|
||||
standard_escape/1,
|
||||
|
@ -190,6 +192,12 @@ sql_query_t(Query) ->
|
|||
_ -> QRes
|
||||
end.
|
||||
|
||||
abort(Reason) ->
|
||||
exit(Reason).
|
||||
|
||||
restart(Reason) ->
|
||||
throw({aborted, Reason}).
|
||||
|
||||
%% Escape character that will confuse an SQL engine
|
||||
escape(S) ->
|
||||
<< <<(sql_queries:escape(Char))/binary>> || <<Char>> <= S >>.
|
||||
|
|
Loading…
Reference in New Issue