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.
- Database tools (variables, process list...).
- SSL and SSH tunnel support.
- SSH tunnel support.
- Users management (add/edit/delete).
- UI/UX improvements.
- Query history.

View File

@ -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)}"`;

View File

@ -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 =>