MCPcopy Create free account
hub / github.com/cmoog/vscode-sql-notebook / deleteConnectionConfiguration

Function deleteConnectionConfiguration

src/commands.ts:11–28  ·  view source on GitHub ↗
(
  context: vscode.ExtensionContext,
  connectionsSidepanel: SQLNotebookConnections
)

Source from the content-addressed store, hash-verified

9import { getCompiledLSPBinaryPath, sqlsDriverFromDriver } from './lsp';
10
11export function deleteConnectionConfiguration(
12 context: vscode.ExtensionContext,
13 connectionsSidepanel: SQLNotebookConnections
14) {
15 return async (item: ConnectionListItem) => {
16 const without = context.globalState
17 .get<ConnData[]>(storageKey, [])
18 .filter(({ name }) => name !== item.config.name);
19 context.globalState.update(storageKey, without);
20 await context.secrets.delete(item.config.name);
21
22 connectionsSidepanel.refresh();
23 vscode.window.showInformationMessage(
24 `Successfully deleted connection configuration "${item.config.name}"`
25 );
26 connectionsSidepanel.refresh();
27 };
28}
29
30export function connectToDatabase(
31 context: vscode.ExtensionContext,

Callers 1

activateFunction · 0.90

Calls 1

refreshMethod · 0.80

Tested by

no test coverage detected