Skip to content

sqlite: add statement.columnCount getter - #67658

Open
araujogui wants to merge 1 commit into
nodejs:mainfrom
araujogui:sqlite-statement-returns-data
Open

araujogui wants to merge 1 commit into
nodejs:mainfrom
araujogui:sqlite-statement-returns-data

Conversation

@araujogui

@araujogui araujogui commented Nov 20, 2026 •

Copy link
Copy Markdown
Member

Adds a statement.columnCount getter that returns the number of result columns of a prepared statement, wrapping sqlite3_column_count(). columnCount > 0 tells whether the statement returns data.

Fixes: #67352

Copilot AI balanced review requested due to automatic review settings November 20, 2026 14:05
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Review requested:

  • @nodejs/sqlite

This comment was marked as outdated.

@nodejs-github-bot nodejs-github-bot added c++ Issues and PRs that require attention from people who are familiar with C++. needs-ci PRs that need a full CI run. sqlite Issues and PRs related to the SQLite subsystem. labels Nov 20, 2026
@araujogui araujogui added the request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. label Nov 20, 2026
@github-actions github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. label Nov 20, 2026
@nodejs-github-bot

This comment was marked as outdated.

@codecov

codecov Bot commented Nov 20, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 88.88889% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 90.55%. Comparing base (a055d9f) to head (5d16ad0).
⚠️ Report is 8 commits behind head on main.

Files with missing lines Patch % Lines
src/node_sqlite.cc 88.88% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #67658      +/-   ##
==========================================
+ Coverage   90.52%   90.55%   +0.02%     
==========================================
  Files         803      803              
  Lines      285110   285119       +9     
  Branches    55037    55031       -6     
==========================================
+ Hits       258101   258184      +83     
+ Misses      17143    17086      -57     
+ Partials     9866     9849      -17     
Files with missing lines Coverage Δ
src/node_sqlite.h 87.71% <ø> (ø)
src/node_sqlite.cc 83.05% <88.88%> (+0.01%) ⬆️

... and 35 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@louwers louwers left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can not really be called a 'wrapper' around sqlite3_column_count() because it returns something different.

@nodejs-github-bot

This comment was marked as outdated.

@jasnell jasnell added the request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. label Nov 22, 2026
@github-actions github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. label Nov 22, 2026
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@louwers

louwers commented Nov 22, 2026

Copy link
Copy Markdown
Contributor

I would like an actual wrapper. I.e. something that returns a number.

@araujogui
araujogui force-pushed the sqlite-statement-returns-data branch from cc45eb0 to 5f9a9e6 Compare November 23, 2026 17:09
@araujogui araujogui changed the title sqlite: add statement.returnsData getter sqlite: add statement.columnCount getter Nov 23, 2026
@araujogui
araujogui requested a review from louwers November 23, 2026 17:10
@louwers

louwers commented Nov 23, 2026

Copy link
Copy Markdown
Contributor

Thanks! Makes more sense to me since you can still do

if (stmt.columnCount)

Add a getter to `Statement` that returns the number of columns in the
prepared statement's result set, wrapping `sqlite3_column_count()`.

Fixes: nodejs#67352
Assisted-by: Claude Code
Signed-off-by: Guilherme Araújo <arauujogui@gmail.com>
@araujogui
araujogui force-pushed the sqlite-statement-returns-data branch from 5f9a9e6 to 5d16ad0 Compare November 24, 2026 14:34
@araujogui araujogui added the request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. label Nov 24, 2026
@github-actions github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. label Nov 24, 2026
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@araujogui araujogui added the resume-ci Add this label to resume the latest eligible Jenkins CI run on a PR with an approving review. label Nov 25, 2026
@github-actions github-actions Bot removed the resume-ci Add this label to resume the latest eligible Jenkins CI run on a PR with an approving review. label Nov 25, 2026
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

c++ Issues and PRs that require attention from people who are familiar with C++. needs-ci PRs that need a full CI run. sqlite Issues and PRs related to the SQLite subsystem.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

sqlite: add reader to Statement, aligned with better-sqlite3

7 participants