-
-
Notifications
You must be signed in to change notification settings - Fork 35.4k
sqlite: statement.setReadNullAsUndefined() #59457
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?
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.