diff --git a/src/renderer/components/Workspace.vue b/src/renderer/components/Workspace.vue
index 626ce6d0..5244d7ac 100644
--- a/src/renderer/components/Workspace.vue
+++ b/src/renderer/components/Workspace.vue
@@ -48,7 +48,7 @@
-
{{ $t('word.data').toUpperCase() }}: {{ schemaChild }}
-
+ -->
-
+
Query #{{ tab.index }}
@@ -90,18 +90,22 @@
/>
+
+
+ {{ tab.table }}
+
-
-
- -->
+
+ class="column col-12"
+ >
+
+
+
tab.uid === this.workspace.selected_tab) ||
- ['data', 'prop'].includes(this.workspace.selected_tab)
- ? this.workspace.selected_tab
- : this.queryTabs[0].uid;
+ // return this.queryTabs.find(tab => tab.uid === this.workspace.selected_tab) ||
+ // ['data', 'prop'].includes(this.workspace.selected_tab)
+ // ? this.workspace.selected_tab
+ // : this.queryTabs[0].uid;
+
+ return this.workspace.selected_tab;
},
queryTabs () {
return this.workspace.tabs.filter(tab => tab.type === 'query');
@@ -286,8 +301,8 @@ export default {
newTab: 'workspaces/newTab',
removeTab: 'workspaces/removeTab'
}),
- addTab () {
- this.newTab({ uid: this.connection.uid });
+ addQueryTab () {
+ this.newTab({ uid: this.connection.uid, type: 'query' });
if (!this.hasWheelEvent) {
this.$refs.tabWrap.addEventListener('wheel', e => {
diff --git a/src/renderer/components/WorkspaceExploreBarMiscContext.vue b/src/renderer/components/WorkspaceExploreBarMiscContext.vue
index 819a27b4..89f5321f 100644
--- a/src/renderer/components/WorkspaceExploreBarMiscContext.vue
+++ b/src/renderer/components/WorkspaceExploreBarMiscContext.vue
@@ -218,7 +218,7 @@ export default {
sql = `CALL \`${this.localElement.name}\`(${params.join(',')})`;
}
- this.newTab({ uid: this.workspace.uid, content: sql, autorun: true });
+ this.newTab({ uid: this.workspace.uid, content: sql, type: 'query', autorun: true });
this.closeContext();
},
async runFunctionCheck () {
diff --git a/src/renderer/components/WorkspaceExploreBarSchema.vue b/src/renderer/components/WorkspaceExploreBarSchema.vue
index fec7022b..75714882 100644
--- a/src/renderer/components/WorkspaceExploreBarSchema.vue
+++ b/src/renderer/components/WorkspaceExploreBarSchema.vue
@@ -19,7 +19,7 @@
:key="table.name"
class="menu-item"
:class="{'text-bold': breadcrumbs.schema === database.name && [breadcrumbs.table, breadcrumbs.view].includes(table.name)}"
- @click="setBreadcrumbs({schema: database.name, [table.type]: table.name})"
+ @click="selectTable({schema: database.name, table})"
@contextmenu.prevent="showTableContext($event, table)"
>
@@ -267,6 +267,7 @@ export default {
methods: {
...mapActions({
changeBreadcrumbs: 'workspaces/changeBreadcrumbs',
+ newTab: 'workspaces/newTab',
refreshSchema: 'workspaces/refreshSchema'
}),
formatBytes,
@@ -279,6 +280,11 @@ export default {
this.changeBreadcrumbs({ schema, table: null });
},
+ selectTable ({ schema, table }) {
+ this.setBreadcrumbs({ schema, [table.type]: table.name });
+ // TODO: open only if not present
+ this.newTab({ uid: this.connection.uid, table: table.name, schema: this.database.name, type: 'temp-data' });
+ },
showSchemaContext (event, schema) {
this.selectSchema(schema);
this.$emit('show-schema-context', { event, schema });
diff --git a/src/renderer/components/WorkspacePropsTabFunction.vue b/src/renderer/components/WorkspacePropsTabFunction.vue
index eb92e48f..74ada258 100644
--- a/src/renderer/components/WorkspacePropsTabFunction.vue
+++ b/src/renderer/components/WorkspacePropsTabFunction.vue
@@ -303,7 +303,7 @@ export default {
sql = `SELECT \`${this.originalFunction.name}\` (${params.join(',')})`;
}
- this.newTab({ uid: this.connection.uid, content: sql, autorun: true });
+ this.newTab({ uid: this.connection.uid, content: sql, type: 'query', autorun: true });
},
showOptionsModal () {
this.isOptionsModal = true;
diff --git a/src/renderer/components/WorkspacePropsTabRoutine.vue b/src/renderer/components/WorkspacePropsTabRoutine.vue
index 0964e54c..b9ba1099 100644
--- a/src/renderer/components/WorkspacePropsTabRoutine.vue
+++ b/src/renderer/components/WorkspacePropsTabRoutine.vue
@@ -299,7 +299,7 @@ export default {
sql = `CALL \`${this.originalRoutine.name}\`(${params.join(',')})`;
}
- this.newTab({ uid: this.connection.uid, content: sql, autorun: true });
+ this.newTab({ uid: this.connection.uid, content: sql, type: 'query', autorun: true });
},
showOptionsModal () {
this.isOptionsModal = true;
diff --git a/src/renderer/components/WorkspacePropsTabTriggerFunction.vue b/src/renderer/components/WorkspacePropsTabTriggerFunction.vue
index 718ca9f3..2cffae33 100644
--- a/src/renderer/components/WorkspacePropsTabTriggerFunction.vue
+++ b/src/renderer/components/WorkspacePropsTabTriggerFunction.vue
@@ -281,7 +281,7 @@ export default {
sql = `SELECT \`${this.originalFunction.name}\` (${params.join(',')})`;
}
- this.newTab({ uid: this.connection.uid, content: sql, autorun: true });
+ this.newTab({ uid: this.connection.uid, content: sql, type: 'query', autorun: true });
},
showOptionsModal () {
this.isOptionsModal = true;
diff --git a/src/renderer/components/WorkspaceQueryTab.vue b/src/renderer/components/WorkspaceQueryTab.vue
index 0c4a1b04..4e3d3d0d 100644
--- a/src/renderer/components/WorkspaceQueryTab.vue
+++ b/src/renderer/components/WorkspaceQueryTab.vue
@@ -1,7 +1,7 @@