From 16de0dd75b4b6e65a21cd676c50790d3145b71ba Mon Sep 17 00:00:00 2001 From: Denis Bykhov Date: Fri, 8 Nov 2024 21:54:28 +0500 Subject: [PATCH] Improve infer type (#7137) * Improve infer type Signed-off-by: Denis Bykhov * Fix Signed-off-by: Denis Bykhov --------- Signed-off-by: Denis Bykhov --- server/postgres/src/utils.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/server/postgres/src/utils.ts b/server/postgres/src/utils.ts index 39b2bb4a0e..e4a5679e5a 100644 --- a/server/postgres/src/utils.ts +++ b/server/postgres/src/utils.ts @@ -307,6 +307,12 @@ export function inferType (val: any): string { } } if (typeof val === 'object') { + if (val == null) { + return '' + } + if (val instanceof Date) { + return '::text' + } return '::jsonb' } return ''