mirror of
https://github.com/t8y2/dbx.git
synced 2026-11-01 00:25:38 +00:00
fix(completion): prevent PostgreSQL completion failure from breaking all subsequent completions (#131)
This commit is contained in:
@@ -669,12 +669,16 @@ export const useConnectionStore = defineStore("connection", () => {
|
||||
const schemas = await api.listSchemas(connectionId, database);
|
||||
const tableGroups = await Promise.all(
|
||||
schemas.map(async (schema) => {
|
||||
const tables = await api.listTables(connectionId, database, schema);
|
||||
return tables.map((table) => ({
|
||||
name: table.name,
|
||||
schema,
|
||||
type: table.table_type === "VIEW" ? ("view" as const) : ("table" as const),
|
||||
}));
|
||||
try {
|
||||
const tables = await api.listTables(connectionId, database, schema);
|
||||
return tables.map((table) => ({
|
||||
name: table.name,
|
||||
schema,
|
||||
type: table.table_type === "VIEW" ? ("view" as const) : ("table" as const),
|
||||
}));
|
||||
} catch {
|
||||
return [];
|
||||
}
|
||||
}),
|
||||
);
|
||||
completionTablesCache.value[cacheKey] = tableGroups.flat();
|
||||
|
||||
Reference in New Issue
Block a user