-
-
Notifications
You must be signed in to change notification settings - Fork 35.4k
SQLite bind booleans #57862
Copy link
Copy link
Open
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
Projects
Status
Awaiting Triage
What is the problem this feature will solve?
Currently, all booleans need to be transformed from
trueto1andfalseto0to bind them as SQLite parameters.Trying to use a boolean results in an error:
What is the feature you are proposing to solve the problem?
SQLite supports booleans! I propose automatically transforming booleans to numbers, in the same way SQLite treats the boolean keywords:
Please note I only propose automatic conversion for boolean parameters to 0 and 1, not the other way around parsing results to booleans.
What alternatives have you considered?
Writing a wrapper or manually handling the conversion.