MCPcopy Create free account
hub / github.com/Borvik/vscode-postgres / setUsername

Method setUsername

src/commands/addConnection.ts:79–91  ·  view source on GitHub ↗
(input: MultiStepInput, state: Partial<ConnectionState>)

Source from the content-addressed store, hash-verified

77 }
78
79 async setUsername(input: MultiStepInput, state: Partial<ConnectionState>) {
80 state.user = await input.showInputBox({
81 title: this.TITLE,
82 step: input.CurrentStepNumber,
83 totalSteps: this.TotalSteps,
84 prompt: 'The PostgreSQL user to authenticate as',
85 placeholder: 'ex. root',
86 ignoreFocusOut: true,
87 value: (typeof state.user === 'string') ? state.user : '',
88 validate: async (value) => (!value || !value.trim()) ? 'Username is required' : ''
89 });
90 return (input: MultiStepInput) => this.setPassword(input, state);
91 }
92
93 async setPassword(input: MultiStepInput, state: Partial<ConnectionState>) {
94 state.password = await input.showInputBox({

Callers 1

setHostNameMethod · 0.95

Calls 2

setPasswordMethod · 0.95
showInputBoxMethod · 0.80

Tested by

no test coverage detected