diff --git a/packages/cli/src/modules/data-table/data-table-rows.repository.ts b/packages/cli/src/modules/data-table/data-table-rows.repository.ts index 72e831321e5..6c732e0487b 100644 --- a/packages/cli/src/modules/data-table/data-table-rows.repository.ts +++ b/packages/cli/src/modules/data-table/data-table-rows.repository.ts @@ -80,11 +80,11 @@ function getConditionAndParams( } // For filters, we let TypeORM handle date conversion through parameterized queries. - let value = filter.value; + const value = filter.value; - if (dbType.startsWith('sqlite') && typeof value === 'object' && !(value instanceof Date)) { - value = JSON.stringify(value); - } + // if (dbType.startsWith('sqlite') && typeof value === 'object' && !(value instanceof Date)) { + // value = JSON.stringify(value); + // } // Handle operators that map directly to SQL operators const operators: Record = { diff --git a/packages/cli/src/modules/data-table/utils/sql-utils.ts b/packages/cli/src/modules/data-table/utils/sql-utils.ts index 9f1904ffa5e..2d1e50ac645 100644 --- a/packages/cli/src/modules/data-table/utils/sql-utils.ts +++ b/packages/cli/src/modules/data-table/utils/sql-utils.ts @@ -384,10 +384,12 @@ export function resolvePath( value: DataTableColumnJsType, path?: string, ) { - if (path) { + if (path !== undefined) { const pathArray = parsePath(path); if (dbType === 'postgres') { const base = `${ref}${toPostgresPath(pathArray)}`; + return `(${base})::text`; + if (typeof value === 'number') { return `(${base})::numeric`; } else if (value instanceof Date) {