Closed TahaKhanAbdalli closed 1 year ago
Hello @thevahidal - I'm pretty sure we have the skills to create a PR for the above issue.
Do you have a preference for whether:
undefined
values should be omitted from the INSERT
SQLINSERT
SQL, and be provided with a null
value.
Describe the bug I encountered an issue related to handling
null
values in the Object.values() method. The package appears to insert empty commas in the resulting string when a value in the input object is null.To Reproduce Steps to reproduce the behavior:
/api/tables/{name}/rows
POST api while sending in an object with one or more values asnull
Expected behavior The
valuesString
should be a comma-separated string that contains thenon-null
values from the fields object. No empty commas should be present in the resultingvaluesString
.Current behavior The
valuesString
contains empty commas when a value in the fields object is null. For example, if the fields object has a null value, the resulting valuesString would be: "value1, , value3". This behavior can lead to syntax errors or unexpected behavior.Screenshots
This is where the mapping is taking place:
Desktop (please complete the following information):
Additional context The issue seems to be related to the handling of null values during the map() operation. When encountering a null value, the package should handle it appropriately by skipping the value or providing a valid representation instead of inserting an empty comma.