fix(database): 保留数据库名称前导空格 (#3509)
This commit is contained in:
6 files changed
+70
-11
No files matched your search
@@ -17,8 +17,8 @@ export function sortSidebarDatabases(databases: readonly DatabaseInfo[]): Databa
|
||||
|
||||
export function buildDatabaseTreeNodes(connectionId: string, databases: DatabaseInfo[], options: { includeDefaultWhenEmpty?: boolean } = {}): TreeNode[] {
|
||||
const nodes = sortSidebarDatabases(databases).flatMap((db) => {
|
||||
const name = db.name.trim();
|
||||
if (!name) return [];
|
||||
const name = db.name;
|
||||
if (!name.trim()) return [];
|
||||
return [
|
||||
{
|
||||
id: `${connectionId}:${name}`,
|
||||
@@ -66,8 +66,8 @@ export function buildDuckDbConnectionTreeNodes(connectionId: string, databases:
|
||||
});
|
||||
|
||||
const attachedCatalogNodes = sortSidebarDatabases(databases).flatMap((db) => {
|
||||
const name = db.name.trim();
|
||||
if (!name || name === "main") return [];
|
||||
const name = db.name;
|
||||
if (!name.trim() || name === "main") return [];
|
||||
return [
|
||||
{
|
||||
id: `${connectionId}:${name}`,
|
||||
|
||||
@@ -2249,7 +2249,7 @@ export const useConnectionStore = defineStore("connection", () => {
|
||||
setChildren(node, children);
|
||||
await savePersistedConnectionTreeChildren(cacheKey, node.children || children);
|
||||
} else {
|
||||
const cacheKey = schemaCacheKey(connectionId, "databases");
|
||||
const cacheKey = schemaCacheKey(connectionId, "databases-v2");
|
||||
if (!options?.force) {
|
||||
const cached = await loadPersistedTreeChildren(node, cacheKey);
|
||||
if (cached.hit) {
|
||||
|
||||
Reference in new issue
Block a user