diff --git a/README.md b/README.md index 40d9b8c6..294e177f 100644 --- a/README.md +++ b/README.md @@ -34,6 +34,7 @@ This is a roadmap with major features will come in near future. - Users management (add/edit/delete). - Stored procedures, views, schedulers and trigger support. - Database tools. +- Improve query suggestions. - Context menu shortcuts. - Keyboard shortcuts. - More secure password storage. @@ -48,7 +49,7 @@ This is a roadmap with major features will come in near future. ### Databases - [x] MySQL/MariaDB -- [ ] PostrgreSQL +- [ ] PostgreSQL - [ ] MSSQL - [ ] SQLite - [ ] OracleDB diff --git a/src/main/libs/clients/MySQLClient.js b/src/main/libs/clients/MySQLClient.js index af70591c..e8e96d41 100644 --- a/src/main/libs/clients/MySQLClient.js +++ b/src/main/libs/clients/MySQLClient.js @@ -62,9 +62,34 @@ export class MySQLClient extends AntaresCore { } return databases.map(db => { // TODO: remap all objects, + const tablesRemapped = tables.filter(table => table.TABLE_SCHEMA === db.Database).map(table => { + let tableType; + switch (table.TABLE_TYPE) { + case 'VIEW': + tableType = 'view'; + break; + default: + tableType = 'table'; + break; + } + + return { + name: table.TABLE_NAME, + type: tableType, + rows: table.TABLE_ROWS, + created: table.CREATE_TIME, + updated: table.UPDATE_TIME, + engine: table.ENGINE, + comment: table.TABLE_COMMENT, + size: table.DATA_LENGTH + table.INDEX_LENGTH, + autoIncrement: table.AUTO_INCREMENT, + collation: table.TABLE_COLLATION + }; + }); + return { name: db.Database, - tables: tables.filter(table => table.TABLE_SCHEMA === db.Database), + tables: tablesRemapped, functions: functions.filter(func => func.Db === db.Database), procedures: procedures.filter(procedure => procedure.Db === db.Database), triggers: triggersArr.filter(trigger => trigger.Db === db.Database), diff --git a/src/renderer/components/WorkspaceExploreBarDatabase.vue b/src/renderer/components/WorkspaceExploreBarDatabase.vue index aa783ed5..c38fef0b 100644 --- a/src/renderer/components/WorkspaceExploreBarDatabase.vue +++ b/src/renderer/components/WorkspaceExploreBarDatabase.vue @@ -15,15 +15,15 @@