From ede6fe81cefc91cdce2bbb0cd7cd6f85bbca99b8 Mon Sep 17 00:00:00 2001 From: Fabio Di Stasio Date: Thu, 4 Feb 2021 09:20:52 +0100 Subject: [PATCH] fix: edit bit fields --- README.md | 2 +- src/main/ipc-handlers/tables.js | 6 +++++- src/renderer/components/WorkspacePropsTableRow.vue | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 028542d8..5447b6a0 100644 --- a/README.md +++ b/README.md @@ -46,7 +46,7 @@ This is a roadmap with major features will come in near future. - Support for other databases. - Database tools (variables, process list...). -- SSL and SSH tunnel support. +- SSH tunnel support. - Users management (add/edit/delete). - UI/UX improvements. - Query history. diff --git a/src/main/ipc-handlers/tables.js b/src/main/ipc-handlers/tables.js index ac0c6a17..752c31f8 100644 --- a/src/main/ipc-handlers/tables.js +++ b/src/main/ipc-handlers/tables.js @@ -1,6 +1,6 @@ import { ipcMain } from 'electron'; import { sqlEscaper } from 'common/libs/sqlEscaper'; -import { TEXT, LONG_TEXT, NUMBER, BLOB } from 'common/fieldTypes'; +import { TEXT, LONG_TEXT, NUMBER, BLOB, BIT } from 'common/fieldTypes'; import fs from 'fs'; export default (connections) => { @@ -75,6 +75,10 @@ export default (connections) => { else escapedParam = '""'; } + else if ([...BIT].includes(params.type)) { + escapedParam = `b'${sqlEscaper(params.content)}'`; + reload = true; + } else escapedParam = `"${sqlEscaper(params.content)}"`; diff --git a/src/renderer/components/WorkspacePropsTableRow.vue b/src/renderer/components/WorkspacePropsTableRow.vue index 4ddb155e..70eec017 100644 --- a/src/renderer/components/WorkspacePropsTableRow.vue +++ b/src/renderer/components/WorkspacePropsTableRow.vue @@ -318,7 +318,7 @@ export default { getWorkspace: 'workspaces/getWorkspace' }), localLength () { - return this.localRow.numLength || this.localRow.charLength || this.localRow.datePrecision || 0; + return this.localRow.numLength || this.localRow.charLength || this.localRow.datePrecision || this.localRow.numPrecision || 0; }, fieldType () { const fieldType = this.dataTypes.reduce((acc, group) => [...acc, ...group.types], []).filter(type =>