Coverage for pystratum_cli/command/RoutineWrapperCommand.py : 100%

Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
1from cleo.helpers import argument
3from pystratum_cli.command.BaseCommand import BaseCommand
6class RoutineWrapperCommand(BaseCommand):
7 """
8 Command for generating a class with wrapper methods for invoking stored routines in a database instance.
9 """
10 name = 'wrapper'
11 description = ('Command for generating a class with wrapper methods for invoking stored routines in a database '
12 'instance.')
13 arguments = [argument(name='config_file', description='The stratum configuration file.')]
15 # ------------------------------------------------------------------------------------------------------------------
16 def handle(self) -> int:
17 """
18 Executes constants command when StratumCommand is activated.
19 """
20 self._read_config_file()
22 factory = self._create_backend_factory()
23 worker = factory.create_routine_wrapper_generator_worker(self._config, self._io)
25 if not worker:
26 self._io.title('Wrapper')
27 self._io.error('<error>Wrapper command is not implemented by the backend</>')
28 return -1
30 return worker.execute()
32# ----------------------------------------------------------------------------------------------------------------------