fix: edit bit fields

This commit is contained in:
Fabio Di Stasio 2021-02-04 09:20:52 +01:00
parent 4e72bb1587
commit ede6fe81ce
3 changed files with 7 additions and 3 deletions

View File

@ -46,7 +46,7 @@ This is a roadmap with major features will come in near future.
- Support for other databases. - Support for other databases.
- Database tools (variables, process list...). - Database tools (variables, process list...).
- SSL and SSH tunnel support. - SSH tunnel support.
- Users management (add/edit/delete). - Users management (add/edit/delete).
- UI/UX improvements. - UI/UX improvements.
- Query history. - Query history.

View File

@ -1,6 +1,6 @@
import { ipcMain } from 'electron'; import { ipcMain } from 'electron';
import { sqlEscaper } from 'common/libs/sqlEscaper'; 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'; import fs from 'fs';
export default (connections) => { export default (connections) => {
@ -75,6 +75,10 @@ export default (connections) => {
else else
escapedParam = '""'; escapedParam = '""';
} }
else if ([...BIT].includes(params.type)) {
escapedParam = `b'${sqlEscaper(params.content)}'`;
reload = true;
}
else else
escapedParam = `"${sqlEscaper(params.content)}"`; escapedParam = `"${sqlEscaper(params.content)}"`;

View File

@ -318,7 +318,7 @@ export default {
getWorkspace: 'workspaces/getWorkspace' getWorkspace: 'workspaces/getWorkspace'
}), }),
localLength () { 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 () { fieldType () {
const fieldType = this.dataTypes.reduce((acc, group) => [...acc, ...group.types], []).filter(type => const fieldType = this.dataTypes.reduce((acc, group) => [...acc, ...group.types], []).filter(type =>