mirror of
https://github.com/Fabio286/antares.git
synced 2025-06-05 21:59:22 +02:00
fix(SQLite): update rows with a text primary key
This commit is contained in:
@ -7,8 +7,8 @@ module.exports = {
|
|||||||
views: true,
|
views: true,
|
||||||
triggers: true,
|
triggers: true,
|
||||||
// Settings
|
// Settings
|
||||||
elementsWrapper: '',
|
elementsWrapper: '"',
|
||||||
stringsWrapper: '"',
|
stringsWrapper: '\'',
|
||||||
tableAdd: true,
|
tableAdd: true,
|
||||||
viewAdd: true,
|
viewAdd: true,
|
||||||
triggerAdd: true,
|
triggerAdd: true,
|
||||||
|
@ -3,6 +3,7 @@ import faker from 'faker';
|
|||||||
import moment from 'moment';
|
import moment from 'moment';
|
||||||
import { sqlEscaper } from 'common/libs/sqlEscaper';
|
import { sqlEscaper } from 'common/libs/sqlEscaper';
|
||||||
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 } from 'common/fieldTypes';
|
||||||
|
import * as customizations from 'common/customizations';
|
||||||
import fs from 'fs';
|
import fs from 'fs';
|
||||||
|
|
||||||
export default (connections) => {
|
export default (connections) => {
|
||||||
@ -85,11 +86,12 @@ export default (connections) => {
|
|||||||
|
|
||||||
ipcMain.handle('update-table-cell', async (event, params) => {
|
ipcMain.handle('update-table-cell', async (event, params) => {
|
||||||
delete params.row._antares_id;
|
delete params.row._antares_id;
|
||||||
|
const { stringsWrapper: sw } = customizations[connections[params.uid]._client];
|
||||||
|
|
||||||
try { // TODO: move to client classes
|
try { // TODO: move to client classes
|
||||||
let escapedParam;
|
let escapedParam;
|
||||||
let reload = false;
|
let reload = false;
|
||||||
const id = typeof params.id === 'number' ? params.id : `"${params.id}"`;
|
const id = typeof params.id === 'number' ? params.id : `${sw}${params.id}${sw}`;
|
||||||
|
|
||||||
if ([...NUMBER, ...FLOAT].includes(params.type))
|
if ([...NUMBER, ...FLOAT].includes(params.type))
|
||||||
escapedParam = params.content;
|
escapedParam = params.content;
|
||||||
|
Reference in New Issue
Block a user