Skip to content

Commit

Permalink
chore: update listDatabases to use nameOnly: true (#818)
Browse files Browse the repository at this point in the history
  • Loading branch information
Anemy authored Sep 16, 2024
1 parent 3f720ab commit c184bea
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
4 changes: 3 additions & 1 deletion src/explorer/connectionTreeItem.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,9 @@ export default class ConnectionTreeItem
}

try {
const dbs = await dataService.listDatabases();
const dbs = await dataService.listDatabases({
nameOnly: true,
});
return dbs.map((dbItem) => dbItem.name);
} catch (error) {
throw new Error(
Expand Down
8 changes: 6 additions & 2 deletions src/participant/participant.ts
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,9 @@ export default class ParticipantController {
}

try {
const databases = await dataService.listDatabases();
const databases = await dataService.listDatabases({
nameOnly: true,
});
return databases.map((db) => ({
label: db.name,
data: db.name,
Expand Down Expand Up @@ -408,7 +410,9 @@ export default class ParticipantController {
}

try {
const databases = await dataService.listDatabases();
const databases = await dataService.listDatabases({
nameOnly: true,
});
return [
...databases.slice(0, MAX_MARKDOWN_LIST_LENGTH).map((db) =>
this._createMarkdownLink({
Expand Down

0 comments on commit c184bea

Please sign in to comment.