From 65960ca4ea2ba6b912d89b34b7ebf517f51fd043 Mon Sep 17 00:00:00 2001 From: Marton Csikos Date: Tue, 7 Jun 2022 20:08:08 +0200 Subject: [PATCH] Parse JSON string when column type is JSONB Support parsing postgres jsonb data type. --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index a4b7cdd..1d44d6e 100644 --- a/index.js +++ b/index.js @@ -360,7 +360,7 @@ const formatRecordValue = (value, typeName, formatOptions) => { value, (formatOptions && formatOptions.treatAsLocalDate) || typeName === 'TIMESTAMP WITH TIME ZONE' ) - } else if (typeName === 'JSON') { + } else if (['JSON', 'JSONB'].includes(typeName.toUpperCase())) { return JSON.parse(value) } else { return value