What is the problem this feature will solve?
In JS, we have two different oddballs null and undefined. In SQL, they are represented as NULL.
Inserting them to database makes them coerced to NULL; however selecting to JS realm always produces nulls, which is not always desirable.
What is the feature you are proposing to solve the problem?
Similarly to statement.setReadBigInts(enabled), we can have statement.setReadNullAsUndefined() to make reads return NULLs as undefined instead of null.
Also we can have database-wide readNullAsUndefined option in new DatabaseSync(path[, options])
What alternatives have you considered?
Drowning in boilerplate code.
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.