Implement get_autocommit
http://www.sqlite.org/c3ref/get_autocommit.html
This commit is contained in:
@@ -26,6 +26,8 @@
|
||||
exec/2, exec/3,
|
||||
changes/1, changes/2,
|
||||
insert/2,
|
||||
get_autocommit/1,
|
||||
get_autocommit/2,
|
||||
prepare/2, prepare/3,
|
||||
step/1, step/2,
|
||||
reset/1,
|
||||
@@ -293,6 +295,17 @@ insert(Sql, {connection, _Ref, Connection}, Timeout) ->
|
||||
ok = esqlite3_nif:insert(Connection, Ref, self(), Sql),
|
||||
receive_answer(Ref, Timeout).
|
||||
|
||||
%% @doc Get autocommit
|
||||
%%
|
||||
%% @spec get_autocommit(connection) -> true | false
|
||||
get_autocommit(Connection) ->
|
||||
get_autocommit(Connection, ?DEFAULT_TIMEOUT).
|
||||
|
||||
get_autocommit({connection, _Ref, Connection}, Timeout) ->
|
||||
Ref = make_ref(),
|
||||
ok = esqlite3_nif:get_autocommit(Connection, Ref, self()),
|
||||
receive_answer(Ref, Timeout).
|
||||
|
||||
%% @doc Prepare a statement
|
||||
%%
|
||||
%% @spec prepare(iolist(), connection()) -> {ok, prepared_statement()} | {error, error_message()}
|
||||
|
||||
@@ -27,6 +27,7 @@
|
||||
exec/4,
|
||||
changes/3,
|
||||
insert/4,
|
||||
get_autocommit/3,
|
||||
prepare/4,
|
||||
multi_step/5,
|
||||
reset/4,
|
||||
@@ -140,3 +141,9 @@ close(_Db, _Ref, _Dest) ->
|
||||
%% @spec insert(connection(), Ref::reference(), Dest::pid(), string()) -> {ok, integer()} | {error, message()}
|
||||
insert(_Db, _Ref, _Dest, _Sql) ->
|
||||
erlang:nif_error(nif_library_not_loaded).
|
||||
|
||||
%% @doc Get automcommit
|
||||
%%
|
||||
%% @spec get_autocommit(connection(), Ref::reference(), Dest::pid()) -> true | false
|
||||
get_autocommit(_Db, _Ref, _Dest) ->
|
||||
erlang:nif_error(nif_library_not_loaded).
|
||||
|
||||
Reference in New Issue
Block a user