-
-
Notifications
You must be signed in to change notification settings - Fork 35.2k
Closed as not planned
Closed as not planned
Copy link
Labels
feature requestIssues that request new features to be added to Node.js.Issues that request new features to be added to Node.js.
Description
What is the problem this feature will solve?
Being able to use the SQL IN operator is not possible without a workaround; see https://stackoverflow.com/questions/79441096/using-sql-in-operator-with-databasesync-in-node-sqlite
What is the feature you are proposing to solve the problem?
Being able to do a query like this, where parameters to an IN operator in the WHERE clause can be substituted by an array of values:
const stmt = conn.prepare(`select name from people where id in (?)`);
res = stmt.get([100,200,300])
What alternatives have you considered?
Only the workaround in the above linked Stackoverflow question, where you have to make provision for each value individually in the query (which would require a new prepared statement each time):
const values = [100,200,300];
// 3 values, so need 3 params: ?,?,?
const params = values.map(_=>'?').join(',');
const stmt = conn.prepare(`select name from people where id in (${params})`);
res = stmt.get(values);
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
feature requestIssues that request new features to be added to Node.js.Issues that request new features to be added to Node.js.
Type
Projects
Status
Awaiting Triage