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 84f1df2 commit 6717713Copy full SHA for 6717713
packages/orm/src/client/crud/dialects/postgresql.ts
@@ -58,6 +58,17 @@ export class PostgresCrudDialect<Schema extends SchemaDef> extends BaseCrudDiale
58
: value,
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();
68
+ } else {
69
+ return value;
70
+ }
71
+ })
72
.otherwise(() => value);
73
}
74
0 commit comments