Coverage for pystratum_common/MetadataDataLayer.py : 0%

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
3from pystratum_backend.StratumStyle import StratumStyle
6class MetadataDataLayer:
7 """
8 Data layer for retrieving metadata and loading stored routines.
9 """
11 # ------------------------------------------------------------------------------------------------------------------
12 def __init__(self, io: StratumStyle):
13 """
14 Object constructor.
16 :param PyStratumStyle io: The output decorator.
17 """
19 self._io: StratumStyle = io
20 """
21 The output decorator.
22 """
24 # ------------------------------------------------------------------------------------------------------------------
25 def _log_query(self, query: str) -> None:
26 """
27 Logs the query on the console.
29 :param str query: The query.
30 """
31 query = query.strip()
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))
41# ----------------------------------------------------------------------------------------------------------------------