Added column names

This commit is contained in:
Maas-Maarten Zeeman
2022-05-18 00:15:29 +02:00
parent 953a12a207
commit 616127c748
4 changed files with 58 additions and 41 deletions

View File

@@ -20,7 +20,9 @@
%% higher-level export
-export([
open/1, close/1,
prepare/2
prepare/2,
column_names/1
% set_update_hook/2, set_update_hook/3,
% exec/2, exec/3, exec/4,
@@ -33,7 +35,6 @@
% bind/2, bind/3,
% fetchone/1,
% fetchall/1, fetchall/2, fetchall/3,
% column_names/1, column_names/2,
% column_types/1, column_types/2,
% backup_init/4, backup_init/5,
% backup_finish/1, backup_finish/2,
@@ -447,15 +448,9 @@ prepare(#esqlite3{db=Connection}, Sql) ->
%
%% @doc Return the column names of the prepared statement.
%%
%-spec column_names(statement()) -> {atom()}.
%column_names(Stmt) ->
% column_names(Stmt, ?DEFAULT_TIMEOUT).
%-spec column_names(statement(), timeout()) -> {atom()}.
%column_names(#statement{raw_statement=RawStatement, raw_connection=RawConnection}, Timeout) ->
% Ref = make_ref(),
% ok = esqlite3_nif:column_names(RawConnection, RawStatement, Ref, self()),
% receive_answer(RawConnection, Ref, Timeout).
-spec column_names(esqlite3_stmt()) -> [binary()].
column_names(#esqlite3_stmt{stmt=Stmt}) ->
esqlite3_nif:column_names(Stmt).
%% @doc Return the column types of the prepared statement.
%%

View File

@@ -24,6 +24,8 @@
close/1,
prepare/2,
column_names/1,
interrupt/1
% set_update_hook/4,
% exec/4,
@@ -36,7 +38,6 @@
% finalize/4,
% bind/5,
% column_names/4,
% column_types/4,
% backup_init/6,
@@ -140,9 +141,9 @@ prepare(_Connection, _Sql) ->
%% @doc Retrieve the column names of the prepared statement
%%
%-spec column_names(esqlite3(), esqlite3_stmt(), reference(), pid()) -> ok | {error, _}.
%column_names(_Db, _Stmt, _Ref, _Dest) ->
% erlang:nif_error(nif_library_not_loaded).
-spec column_names(esqlite3_stmt()) -> list() | {error, _}.
column_names(_Stmt) ->
erlang:nif_error(nif_library_not_loaded).
%% @doc Retrieve the column types of the prepared statement
%%