Added extra function to return a map with error information

This commit is contained in:
Maas-Maarten Zeeman
2022-05-22 22:19:30 +02:00
parent 71ab29c724
commit 135715bf0a
3 changed files with 61 additions and 2 deletions

View File

@@ -19,7 +19,10 @@
%% higher-level export
-export([
open/1, close/1,
open/1,
close/1,
error_info/1,
%% db connection functions
set_update_hook/2,
@@ -136,6 +139,13 @@ open(Filename) ->
close(#esqlite3{db=Connection}) ->
esqlite3_nif:close(Connection).
%% @doc Return a description of the last occurred error.
-spec error_info(Connection) -> ErrorMsg
when Connection :: esqlite3(),
ErrorMsg :: undefined | binary().
error_info(#esqlite3{db=Connection}) ->
esqlite3_nif:error_info(Connection).
%% @doc Subscribe to database notifications. When rows are inserted deleted
%% or updates, the process will receive messages: