Passed
Push — master ( 47c3cf...c030a9 )
by P.R.
01:09
created

pystratum_mssql.backend.MsSqlBackend   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 56
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 3
eloc 18
dl 0
loc 56
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A MsSqlBackend.create_routine_wrapper_generator_worker() 0 11 1
A MsSqlBackend.create_constant_worker() 0 10 1
A MsSqlBackend.create_routine_loader_worker() 0 10 1
1
from configparser import ConfigParser
2
from typing import Optional
3
4
from pystratum_backend.Backend import Backend
5
from pystratum_backend.ConstantWorker import ConstantWorker
6
from pystratum_backend.RoutineLoaderWorker import RoutineLoaderWorker
7
from pystratum_backend.RoutineWrapperGeneratorWorker import RoutineWrapperGeneratorWorker
8
from pystratum_backend.StratumStyle import StratumStyle
9
10
from pystratum_mssql.backend.MsSqlConstantWorker import MsSqlConstantWorker
11
from pystratum_mssql.backend.MsSqlRoutineLoaderWorker import MsSqlRoutineLoaderWorker
12
from pystratum_mssql.backend.MsSqlRoutineWrapperGeneratorWorker import MsSqlRoutineWrapperGeneratorWorker
13
14
15
class MsSqlBackend(Backend):
16
    """
17
    PyStratum Backend for MS SQL Server.
18
    """
19
20
    # ------------------------------------------------------------------------------------------------------------------
21
    def create_constant_worker(self, config: ConfigParser, io: StratumStyle) -> Optional[ConstantWorker]:
22
        """
23
        Creates the object that does the actual execution of the constant command for the backend.
24
25
        :param ConfigParser config: The settings from the PyStratum configuration file.
26
        :param StratumStyle io: The output object.
27
28
        :rtype: ConstantWorker|None
29
        """
30
        return MsSqlConstantWorker(io, config)
31
32
    # ------------------------------------------------------------------------------------------------------------------
33
    def create_routine_loader_worker(self, config: ConfigParser, io: StratumStyle) -> Optional[RoutineLoaderWorker]:
34
        """
35
        Creates the object that does the actual execution of the routine loader command for the backend.
36
37
        :param ConfigParser config: The settings from the PyStratum configuration file.
38
        :param StratumStyle io: The output object.
39
40
        :rtype: RoutineLoaderWorker|None
41
        """
42
        return MsSqlRoutineLoaderWorker(io, config)
43
44
    # ------------------------------------------------------------------------------------------------------------------
45
    def create_routine_wrapper_generator_worker(self, config: ConfigParser, io: StratumStyle) \
46
            -> Optional[RoutineWrapperGeneratorWorker]:
47
        """
48
        Creates the object that does the actual execution of the routine wrapper generator command for the backend.
49
50
        :param ConfigParser config: The settings from the PyStratum configuration file.
51
        :param StratumStyle io: The output object.
52
53
        :rtype: RoutineWrapperGeneratorWorker|None
54
        """
55
        return MsSqlRoutineWrapperGeneratorWorker(io, config)
56
57
# ----------------------------------------------------------------------------------------------------------------------
58