From 002996761997444ff689bf2384dae64ccb9ef8f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EF=B8=8FYaskur=20Dyas=E2=9A=94=E2=9A=94=EF=B8=8F=E2=9A=94?= Date: Tue, 14 Jan 2025 04:44:29 +0700 Subject: [PATCH] fix: cannot update column value with composite primary key and JSON column, fixes #916 --- src/main/ipc-handlers/tables.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main/ipc-handlers/tables.ts b/src/main/ipc-handlers/tables.ts index a05d2ee4..bd1b50c9 100644 --- a/src/main/ipc-handlers/tables.ts +++ b/src/main/ipc-handlers/tables.ts @@ -234,6 +234,9 @@ export default (connections: Record) => { for (const key in orgRow) { if (typeof orgRow[key] === 'string') orgRow[key] = `'${orgRow[key]}'`; + else if (typeof orgRow[key] === 'object') { + orgRow[key] = `CAST('${JSON.stringify(orgRow[key])}' AS JSON)`; + } if (orgRow[key] === null) orgRow[key] = `IS ${orgRow[key]}`;