get column types
This commit is contained in:
@@ -32,6 +32,7 @@
|
||||
fetchone/1,
|
||||
fetchall/1,
|
||||
column_names/1, column_names/2,
|
||||
column_types/1, column_types/2,
|
||||
close/1, close/2]).
|
||||
|
||||
-export([q/2, q/3, map/3, foreach/3]).
|
||||
@@ -305,6 +306,18 @@ column_names(Stmt, Timeout) ->
|
||||
ok = esqlite3_nif:column_names(Stmt, Ref, self()),
|
||||
receive_answer(Ref, Timeout).
|
||||
|
||||
%% @doc Return the column types of the prepared statement.
|
||||
%%
|
||||
-spec column_types(statement()) -> tuple(atom()).
|
||||
column_types(Stmt) ->
|
||||
column_types(Stmt, ?DEFAULT_TIMEOUT).
|
||||
|
||||
-spec column_types(statement(), timeout()) -> tuple(atom()).
|
||||
column_types(Stmt, Timeout) ->
|
||||
Ref = make_ref(),
|
||||
ok = esqlite3_nif:column_types(Stmt, Ref, self()),
|
||||
receive_answer(Ref, Timeout).
|
||||
|
||||
%% @doc Close the database
|
||||
%%
|
||||
%% @spec close(connection()) -> ok | {error, error_message()}
|
||||
|
||||
@@ -32,6 +32,7 @@
|
||||
finalize/3,
|
||||
bind/4,
|
||||
column_names/3,
|
||||
column_types/3,
|
||||
close/3
|
||||
]).
|
||||
|
||||
@@ -116,6 +117,12 @@ bind(_Stmt, _Ref, _Dest, _Args) ->
|
||||
column_names(_Stmt, _Ref, _Dest) ->
|
||||
exit(nif_library_not_loaded).
|
||||
|
||||
%% @doc Retrieve the column types of the prepared statement
|
||||
%%
|
||||
%% @spec column_types(statement(), reference(), pid()) -> {ok, tuple()} | {error, message()}
|
||||
column_types(_Stmt, _Ref, _Dest) ->
|
||||
exit(nif_library_not_loaded).
|
||||
|
||||
%% @doc Close the connection.
|
||||
%%
|
||||
%% @spec close(connection(), reference(), pid()) -> ok | {error, message()}
|
||||
|
||||
Reference in New Issue
Block a user