Skip to content

Conversation

@MatricalDefunkt
Copy link

@MatricalDefunkt MatricalDefunkt commented Dec 17, 2025

When using SQLite tag store functions (sql.get, sql.run, etc.), preparation errors now show descriptive SQLite error messages instead of the generic 'Failed to prepare statement' message.

The tag store's GetOrCreateStatement function now passes the database object to THROW_ERR_SQLITE_ERROR, thus retrieving the actual error message from sqlite3_errmsg(), and matching the behavior of the regular db.prepare() method.

Included an appropriate test as well.

Fixes: #61051

EDIT: Since this is my first PR to a major open source project, I would appreciate any sort of guidance given. Thank you!

When using SQLite tag store functions (sql.get`, sql.run`, etc.),
preparation errors now show descriptive SQLite error messages instead
of the generic 'Failed to prepare statement' message.

The tag store's GetOrCreateStatement function now passes the database
object to THROW_ERR_SQLITE_ERROR, allowing it to retrieve the actual
error message from sqlite3_errmsg(), matching the behavior of the
regular db.prepare() method.

Fixes: nodejs#61051
@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 Dec 17, 2025
@codecov
Copy link

codecov bot commented Dec 17, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 88.52%. Comparing base (4f24aff) to head (ed2915c).
⚠️ Report is 24 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #61096      +/-   ##
==========================================
- Coverage   88.53%   88.52%   -0.01%     
==========================================
  Files         703      703              
  Lines      208546   208546              
  Branches    40217    40225       +8     
==========================================
- Hits       184634   184617      -17     
- Misses      15926    15962      +36     
+ Partials     7986     7967      -19     
Files with missing lines Coverage Δ
src/node_sqlite.cc 80.18% <100.00%> (+0.26%) ⬆️

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

@avivkeller avivkeller added the request-ci Add this label to start a Jenkins CI on a PR. label Dec 20, 2025
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Dec 20, 2025
@nodejs-github-bot
Copy link
Collaborator

@aduh95 aduh95 added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Dec 20, 2025
@nodejs-github-bot
Copy link
Collaborator

@MatricalDefunkt
Copy link
Author

Is the macos test something which I broke?

@geeksilva97 geeksilva97 added request-ci Add this label to start a Jenkins CI on a PR. and removed request-ci Add this label to start a Jenkins CI on a PR. labels Dec 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author ready PRs that have at least one approval, no pending requests for changes, and a CI started. 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.

Improving the node:sqlite error messages

7 participants