-
-
Notifications
You must be signed in to change notification settings - Fork 422
Open
Labels
Description
Running EXPLAIN on a query that contains parameters doesn't seem to work correctly as an error is thrown because the parameters aren't set but that shouldn't be required.
Tested with better-sqlite3 v11.2.1 and Node.js v18.20.4.
Reproduction:
import Database from 'better-sqlite3';
const db = new Database(':memory:');
// Works
console.log(db.prepare('EXPLAIN select 1').all());
// Doesn't work
console.log(db.prepare('EXPLAIN select ?').all());
console.log(db.prepare('EXPLAIN select :foo').all());
Error:
RangeError: Too few parameter values were provided
at file:///tmp/test.mjs:9:44
at ModuleJob.run (node:internal/modules/esm/module_job:195:25)
at async ModuleLoader.import (node:internal/modules/esm/loader:337:24)
at async loadESM (node:internal/process/esm_loader:34:7)
at async handleMainPromise (node:internal/modules/run_main:106:12)