-
-
Notifications
You must be signed in to change notification settings - Fork 35.6k
sqlite: db.prepare(sql, options) #61235
Copy link
Copy link
Closed
Labels
feature requestIssues that request new features to be added to Node.js.Issues that request new features to be added to Node.js.sqliteIssues and PRs related to the SQLite subsystem.Issues and PRs related to the SQLite subsystem.
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.sqliteIssues and PRs related to the SQLite subsystem.Issues and PRs related to the SQLite subsystem.
Type
Fields
Give feedbackNo fields configured for issues without a type.
Projects
Status
Awaiting Triage
Problem
Currently you need multiple js statements to declare a single SQLite statement with options like
returnArrays,readBigIntsetc. This requires multiple lines and can be inefficient to call c++ multiple times:Proposal 1
Allow chaining
statement.set*functions by returning the sql statement instead ofundefined. This allows declaring a sql statement with 1 JS statement. This still requires multiple function calls but is slightly better DX developer experience using the existingset*functions:PR: #61263
Proposal 2
Add options argument:
db.prepare(sql[, options])In this case I recommend to remove the
statement.set*functions to simplify the API, you only needdb.prepare(sql[, options])Proposal 3
Do both Proposal 1 and Proposal 2. Currently I am leaning towards Proposal 2 and removing set* functions