Skip to content

Conversation

islandryu
Copy link
Member

@islandryu islandryu commented Oct 12, 2025

Fixes: #60198

I added report content for SQLTagStore.
Although the text in errstr differs from that of a conventional prepared statement, it now matches the corresponding SQLite function name.

@nodejs-github-bot
Copy link
Collaborator

Review requested:

  • @nodejs/sqlite

@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 12, 2025

test('failed prepares throw', () => {
assert.throws(() => {
sql.all`SELECT * FROM does_not_exist`; // eslint-disable-line no-unused-expressions
Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Member Author

Choose a reason for hiding this comment

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

I have updated the ESLint configuration.

Local<String> js_errstr;
Local<String> js_errmsg;
Local<Object> e;
if (!String::NewFromUtf8(isolate, errstr).ToLocal(&js_errmsg) ||
Copy link
Contributor

Choose a reason for hiding this comment

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

Need to be swapped.

Suggested change
if (!String::NewFromUtf8(isolate, errstr).ToLocal(&js_errmsg) ||
if (!String::NewFromUtf8(isolate, errstr).ToLocal(&js_errstr) ||

Copy link
Member Author

Choose a reason for hiding this comment

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

Oh sorry, that was my mistake.

message: 'Failed to prepare statement',
code: 'ERR_SQLITE_ERROR',
errcode: 1,
errstr: 'no such table: does_not_exist',
Copy link
Contributor

Choose a reason for hiding this comment

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

Wrong way around I think, see other comment.

Copy link

codecov bot commented Oct 12, 2025

Codecov Report

❌ Patch coverage is 72.22222% with 10 lines in your changes missing coverage. Please review.
✅ Project coverage is 88.56%. Comparing base (f9fcc74) to head (5d15a24).
⚠️ Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
src/node_sqlite.cc 72.22% 3 Missing and 7 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #60227      +/-   ##
==========================================
- Coverage   88.56%   88.56%   -0.01%     
==========================================
  Files         704      704              
  Lines      208125   208160      +35     
  Branches    40003    40013      +10     
==========================================
+ Hits       184332   184361      +29     
- Misses      15809    15812       +3     
- Partials     7984     7987       +3     
Files with missing lines Coverage Δ
src/node_sqlite.cc 80.27% <72.22%> (+0.12%) ⬆️

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

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: less-than-useful error reporting when using SQLTagStore queries

3 participants