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

11 statements  

« prev     ^ index     » next       coverage.py v7.2.7, created at 2024-05-12 12:02 +0200

1from pystratum_cli.command.BaseCommand import BaseCommand 

2 

3 

4class RoutineWrapperCommand(BaseCommand): 

5 """ 

6 Command for generating a class with wrapper methods for invoking stored routines in a database instance. 

7 

8 wrapper 

9 {config_file : The stratum configuration file} 

10 """ 

11 

12 # ------------------------------------------------------------------------------------------------------------------ 

13 def handle(self) -> int: 

14 """ 

15 Executes constants command when StratumCommand is activated. 

16 """ 

17 self._read_config_file(self.input) 

18 

19 factory = self._create_backend_factory() 

20 worker = factory.create_routine_wrapper_generator_worker(self._config, self._io) 

21 

22 if not worker: 

23 self._io.title('Wrapper') 

24 self._io.error('Wrapper command is not implemented by the backend') 

25 return -1 

26 

27 return worker.execute() 

28 

29# ----------------------------------------------------------------------------------------------------------------------