without stringify

This commit is contained in:
Charlie Kolb 2025-10-28 16:53:23 +01:00
parent 2af14e83a4
commit 75688a2e7a
No known key found for this signature in database
3 changed files with 9 additions and 3 deletions

View File

@ -7,6 +7,7 @@ export class Column {
| 'varchar'
| 'text'
| 'json'
| 'jsonb'
| 'timestamptz'
| 'timestamp'
| 'uuid'
@ -73,6 +74,11 @@ export class Column {
return this;
}
get jsonb() {
this.type = 'jsonb';
return this;
}
/**
* @deprecated use `timestampTimezone` instead
**/

View File

@ -80,10 +80,10 @@ function getConditionAndParams(
}
// For filters, we let TypeORM handle date conversion through parameterized queries.
let value = filter.value;
const value = filter.value;
let postfix = '';
if (typeof value === 'object' && !(value instanceof Date)) {
value = JSON.stringify(value);
// value = JSON.stringify(value);
if (dbType === 'postgres') {
postfix = '::jsonb';
}

View File

@ -36,7 +36,7 @@ export function toDslColumns(columns: DataTableCreateColumnSchema[]): DslColumn[
case 'date':
return name.timestampTimezone();
case 'json':
return name.json;
return name.jsonb;
default:
return name.text;
}