More screenshots

    Works with the AI Agents you already use

    Claude CodeClaude CodeCursorCursorCodex CLICodex CLIDeepSeekDeepSeekMuseMuse+22 more

    Quote Check: Find SQLite Bugs in Node.js

    1

    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

    Security scanned
    Quote Check: Find SQLite Bugs in Node.js

    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

    LineProblemResult on test dataCorrected code
    6"" parses as an identifierThrows no such column: ""db.prepare("SELECT id, note FROM orders WHERE note <> ''").all()
    10"status" matches the real column, so the column compares with itselfReturned both rows, whatever their statusdb.prepare('SELECT id, status FROM orders WHERE status = ?').all(wantedStatus)
    14slice copies the UTC clock timeShowed 08:30 for a 10:30 orderconst 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

    1. Apply the three fixes and rerun the scanner.
    2. Send a real POST to your webhook. A GET handshake can pass without reaching the statement that fails.
    3. Run each code path that prepares SQL, because the scanner uses pattern matching and a clean result proves nothing.
    4. Check what your code did with the rows from line 10. It received orders of every status.
    5. Add a test that asserts the rendered time equals the local time and differs from the raw UTC slice.
    6. Search for created_at comparisons 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.

    Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for Data & Databases.

    The scanner uses pattern matching, so a clean result proves nothing.
    Written for Node.js with JavaScript or TypeScript.

    How to use

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

      Sign in to Agensi

      Your agent shows a sign-in link. Sign in and click Allow.

    3. 3

      Ask for what you need

      Your agent loads this skill and uses it on your task. It always asks before buying a skill.

    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 to use

    No account required to browse

    Trust & safety

    Security scan

    Security scan passed 8 days ago

    • Free with an Agensi account

    Software
    Python 3 for the scanner

    Permissions

    Terminal / Shell
    Read Files

    File Scopes

    **/*.js
    **/*.ts

    The scanner reads source files and makes no network calls.

    Listed8 days ago

    What's inside

    Frequently Asked Questions

    The scanner only reports. Your agent proposes fixes.

    The double-quote rule is similar, but the scanner targets SQLite.

    It's a good first look at how these skills work.

    New in Data & Databases

    Free