Hide keyboard shortcuts

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

1import os 

2 

3from pystratum_backend.StratumStyle import StratumStyle 

4 

5 

6class MetadataDataLayer: 

7 """ 

8 Data layer for retrieving metadata and loading stored routines. 

9 """ 

10 

11 # ------------------------------------------------------------------------------------------------------------------ 

12 def __init__(self, io: StratumStyle): 

13 """ 

14 Object constructor. 

15 

16 :param PyStratumStyle io: The output decorator. 

17 """ 

18 

19 self._io: StratumStyle = io 

20 """ 

21 The output decorator. 

22 """ 

23 

24 # ------------------------------------------------------------------------------------------------------------------ 

25 def _log_query(self, query: str) -> None: 

26 """ 

27 Logs the query on the console. 

28 

29 :param str query: The query. 

30 """ 

31 query = query.strip() 

32 

33 if os.linesep in query: 

34 # Query is a multi line query 

35 self._io.log_very_verbose('Executing query:') 

36 self._io.log_very_verbose('<sql>{0}</sql>'.format(query)) 

37 else: 

38 # Query is a single line query. 

39 self._io.log_very_verbose('Executing query: <sql>{0}</sql>'.format(query)) 

40 

41# ----------------------------------------------------------------------------------------------------------------------