Skip to content

Commit

Permalink
Improve infer type (#7137)
Browse files Browse the repository at this point in the history
* Improve  infer type

Signed-off-by: Denis Bykhov <[email protected]>

* Fix

Signed-off-by: Denis Bykhov <[email protected]>

---------

Signed-off-by: Denis Bykhov <[email protected]>
  • Loading branch information
BykhovDenis authored Nov 8, 2024
1 parent 5487e3b commit 16de0dd
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions server/postgres/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 ''
Expand Down

0 comments on commit 16de0dd

Please sign in to comment.