-spec sql_query(binary(), sql_query()) -> sql_query_result().
sql_query(Host, Query) ->
- sql_call(Host, {sql_query, Query}).
+ check_error(sql_call(Host, {sql_query, Query}), Query).
%% SQL transaction based on a list of queries
%% This function automatically
_ -> []
end.
+check_error({error, Why} = Err, Query) ->
+ ?ERROR_MSG("SQL query '~s' failed: ~p", [Query, Why]),
+ Err;
+check_error(Result, _Query) ->
+ Result.
+
opt_type(max_fsm_queue) ->
fun (N) when is_integer(N), N > 0 -> N end;
opt_type(odbc_database) -> fun iolist_to_binary/1;