runWithConfig method
Runs this command with prepared configuration (options). Subclasses should override this method.
Implementation
@override
Future<void> runWithConfig(
final Configuration<DbUserCreateOption> commandConfig,
) async {
final projectId = commandConfig.value(DbUserCreateOption.projectId);
final username = commandConfig.value(DbUserCreateOption.username);
final apiCloudClient = runner.serviceProvider.cloudApiClient;
try {
final password = await apiCloudClient.database.createSuperUser(
cloudCapsuleId: projectId,
username: username,
);
logger.success('''
DB superuser created. The password is only shown this once:
$password''');
} on Exception catch (e, stackTrace) {
throw FailureException.nested(
e,
stackTrace,
'Failed to create superuser',
);
}
}