diff --git a/README.md b/README.md index 88d3b0a7..33ec2a35 100644 --- a/README.md +++ b/README.md @@ -33,6 +33,7 @@ An application created with minimalism and semplicity in mind, with features in - Database management (add/edit/delete). - Full tables management, including indexes and foreign keys. - Views, triggers, stored routines, functions and schedulers management (add/edit/delete). +- Fake table data filler. - Run queries on multiple tabs. - Query suggestions and auto complete. - Native dark theme. @@ -53,7 +54,6 @@ This is a roadmap with major features will come in near future. - More context menu shortcuts. - More keyboard shortcuts. - Query logs console. -- Fake data filler. - Import/export and migration. - Light theme. @@ -98,7 +98,7 @@ Depending on your distribution, you will need to run the following command: **Italian Translation** (46%) / [Giuseppe Gigliotti](https://github.com/ReverbOD) [[#20](https://github.com/Fabio286/antares/pull/20)] **Arabic Translation** (45%) / [Mohd-PH](https://github.com/Mohd-PH) [[#29](https://github.com/Fabio286/antares/pull/29)] **Spanish Translation** (46%) / [hongkfui](https://github.com/hongkfui) [[#32](https://github.com/Fabio286/antares/pull/32)] -**French Translation** (100%) / [MrAnyx](https://github.com/MrAnyx) [[#32](https://github.com/Fabio286/antares/pull/44)] +**French Translation** (100%) / [MrAnyx](https://github.com/MrAnyx) [[#44](https://github.com/Fabio286/antares/pull/44)] ## Reviews diff --git a/src/renderer/components/WorkspaceQueryTableRow.vue b/src/renderer/components/WorkspaceQueryTableRow.vue index 81419faa..10337813 100644 --- a/src/renderer/components/WorkspaceQueryTableRow.vue +++ b/src/renderer/components/WorkspaceQueryTableRow.vue @@ -16,7 +16,7 @@ @dblclick="editON($event, col, cKey)" >{{ col | typeFormat(getFieldType(cKey), getFieldPrecision(cKey)) | cutText }} key.field); }, isEditable () { - return this.fields ? !!(this.fields[0].schema && this.fields[0].table) : false; + if (this.fields) { + const nElements = this.fields.reduce((acc, curr) => { + acc.add(curr.table); + acc.add(curr.schema); + return acc; + }, new Set([])); + + if (nElements.size > 2) return false; + + return !!(this.fields[0].schema && this.fields[0].table); + } + + return false; } }, watch: { @@ -271,6 +283,12 @@ export default { } }, methods: { + isForeignKey (key) { + if (key.includes('.')) + key = key.split('.').pop(); + + return this.foreignKeys.includes(key); + }, getFieldType (cKey) { let type = 'unknown'; const field = this.getFieldObj(cKey); @@ -423,6 +441,8 @@ export default { this.$emit('select-row', event, row); }, getKeyUsage (keyName) { + if (keyName.includes('.')) + return this.keyUsage.find(key => key.field === keyName.split('.').pop()); return this.keyUsage.find(key => key.field === keyName); } }