Add function to get the last insert rowid (#62)

* Add function to get the last insert rowid

* Update esqlite3.erl

Co-authored-by: Maas-Maarten Zeeman <mmzeeman@xs4all.nl>
This commit is contained in:
Joe Freeman
2022-01-03 17:05:27 +00:00
committed by GitHub
parent d77b1fa76c
commit 09a9c86097
4 changed files with 72 additions and 0 deletions

View File

@@ -27,6 +27,7 @@
exec/4,
changes/3,
insert/4,
last_insert_rowid/3,
get_autocommit/3,
prepare/4,
multi_step/5,
@@ -145,6 +146,12 @@ close(_Db, _Ref, _Dest) ->
insert(_Db, _Ref, _Dest, _Sql) ->
erlang:nif_error(nif_library_not_loaded).
%% @doc Get the last insert rowid.
%%
%% @spec insert(connection(), Ref::reference(), Dest::pid()) -> {ok, integer()} | {error, message()}
last_insert_rowid(_Db, _Ref, _Dest) ->
erlang:nif_error(nif_library_not_loaded).
%% @doc Get automcommit
%%
-spec get_autocommit(esqlite:connection(), reference(), pid()) -> ok | {error, any()}.