API for accessing column names and types
Nobody has claimed this yet.
- Dominant language
- Gleam
- Stars
- 159
- Forks
- 27
- PR merge metrics
- No merged PRs in 30d
Description
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.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating sqlight's existing query and result APIs, then compare their tests with the Esqlite examples in the issue. The requested public API, prepared-statement exposure, and handling of column names and declared types are not specified; done would require an agreed design plus coverage for the shown queries and UTF-8 name.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- sqlite
- Domain
- database
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100