no-dynamic-sql
Disallow runtime values and fragments interpolated into SQL passed to statement-execution methods.
Why
Embedding runtime values or fragments in SQL bypasses driver parameterization or an explicit allowlist and can introduce injection defects or unstable query plans.
Fix
Bind data values through SQL placeholders. Select non-bindable identifiers or clauses from fixed, reviewed fragments instead of interpolating runtime text.
Examples
db.prepare(`select * from users where id = '${userId}'`);db.prepare("select * from users where id = ?").bind(userId);db.prepare(`select id from users where id = ${userId}`);db.prepare("select id from users where id = ?").bind(userId);