tursodatabase / tursodatabase/libsql

[C Bindings] Missing get declared type API on rows

Open
#1,413 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C
Stars
17.2k
Forks
531
Avg merge
1h 12m
Merged PRs (30d)
1

Description

When iterating through a result set in sqlite3 the rows might return null values but the declared/infered type might be different, to get the type of the column sqlite3 offers sqlite3_column_decltype:

CleanShot 2024-05-24 at 11 05 27@2x

When using libsql there is no such API to retrieve this declared type, again this is useful to get rid of ambivalence when retrieving data from the db, it is only possible to get the type of a specific row but as stated this can be NULL depending on the queried row.

CleanShot 2024-05-24 at 11 05 19@2x

Related to https://github.com/tursodatabase/libsql/issues/1412

Contributor guide

Open the contributing guide

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 inspecting the existing C bindings for row and column-type APIs, then compare their behavior with SQLite's sqlite3_column_decltype documentation and the related issue #1412. Done means callers can retrieve a column's declared type independently of whether the current row value is NULL, with coverage for that case.

Written by the indexing model from the issue text.

Assessment

Tech stack
c, sqlite
Domain
api, databases
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.