Skip to main content
GoodFirstPicks
DashboardIssuesReposLeaderboard

GoodFirstPicks by Leaveitblank © 2026

CreatorRequest a RepoPrivacy PolicyTerms of Service
docs: sqlite statement.setAllowBareNamedParameters() | GoodFirstPicks

docs: sqlite statement.setAllowBareNamedParameters()

nodejs/node 1 comments 1mo ago
View on GitHub
easyopenScope: clearSkill match: yesNode.jsJavaScript

Why this is a good first issue

Documentation correction for SQLite parameter binding default behavior.

AI Summary

The documentation incorrectly states that SQLite requires a prefix character for named parameters by default, when in fact the default behavior allows bare named parameters. The task involves updating the documentation to reflect the correct default behavior.

Issue Description

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 }

GitHub Labels

doc

Want to work on this?

Claim this issue to let others know you're working on it. You'll earn 5 points when you complete it!

Loading labels...

Details

Points5 pts
Difficultyeasy
Scopeclear
Skill Matchyes
Test Focusedno