lpil / lpil/sqlight

API for accessing column names and types

Open
#15 4 comments 0 reactions 0 assignees View on GitHub

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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.