mirror of
https://github.com/Fabio286/antares.git
synced 2025-03-13 01:40:15 +01: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",
|
||||
"cwd": "${workspaceFolder}",
|
||||
"port": 9222,
|
||||
"protocol": "inspector",
|
||||
"request": "attach",
|
||||
"sourceMaps": true,
|
||||
"type": "node",
|
||||
@ -23,7 +22,6 @@
|
||||
"name": "Electron: Worker",
|
||||
"cwd": "${workspaceFolder}",
|
||||
"port": 9224,
|
||||
"protocol": "inspector",
|
||||
"request": "attach",
|
||||
"sourceMaps": true,
|
||||
"type": "node",
|
||||
|
@ -5,7 +5,7 @@ import { ipcMain } from 'electron';
|
||||
import { faker } from '@faker-js/faker';
|
||||
import * as moment from 'moment';
|
||||
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';
|
||||
|
||||
export default (connections: {[key: string]: antares.Client}) => {
|
||||
@ -153,6 +153,18 @@ export default (connections: {[key: string]: antares.Client}) => {
|
||||
escapedParam = `b'${sqlEscaper(params.content)}'`;
|
||||
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)
|
||||
escapedParam = 'NULL';
|
||||
else
|
||||
|
Loading…
x
Reference in New Issue
Block a user