diff --git a/src/esqlite3.erl b/src/esqlite3.erl index 3e0ef06..102c663 100644 --- a/src/esqlite3.erl +++ b/src/esqlite3.erl @@ -202,13 +202,13 @@ exec(Sql, {connection, _Ref, Connection}, Timeout) -> %% @doc Insert records, returns the last rowid. %% -%% @spec insert(iolist(), connection()) -> integer() | {error, error_message()} +%% @spec insert(iolist(), connection()) -> {ok, integer()} | {error, error_message()} insert(Sql, Connection) -> insert(Sql, Connection, ?DEFAULT_TIMEOUT). %% @doc Insert %% -%% @spec insert(iolist(), connection(), timeout()) -> integer() | {error, error_message()} +%% @spec insert(iolist(), connection(), timeout()) -> {ok, integer()} | {error, error_message()} insert(Sql, {connection, _Ref, Connection}, Timeout) -> Ref = make_ref(), ok = esqlite3_nif:insert(Connection, Ref, self(), Sql), diff --git a/src/esqlite3_nif.erl b/src/esqlite3_nif.erl index 24d8afe..147ec0b 100644 --- a/src/esqlite3_nif.erl +++ b/src/esqlite3_nif.erl @@ -109,7 +109,7 @@ close(_Db, _Ref, _Dest) -> %% @doc Insert record %% -%% @spec insert(connection(), Ref::reference(), Dest::pid(), string()) -> ok | {error, message()} +%% @spec insert(connection(), Ref::reference(), Dest::pid(), string()) -> {ok, integer()} | {error, message()} insert(_Db, _Ref, _Dest, _Sql) -> exit(nif_library_not_loaded).