- Home
- Skills
- Data & Databases
- Quote Check: Find SQLite Bugs in Node.js
More screenshots
Works with the AI Agents you already use
Quote Check: Find SQLite Bugs in Node.js
Find double-quoted strings that break better-sqlite3 or quietly match the wrong rows, and UTC times shown to your users as local time. A bundled scanner lists likely problems with file and line.
Free
Quote Check: Find SQLite Bugs in Node.js
Example session with this skill installed
After moving to better-sqlite3 our webhook returns 500 with no such column, and order times show two hours early.
- Read your context and instructions
- Compiled the quote check
Summary
Your two symptoms come from two separate bugs. better-sqlite3 treats "" as a column name, so the query on line 6 throws no such column as soon as your code prepares it. Line 14 prints the stored UTC time, which puts it two hours early for users on UTC+2. The scanner also caught a third bug you haven't reported: line 10 raises no error and returns the wrong rows.
Scanner output
src/orders.js:6: double-quoted empty string in SQL, use ''
src/orders.js:10: double-quoted value in SQL: = "status"
src/orders.js:14: time sliced from a stored timestamp, likely UTC shown as local
Findings and fixes
| Line | Problem | Result on test data | Corrected code |
|---|---|---|---|
| 6 | "" parses as an identifier | Throws no such column: "" | db.prepare("SELECT id, note FROM orders WHERE note <> ''").all() |
| 10 | "status" matches the real column, so the column compares with itself | Returned both rows, whatever their status | db.prepare('SELECT id, status FROM orders WHERE status = ?').all(wantedStatus) |
| 14 | slice copies the UTC clock time | Showed 08:30 for a 10:30 order | const t = formatTime(row.created_at); |
Add this helper for line 14, and set USER_TIME_ZONE to your users' zone:
const USER_TIME_ZONE = 'Africa/Johannesburg';
function formatTime(value) {
const raw = String(value).replace(' ', 'T');
const ms = Date.parse(/(Z|[+-]\d\d:?\d\d)$/.test(raw) ? raw : raw + 'Z');
return new Date(ms).toLocaleTimeString('en-ZA', {
timeZone: USER_TIME_ZONE, hour: '2-digit', minute: '2-digit', hour12: false,
});
}
I ran the original and corrected versions against an in-memory better-sqlite3 database. The corrected query on line 6 returned the one order with a note, line 10 returned only the paid order, and formatTime returned 10:30.
Next steps
- Apply the three fixes and rerun the scanner.
- Send a real POST to your webhook. A GET handshake can pass without reaching the statement that fails.
- Run each code path that prepares SQL, because the scanner uses pattern matching and a clean result proves nothing.
- Check what your code did with the rows from line 10. It received orders of every status.
- Add a test that asserts the rendered time equals the local time and differs from the raw UTC slice.
- Search for
created_atcomparisons against local-time values. Those drop rows inside the two-hour offset.
Connects securely to your tools. The creator never sees your data.
About this skill
Two SQLite bugs get past basic tests.
Double-quoted strings. better-sqlite3 treats "" as a column name, so the query throws. If the word matches a real column there's no error at all, and WHERE status = "status" returns the wrong rows.
UTC shown as local. datetime('now') stores UTC, and slice(11, 16) prints it to your user. The wrong time looks right, so it lasts for months.
A bundled scanner lists likely problems with file and line, and the skill gives the fix for each.
How it was tested
We ran the scanner on five production Node.js codebases and on purpose-built samples. Results are a guide, so exercise every prepared statement too.
The scanner uses pattern matching, so a clean result proves nothing.
Written for Node.js with JavaScript or TypeScript.
How to use
- 1
Connect your agent to the Agensi MCP
Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup
- 2
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 3
Ask for what you need
Your agent loads this skill and uses it on your task. It always asks before any payment.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill goes through the trust checks below.
Security scanned
Checked by our 8-point scan before listing
Fresh listing
Recently published to Agensi
Free forever
No account required to browse
Trust & safety
Security scan
Security scan passed 8 days ago
- Free with an Agensi account
Requires
Permissions
File Scopes
The scanner reads source files and makes no network calls.