Connect Postgres database after its created (#1596)
This commit is contained in:
Родитель
f7f582d25c
Коммит
bdd0b6d1f9
|
@ -9,12 +9,14 @@ import { ext } from '../../extensionVariables';
|
|||
import { localize } from '../../utils/localize';
|
||||
import { PostgresDatabaseTreeItem } from '../tree/PostgresDatabaseTreeItem';
|
||||
import { PostgresServerTreeItem } from '../tree/PostgresServerTreeItem';
|
||||
import { connectPostgresDatabase } from './connectPostgresDatabase';
|
||||
|
||||
export async function createPostgresDatabase(context: IActionContext, node?: PostgresServerTreeItem): Promise<void> {
|
||||
if (!node) {
|
||||
node = <PostgresServerTreeItem>await ext.tree.showTreeItemPicker(PostgresServerTreeItem.contextValue, context);
|
||||
}
|
||||
const newDatabase: PostgresDatabaseTreeItem = await node.createChild(context);
|
||||
await connectPostgresDatabase(context, newDatabase);
|
||||
const createMessage: string = localize('createPostgresDatabaseMsg', 'Successfully created database "{0}".', newDatabase.databaseName);
|
||||
vscode.window.showInformationMessage(createMessage);
|
||||
ext.outputChannel.appendLog(createMessage);
|
||||
|
|
Загрузка…
Ссылка в новой задаче