feat(export): add all-database export
This commit is contained in:
1 parent
f16454a403
commit
82e9df1853
14 files changed
+418
-9
No files matched your search
@@ -3409,6 +3409,16 @@ function openDatabaseExport() {
|
||||
};
|
||||
}
|
||||
|
||||
function openAllDatabasesExport() {
|
||||
const node = props.node;
|
||||
if (node.type !== "connection" || !node.connectionId) return;
|
||||
connectionStore.databaseExportSource = {
|
||||
connectionId: node.connectionId,
|
||||
database: "",
|
||||
allDatabases: true,
|
||||
};
|
||||
}
|
||||
|
||||
function openTableImport() {
|
||||
const node = props.node;
|
||||
if (node.type !== "table" || !node.connectionId || !node.database) return;
|
||||
@@ -3449,6 +3459,11 @@ const canPin = computed(() => canTreeNodePin(props.node.type));
|
||||
const canOpenSqlFileExecution = computed(() => {
|
||||
return supportsSqlFileExecution(rawDatabaseType());
|
||||
});
|
||||
const canExportAllDatabases = computed(() => {
|
||||
if (props.node.type !== "connection" || !props.node.connectionId) return false;
|
||||
const dbType = connectionStore.getConfig(props.node.connectionId)?.db_type;
|
||||
return !["redis", "mongodb", "elasticsearch", "qdrant", "milvus", "weaviate", "chromadb", "etcd", "zookeeper", "mq", "nacos"].includes(dbType || "");
|
||||
});
|
||||
const canOpenDiagram = computed(() => {
|
||||
return !!props.node.database && supportsSchemaDiagram(currentDatabaseType());
|
||||
});
|
||||
@@ -3957,6 +3972,9 @@ function treeItemMenuItems(): ContextMenuItem[] {
|
||||
if (canOpenSqlFileExecution.value) {
|
||||
items.push({ label: t("sqlFile.title"), action: openSqlFileExecution, icon: FileCode });
|
||||
}
|
||||
if (canExportAllDatabases.value) {
|
||||
items.push({ label: t("contextMenu.exportAllDatabases"), action: openAllDatabasesExport, icon: Upload });
|
||||
}
|
||||
if (canCreateDatabase.value) {
|
||||
items.push({
|
||||
label: isDuckDbConnection.value ? t("contextMenu.createDuckDbFile") : t("contextMenu.createDatabase"),
|
||||
|
||||
Reference in new issue
Block a user