Skip to content

sqlite: validate aggregate() name and options - #66463

Open
araujogui wants to merge 1 commit into
nodejs:mainfrom
araujogui:sqlite-aggregate-validate
Open

araujogui wants to merge 1 commit into
nodejs:mainfrom
araujogui:sqlite-aggregate-validate

Conversation

@araujogui

Copy link
Copy Markdown
Member

database.aggregate() cast its arguments without checking their types:

  • db.aggregate() threw a raw V8 TypeError (no code)
  • db.aggregate(123, {...}) silently registered a function named "123"

Both now throw ERR_INVALID_ARG_TYPE, matching database.function().

`Database.prototype.aggregate()` cast its arguments without checking
their types, so a missing `options` leaked a raw V8 TypeError and a
non-string `name` was silently coerced. Throw `ERR_INVALID_ARG_TYPE`
like the other sqlite bindings do.

Assisted-by: Claude Code
Signed-off-by: Guilherme Araújo <arauujogui@gmail.com>
Copilot AI balanced review requested due to automatic review settings October 2, 2026 15:48
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Review requested:

  • @nodejs/sqlite

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@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 Oct 2, 2026
@codecov

codecov Bot commented Oct 2, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.43%. Comparing base (4486dce) to head (903e779).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #66463      +/-   ##
==========================================
+ Coverage   90.42%   90.43%   +0.01%     
==========================================
  Files         791      791              
  Lines      275611   275619       +8     
  Branches    52845    52847       +2     
==========================================
+ Hits       249209   249249      +40     
+ Misses      16810    16768      -42     
- Partials     9592     9602      +10     
Files with missing lines Coverage Δ
src/node_sqlite.cc 81.93% <100.00%> (+0.04%) ⬆️

... and 32 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.

@araujogui
araujogui requested a review from trivikr October 2, 2026 19:17
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.

3 participants