Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix nested json array transform - fixes #506
- Loading branch information
Showing
2 changed files
with
9 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
So I am installing
Postgres
from GitHub so I can try out this fix, and I realised that the transform function throws an error ifnull
orundefined
is passed toObject.entries()
Examples:
Throws
In my case, I have a query that returns data like the example below
this causes the below error when it hits the
Object.entries(x)
part of the transform functionI think checking for
x
before passing it to theObject.entries(x)
would prevent this error. So we pass the data only when it is notundefined
ornull
.This worked for me when I changed that line of the transform function like this
I don't know if this is the proper fix, but it would be great if you look into this.
Thanks