mirror of
https://github.com/Fabio286/antares.git
synced 2025-02-17 04:00:48 +01:00
refactor: remap of table data object
This commit is contained in:
parent
b7c779eef6
commit
936de04cd3
@ -34,6 +34,7 @@ This is a roadmap with major features will come in near future.
|
|||||||
- Users management (add/edit/delete).
|
- Users management (add/edit/delete).
|
||||||
- Stored procedures, views, schedulers and trigger support.
|
- Stored procedures, views, schedulers and trigger support.
|
||||||
- Database tools.
|
- Database tools.
|
||||||
|
- Improve query suggestions.
|
||||||
- Context menu shortcuts.
|
- Context menu shortcuts.
|
||||||
- Keyboard shortcuts.
|
- Keyboard shortcuts.
|
||||||
- More secure password storage.
|
- More secure password storage.
|
||||||
@ -48,7 +49,7 @@ This is a roadmap with major features will come in near future.
|
|||||||
### Databases
|
### Databases
|
||||||
|
|
||||||
- [x] MySQL/MariaDB
|
- [x] MySQL/MariaDB
|
||||||
- [ ] PostrgreSQL
|
- [ ] PostgreSQL
|
||||||
- [ ] MSSQL
|
- [ ] MSSQL
|
||||||
- [ ] SQLite
|
- [ ] SQLite
|
||||||
- [ ] OracleDB
|
- [ ] OracleDB
|
||||||
|
@ -62,9 +62,34 @@ export class MySQLClient extends AntaresCore {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return databases.map(db => { // TODO: remap all objects,
|
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 {
|
return {
|
||||||
name: db.Database,
|
name: db.Database,
|
||||||
tables: tables.filter(table => table.TABLE_SCHEMA === db.Database),
|
tables: tablesRemapped,
|
||||||
functions: functions.filter(func => func.Db === db.Database),
|
functions: functions.filter(func => func.Db === db.Database),
|
||||||
procedures: procedures.filter(procedure => procedure.Db === db.Database),
|
procedures: procedures.filter(procedure => procedure.Db === db.Database),
|
||||||
triggers: triggersArr.filter(trigger => trigger.Db === db.Database),
|
triggers: triggersArr.filter(trigger => trigger.Db === db.Database),
|
||||||
|
@ -15,15 +15,15 @@
|
|||||||
<ul class="menu menu-nav pt-0">
|
<ul class="menu menu-nav pt-0">
|
||||||
<li
|
<li
|
||||||
v-for="table of database.tables"
|
v-for="table of database.tables"
|
||||||
:key="table.TABLE_NAME"
|
:key="table.name"
|
||||||
class="menu-item"
|
class="menu-item"
|
||||||
:class="{'text-bold': breadcrumbs.schema === database.name && breadcrumbs.table === table.TABLE_NAME}"
|
:class="{'text-bold': breadcrumbs.schema === database.name && breadcrumbs.table === table.name}"
|
||||||
@click="changeBreadcrumbs({schema: database.name, table: table.TABLE_NAME})"
|
@click="changeBreadcrumbs({schema: database.name, table: table.name})"
|
||||||
@contextmenu.prevent="showTableContext($event, table.TABLE_NAME)"
|
@contextmenu.prevent="showTableContext($event, table.name)"
|
||||||
>
|
>
|
||||||
<a class="table-name">
|
<a class="table-name">
|
||||||
<i class="table-icon mdi mdi-18px mr-1" :class="table.TABLE_TYPE === 'VIEW' ? 'mdi-table-eye' : 'mdi-table'" />
|
<i class="table-icon mdi mdi-18px mr-1" :class="table.type === 'view' ? 'mdi-table-eye' : 'mdi-table'" />
|
||||||
<span>{{ table.TABLE_NAME }}</span>
|
<span>{{ table.name }}</span>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user