diff --git a/frontend/src/lib/components/apps/components/display/dbtable/queries/delete.ts b/frontend/src/lib/components/apps/components/display/dbtable/queries/delete.ts index 43e9a1bfc0..b74be6a3c8 100644 --- a/frontend/src/lib/components/apps/components/display/dbtable/queries/delete.ts +++ b/frontend/src/lib/components/apps/components/display/dbtable/queries/delete.ts @@ -12,9 +12,9 @@ function deleteWithAllValues(table: string, columns: ColumnDef[], dbType: DbType const conditions = columns .map( (c, i) => - `($${i + 1}::${c.datatype} IS NULL AND ${c.field} IS NULL OR ${c.field} = $${i + 1}::${ - c.datatype - })` + `($${i + 1}::text::${c.datatype} IS NULL AND ${c.field} IS NULL OR ${c.field} = $${ + i + 1 + }::text::${c.datatype})` ) .join('\n AND ') diff --git a/frontend/src/lib/components/apps/components/display/dbtable/queries/update.ts b/frontend/src/lib/components/apps/components/display/dbtable/queries/update.ts index e7aabd0fb8..c11c5c304f 100644 --- a/frontend/src/lib/components/apps/components/display/dbtable/queries/update.ts +++ b/frontend/src/lib/components/apps/components/display/dbtable/queries/update.ts @@ -25,13 +25,13 @@ function updateWithAllValues( const conditions = columns .map( (c, i) => - `($${i + 2}::${c.datatype} IS NULL AND ${c.field} IS NULL OR ${c.field} = $${i + 2}::${ - c.datatype - })` + `($${i + 2}::text::${c.datatype} IS NULL AND ${c.field} IS NULL OR ${c.field} = $${ + i + 2 + }::text::${c.datatype})` ) .join('\n AND ') - query += `\nUPDATE ${table} SET ${column.field} = $1::${column.datatype} \nWHERE ${conditions} RETURNING 1` + query += `\nUPDATE ${table} SET ${column.field} = $1::text::${column.datatype} \nWHERE ${conditions} RETURNING 1` return query } case 'mysql': {