snowflake-connector-nodejs icon indicating copy to clipboard operation
snowflake-connector-nodejs copied to clipboard

Documentation: fetchAsString accepts 'Buffer' as a valid value

Open nathanjcochran opened this issue 3 years ago • 0 comments

This error message suggests that the valid arguments to fetchAsString are: String, Boolean, Number, Date, and JSON. However, it also accepts Buffer, which correctly prevents BINARY data types from being returned as Buffers (which is the default behavior - see here).

The snowflake-sdk validates that the arguments to fetchAsString are in this list of native types, which includes Buffer. And the logic that actually handles the fetchAsString config option works correctly when 'Buffer' is provided as an argument. I therefore believe that the error message should be updated to reflect the fact that 'Buffer' is a valid fetchAsString value. Furthermore, these docs, which seem to suggest that fetchAsString only accepts Number and Date, should be updated to reflect all valid values.

nathanjcochran avatar Oct 20 '22 20:10 nathanjcochran