From c54438d6d3bad38bc76dfcd61f58929fe30279cb Mon Sep 17 00:00:00 2001 From: Fabio Di Stasio Date: Sat, 13 Nov 2021 11:34:30 +0100 Subject: [PATCH 01/10] feat(SQLite): connection add/edit masks --- .vscode/settings.json | 3 +- src/common/customizations/defaults.js | 3 + src/common/customizations/index.js | 3 +- src/common/customizations/mysql.js | 2 + src/common/customizations/postgresql.js | 2 + src/common/customizations/sqlite.js | 81 +++++++++++++++++++ .../WorkspaceAddConnectionPanel.vue | 52 +++++++----- .../WorkspaceEditConnectionPanel.vue | 47 +++++++---- .../images/svg/{sqllite.svg => sqlite.svg} | 0 src/renderer/scss/_db-icons.scss | 4 + .../store/modules/connections.store.js | 24 ++++-- 11 files changed, 180 insertions(+), 41 deletions(-) create mode 100644 src/common/customizations/sqlite.js rename src/renderer/images/svg/{sqllite.svg => sqlite.svg} (100%) diff --git a/.vscode/settings.json b/.vscode/settings.json index 5b0c8130..649205af 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -3,7 +3,8 @@ "UI", "core", "MySQL", - "PostgreSQL" + "PostgreSQL", + "SQLite" ], "svg.preview.background": "transparent" } \ No newline at end of file diff --git a/src/common/customizations/defaults.js b/src/common/customizations/defaults.js index 062836a2..70b5295a 100644 --- a/src/common/customizations/defaults.js +++ b/src/common/customizations/defaults.js @@ -8,6 +8,9 @@ module.exports = { collations: false, engines: false, connectionSchema: false, + sslConnection: false, + sshConnection: false, + fileConnection: false, // Tools processesList: false, usersManagement: false, diff --git a/src/common/customizations/index.js b/src/common/customizations/index.js index 304889a4..931e18f2 100644 --- a/src/common/customizations/index.js +++ b/src/common/customizations/index.js @@ -1,5 +1,6 @@ module.exports = { maria: require('./mysql'), mysql: require('./mysql'), - pg: require('./postgresql') + pg: require('./postgresql'), + sqlite: require('./sqlite') }; diff --git a/src/common/customizations/mysql.js b/src/common/customizations/mysql.js index 673adea2..0b6c683e 100644 --- a/src/common/customizations/mysql.js +++ b/src/common/customizations/mysql.js @@ -10,6 +10,8 @@ module.exports = { connectionSchema: true, collations: true, engines: true, + sslConnection: true, + sshConnection: true, // Tools processesList: true, // Structure diff --git a/src/common/customizations/postgresql.js b/src/common/customizations/postgresql.js index b3547ccc..341aa538 100644 --- a/src/common/customizations/postgresql.js +++ b/src/common/customizations/postgresql.js @@ -8,6 +8,8 @@ module.exports = { defaultDatabase: 'postgres', // Core database: true, + sslConnection: true, + sshConnection: true, // Tools processesList: true, // Structure diff --git a/src/common/customizations/sqlite.js b/src/common/customizations/sqlite.js new file mode 100644 index 00000000..96e2a56f --- /dev/null +++ b/src/common/customizations/sqlite.js @@ -0,0 +1,81 @@ +module.exports = { + // Defaults + defaultPort: null, + defaultUser: null, + defaultDatabase: null, + // Core + database: false, + collations: false, + engines: false, + connectionSchema: false, + fileConnection: true, + // Tools + processesList: false, + usersManagement: false, + variables: false, + // Structure + schemas: false, + tables: false, + views: false, + triggers: false, + triggerFunctions: false, + routines: false, + functions: false, + schedulers: false, + // Settings + elementsWrapper: '', + stringsWrapper: '"', + tableAdd: false, + viewAdd: false, + triggerAdd: false, + triggerFunctionAdd: false, + routineAdd: false, + functionAdd: false, + schedulerAdd: false, + databaseEdit: false, + schemaEdit: false, + tableSettings: false, + viewSettings: false, + triggerSettings: false, + triggerFunctionSettings: false, + routineSettings: false, + functionSettings: false, + schedulerSettings: false, + indexes: false, + foreigns: false, + sortableFields: false, + unsigned: false, + nullable: false, + zerofill: false, + tableOptions: false, + autoIncrement: false, + comment: false, + collation: false, + definer: false, + onUpdate: false, + tableArray: false, + viewAlgorithm: false, + viewSqlSecurity: false, + viewUpdateOption: false, + procedureDeterministic: false, + procedureDataAccess: false, + procedureSql: false, + procedureContext: false, + procedureLanguage: false, + functionDeterministic: false, + functionDataAccess: false, + functionSql: false, + functionContext: false, + functionLanguage: false, + triggerSql: false, + triggerStatementInCreation: false, + triggerMultipleEvents: false, + triggerTableInName: false, + triggerUpdateColumns: false, + triggerOnlyRename: false, + triggerEnableDisable: false, + triggerFunctionSql: false, + triggerFunctionlanguages: false, + parametersLength: false, + languages: false +}; diff --git a/src/renderer/components/WorkspaceAddConnectionPanel.vue b/src/renderer/components/WorkspaceAddConnectionPanel.vue index e8802235..ede77563 100644 --- a/src/renderer/components/WorkspaceAddConnectionPanel.vue +++ b/src/renderer/components/WorkspaceAddConnectionPanel.vue @@ -11,6 +11,7 @@ {{ $t('word.general') }}
  • {{ $t('word.ssl') }}
  • -
    +
    @@ -79,7 +73,20 @@ >
    -
    +
    +
    + +
    +
    + +
    +
    +
    @@ -105,7 +112,7 @@ >
    -
    +
    @@ -118,7 +125,7 @@ >
    -
    +
    @@ -144,7 +151,7 @@ >
    -
    +
  • {{ $t('word.ssl') }}
  • -
    +
    @@ -73,7 +73,20 @@ >
    -
    +
    +
    + +
    +
    + +
    +
    +
    @@ -99,7 +112,7 @@ >
    -
    +
    @@ -112,7 +125,7 @@ >
    -
    +
    @@ -138,7 +151,7 @@ >
    -
    +