runWithOutput method

  1. @override
Future<void> runWithOutput(
  1. Configuration<DbUserDeleteOption> commandConfig,
  2. CommandOutput output
)
override

Runs this command with prepared configuration and output.

Subclasses should override this method.

Implementation

@override
Future<void> runWithOutput(
  final Configuration<DbUserDeleteOption> commandConfig,
  final CommandOutput output,
) async {
  final projectId = commandConfig.value(DbUserDeleteOption.projectId);
  final username = commandConfig.value(DbUserDeleteOption.username);

  await confirmToContinue(
    output,
    message:
        'Permanently delete database user "$username" for project "$projectId"? '
        'This action cannot be undone.',
    defaultValue: false,
  );

  await renderCommand(
    output,
    operation: () => DbOperations.deleteDatabaseUser(
      runner.serviceProvider.cloudApiClient,
      projectId: projectId,
      username: username,
    ),
    textOutputUi: const DbUserDeleteTextUi(),
  );
}