Skip to content

Commit e538c09

Browse files
committed
update
1 parent 6717713 commit e538c09

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

packages/orm/src/client/crud/dialects/postgresql.ts

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -59,12 +59,9 @@ export class PostgresCrudDialect<Schema extends SchemaDef> extends BaseCrudDiale
5959
)
6060
.with('Decimal', () => (value !== null ? value.toString() : value))
6161
.with('Json', () => {
62-
if (typeof value === 'string') {
63-
// Postgres string JSON needs to be quoted
64-
return `"${value}"`;
65-
} else if (typeof value === 'number') {
66-
// Postgres number JSON needs to be in string form
67-
return value.toString();
62+
if (typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean') {
63+
// postgres requires simple JSON values to be stringified
64+
return JSON.stringify(value);
6865
} else {
6966
return value;
7067
}

0 commit comments

Comments
 (0)