diff --git a/src/common/fieldTypes.js b/src/common/fieldTypes.js index 066ecb1b..5ae03e3f 100644 --- a/src/common/fieldTypes.js +++ b/src/common/fieldTypes.js @@ -7,11 +7,19 @@ export const TEXT = [ export const LONG_TEXT = [ 'TEXT', 'MEDIUMTEXT', - 'LONGTEXT', + 'LONGTEXT' +]; + +export const ARRAY = [ 'ARRAY', 'ANYARRAY' ]; +export const TEXT_SEARCH = [ + 'TSVECTOR', + 'TSQUERY' +]; + export const NUMBER = [ 'INT', 'TINYINT', @@ -49,6 +57,7 @@ export const TIME = [ export const DATETIME = [ 'DATETIME', 'TIMESTAMP', + 'TIMESTAMP WITHOUT TIME ZONE', 'TIMESTAMP WITH TIME ZONE' ]; diff --git a/src/main/ipc-handlers/tables.js b/src/main/ipc-handlers/tables.js index 10f87a83..cb6ee000 100644 --- a/src/main/ipc-handlers/tables.js +++ b/src/main/ipc-handlers/tables.js @@ -2,7 +2,7 @@ import { ipcMain } from 'electron'; import faker from 'faker'; import moment from 'moment'; import { sqlEscaper } from 'common/libs/sqlEscaper'; -import { TEXT, LONG_TEXT, 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 fs from 'fs'; export default (connections) => { @@ -68,6 +68,10 @@ export default (connections) => { escapedParam = params.content; else if ([...TEXT, ...LONG_TEXT].includes(params.type)) escapedParam = `"${sqlEscaper(params.content)}"`; + else if (ARRAY.includes(params.type)) + escapedParam = `'${params.content}'`; + else if (TEXT_SEARCH.includes(params.type)) + escapedParam = `'${params.content.replaceAll('\'', '\'\'')}'`; else if (BLOB.includes(params.type)) { if (params.content) { const fileBlob = fs.readFileSync(params.content); diff --git a/src/renderer/components/WorkspaceExploreBarSchema.vue b/src/renderer/components/WorkspaceExploreBarSchema.vue index a6ee1508..abb398fa 100644 --- a/src/renderer/components/WorkspaceExploreBarSchema.vue +++ b/src/renderer/components/WorkspaceExploreBarSchema.vue @@ -37,7 +37,7 @@ -