We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6717713 commit e538c09Copy full SHA for e538c09
packages/orm/src/client/crud/dialects/postgresql.ts
@@ -59,12 +59,9 @@ export class PostgresCrudDialect<Schema extends SchemaDef> extends BaseCrudDiale
59
)
60
.with('Decimal', () => (value !== null ? value.toString() : value))
61
.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();
+ if (typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean') {
+ // postgres requires simple JSON values to be stringified
+ return JSON.stringify(value);
68
} else {
69
return value;
70
}
0 commit comments