Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 36.7k
sqlite: statement.setReadNullAsUndefined() #59457
Copy link
Copy link
Closed as not planned
Labels
feature requestIssues requesting new Node.js features.Issues requesting new Node.js features.sqliteIssues and PRs related to the SQLite subsystem.Issues and PRs related to the SQLite subsystem.staleIssues and PRs marked stale due to inactivity and scheduled for automatic closure.Issues and PRs marked stale due to inactivity and scheduled for automatic closure.
Description
Activity
Metadata
Metadata
Assignees
Labels
feature requestIssues requesting new Node.js features.Issues requesting new Node.js features.sqliteIssues and PRs related to the SQLite subsystem.Issues and PRs related to the SQLite subsystem.staleIssues and PRs marked stale due to inactivity and scheduled for automatic closure.Issues and PRs marked stale due to inactivity and scheduled for automatic closure.
Type
Projects
- StatusShow more project fieldsAwaiting Triage
What is the problem this feature will solve?
In JS, we have two different oddballs
nullandundefined. In SQL, they are represented asNULL.Inserting them to database makes them coerced to
NULL; however selecting to JS realm always producesnulls, which is not always desirable.What is the feature you are proposing to solve the problem?
Similarly to
statement.setReadBigInts(enabled), we can havestatement.setReadNullAsUndefined()to make reads returnNULLs asundefinedinstead ofnull.Also we can have database-wide
readNullAsUndefinedoption innew DatabaseSync(path[, options])What alternatives have you considered?
Drowning in boilerplate code.