Skip to content

docs: sqlite statement.setAllowBareNamedParameters() #61823

Description

@mike-git374

Affected URL(s)

https://nodejs.org/docs/latest/api/sqlite.html#statementsetallowbarenamedparametersenabled

Description of the problem

For sqlite statement.setAllowBareNamedParameters() the docs say:

By default, node:sqlite requires that this prefix character is present when binding parameters .. To improve ergonomics, this method can be used to also allow bare named parameters

but this is not right, the default value for allowBareNamedParameters is true, see database.prepare(sql[, options]) and new DatabaseSync(path[, options]), which means the prefix is not required. This needs to be re-written to account for allowBareNamedParameters defaulting to true not false.

Example showing allowBareNamedParameters defaults to true:

import { DatabaseSync } from 'node:sqlite';
const db = new DatabaseSync(':memory:');

db.exec('CREATE TABLE t (c1, c2, c3)');

// named parameters $c1, $c2, $c3
const insert = db.prepare('INSERT INTO t VALUES ($c1, $c2, $c3)');

// bare named parameters, prefix not required by default
insert.run({ c1: 1, c2: 2, c3: 3 });

console.log(db.prepare('SELECT * FROM t').get());
// { c1: 1, c2: 2, c3: 3 }

Activity

  1. added
    docIssues and PRs related to Node.js documentation.
    on Feb 14, 2026
  2. YashhCanCode commented on Feb 15, 2026

    @YashhCanCode

    I can reproduce this and confirm that allowBareNamedParameters defaults to true.

    The current wording suggests bare named parameters are disallowed by default, which seems incorrect based on DatabaseSync / database.prepare defaults and actual behavior.

    I’d like to open a docs-only PR.

  3. github-actions commented on Jul 20, 2026

    @github-actions
    Contributor

    This issue has been marked as stale due to 90 days of inactivity.
    It will be automatically closed in 30 days if no further activity occurs. If this is still relevant, please leave a comment or update it to keep it open.

  4. added
    staleIssues and PRs marked stale due to inactivity and scheduled for automatic closure.
    on Jul 20, 2026
  5. added
    sqliteIssues and PRs related to the SQLite subsystem.
    on Jul 27, 2026
  6. removed
    staleIssues and PRs marked stale due to inactivity and scheduled for automatic closure.
    on Jul 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    docIssues and PRs related to Node.js documentation.sqliteIssues and PRs related to the SQLite subsystem.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions