You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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';constdb=newDatabaseSync(':memory:');db.exec('CREATE TABLE t (c1, c2, c3)');// named parameters $c1, $c2, $c3constinsert=db.prepare('INSERT INTO t VALUES ($c1, $c2, $c3)');// bare named parameters, prefix not required by defaultinsert.run({c1: 1,c2: 2,c3: 3});console.log(db.prepare('SELECT * FROM t').get());// { c1: 1, c2: 2, c3: 3 }
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.
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.
Activity
YashhCanCode commentedon Feb 15, 2026
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.
github-actions commentedon Jul 20, 2026
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.