mattn / mattn/go-sqlite3

Virtual Table "Column Used" Field

Open
#841 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C
Stars
9.2k
Forks
1.2k
Avg merge
19m
Merged PRs (30d)
4

Description

The SQLite virtual table docs mention a colUsed field in the index information:

The colUsed field indicates which columns of the virtual table may be required by the current scan. Virtual table columns are numbered from zero in the order in which they appear within the CREATE TABLE statement passed to sqlite3_declare_vtab(). For the first 63 columns (columns 0-62), the corresponding bit is set within the colUsed mask if the column may be required by SQLite. If the table has at least 64 columns and any column to the right of the first 63 is required, then bit 63 of colUsed is also set. In other words, column iCol may be required if the expression (colUsed & ((sqlite3_uint64)1 << (iCol>=63 ? 63 : iCol))) evaluates to non-zero.

https://www.sqlite.org/c3ref/index_info.html

However I don't see any way to access that field in this library - is there something I'm missing? Or perhaps it's not implemented?

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 with the SQLite index_info documentation linked in the issue, then search the go-sqlite3 source for index_info and colUsed handling. Determine where virtual-table index information is represented and whether the field can be exposed through the library; done means the implementation or limitation is clearly established and covered by the relevant tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
go, sqlite
Domain
database
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.