mirror of
https://github.com/Fabio286/antares.git
synced 2025-04-14 02:02:15 +02:00
fix(SQLite): save boolean as integer to improve compativility, fixes #463
This commit is contained in:
parent
e4a4696dd3
commit
d52b7af297
2
.vscode/launch.json
vendored
2
.vscode/launch.json
vendored
@ -5,7 +5,6 @@
|
|||||||
"name": "Electron: Main",
|
"name": "Electron: Main",
|
||||||
"cwd": "${workspaceFolder}",
|
"cwd": "${workspaceFolder}",
|
||||||
"port": 9222,
|
"port": 9222,
|
||||||
"protocol": "inspector",
|
|
||||||
"request": "attach",
|
"request": "attach",
|
||||||
"sourceMaps": true,
|
"sourceMaps": true,
|
||||||
"type": "node",
|
"type": "node",
|
||||||
@ -23,7 +22,6 @@
|
|||||||
"name": "Electron: Worker",
|
"name": "Electron: Worker",
|
||||||
"cwd": "${workspaceFolder}",
|
"cwd": "${workspaceFolder}",
|
||||||
"port": 9224,
|
"port": 9224,
|
||||||
"protocol": "inspector",
|
|
||||||
"request": "attach",
|
"request": "attach",
|
||||||
"sourceMaps": true,
|
"sourceMaps": true,
|
||||||
"type": "node",
|
"type": "node",
|
||||||
|
@ -5,7 +5,7 @@ import { ipcMain } from 'electron';
|
|||||||
import { faker } from '@faker-js/faker';
|
import { faker } from '@faker-js/faker';
|
||||||
import * as moment from 'moment';
|
import * as moment from 'moment';
|
||||||
import { sqlEscaper } from 'common/libs/sqlUtils';
|
import { sqlEscaper } from 'common/libs/sqlUtils';
|
||||||
import { TEXT, LONG_TEXT, ARRAY, TEXT_SEARCH, NUMBER, FLOAT, BLOB, BIT, DATE, DATETIME } from 'common/fieldTypes';
|
import { TEXT, LONG_TEXT, ARRAY, TEXT_SEARCH, NUMBER, FLOAT, BLOB, BIT, DATE, DATETIME, BOOLEAN } from 'common/fieldTypes';
|
||||||
import customizations from 'common/customizations';
|
import customizations from 'common/customizations';
|
||||||
|
|
||||||
export default (connections: {[key: string]: antares.Client}) => {
|
export default (connections: {[key: string]: antares.Client}) => {
|
||||||
@ -153,6 +153,18 @@ export default (connections: {[key: string]: antares.Client}) => {
|
|||||||
escapedParam = `b'${sqlEscaper(params.content)}'`;
|
escapedParam = `b'${sqlEscaper(params.content)}'`;
|
||||||
reload = true;
|
reload = true;
|
||||||
}
|
}
|
||||||
|
else if (BOOLEAN.includes(params.type)) {
|
||||||
|
switch (connections[params.uid]._client) {
|
||||||
|
case 'mysql':
|
||||||
|
case 'maria':
|
||||||
|
case 'pg':
|
||||||
|
escapedParam = params.content;
|
||||||
|
break;
|
||||||
|
case 'sqlite':
|
||||||
|
escapedParam = Number(params.content === 'true');
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
else if (params.content === null)
|
else if (params.content === null)
|
||||||
escapedParam = 'NULL';
|
escapedParam = 'NULL';
|
||||||
else
|
else
|
||||||
|
Loading…
x
Reference in New Issue
Block a user