Skip to content

Commit

Permalink
fix: cannot update column value with composite primary key and JSON c…
Browse files Browse the repository at this point in the history
…olumn, fixes #916
  • Loading branch information
dyaskur committed Jan 13, 2025
1 parent 507dc7d commit 0029967
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/main/ipc-handlers/tables.ts
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,9 @@ export default (connections: Record<string, antares.Client>) => {
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]}`;
Expand Down

0 comments on commit 0029967

Please sign in to comment.