Closed chan-nguyen closed 2 years ago
This package does not handle nulls, but it's actually pg
that ensures that nulls are never parsed:
So no, you cannot customize parsing of nulls here (or in pg
). Changing that is either breaking or requires a whole separate API for handling nulls for each type. I don't expect we'd implement either.
This package's job is to convert returned PG values into the best equivalent JavaScript type. Any additional processing can be performed on the resultant objects.
If you want to have zero values rather than null, that can be accomplished at the database level via column defaults.
Happy to hear more about the use case though.
Currently, the lib states that
null values are never parsed.
. However, in some use-cases, we may need to convertnull
toundefined
or some defined value.Is it possible to handle returned
null
values ?Code example: