In Esqlite we can do
%% All columns
{ok, Stmt} = esqlite3:prepare(Db, "select * from test_table"),
?assertEqual([<<"varchar(10)">>, <<"INT">>], esqlite3:column_decltypes(Stmt)),
and
{ok, Stmt} = esqlite3:prepare(C, "select 1 as one"),
?assertEqual([<<"one">>], esqlite3:column_names(Stmt)),
{ok, Stmt1} = esqlite3:prepare(C, <<"select 1 as π"/utf8>>),
?assertEqual([<<"π"/utf8>>], esqlite3:column_names(Stmt1)),
{ok, Stmt2} = esqlite3:prepare(C, <<"select 1">>),
?assertEqual([<<"1">>], esqlite3:column_names(Stmt2)),
(copied from one of the tests)
Can we somehow support this as well? (without necessarily exposing prepared statements and such)?
My use case: I'm trying to write a ascii table snapshot of parts of my database and I want to be able to do this dynamically without knowing the columns upfront.
In Esqlite we can do
and
{ok, Stmt} = esqlite3:prepare(C, "select 1 as one"), ?assertEqual([<<"one">>], esqlite3:column_names(Stmt)), {ok, Stmt1} = esqlite3:prepare(C, <<"select 1 as π"/utf8>>), ?assertEqual([<<"π"/utf8>>], esqlite3:column_names(Stmt1)), {ok, Stmt2} = esqlite3:prepare(C, <<"select 1">>), ?assertEqual([<<"1">>], esqlite3:column_names(Stmt2)),(copied from one of the tests)
Can we somehow support this as well? (without necessarily exposing prepared statements and such)?
My use case: I'm trying to write a ascii table snapshot of parts of my database and I want to be able to do this dynamically without knowing the columns upfront.