MCPcopy
hub / github.com/andialbrecht/sqlparse / run

Method run

sqlparse/engine/filter_stack.py:29–51  ·  view source on GitHub ↗
(self, sql, encoding=None)

Source from the content-addressed store, hash-verified

27 self._grouping = True
28
29 def run(self, sql, encoding=None):
30 try:
31 stream = lexer.tokenize(sql, encoding)
32 # Process token stream
33 for filter_ in self.preprocess:
34 stream = filter_.process(stream)
35
36 stream = StatementSplitter().process(stream)
37
38 # Output: Stream processed Statements
39 for stmt in stream:
40 if self._grouping:
41 stmt = grouping.group(stmt)
42
43 for filter_ in self.stmtprocess:
44 filter_.process(stmt)
45
46 for filter_ in self.postprocess:
47 stmt = filter_.process(stmt)
48
49 yield stmt
50 except RecursionError as err:
51 raise SQLParseError('Maximum recursion depth exceeded') from err

Callers 3

parsestreamFunction · 0.95
formatFunction · 0.95
splitFunction · 0.95

Calls 3

StatementSplitterClass · 0.90
SQLParseErrorClass · 0.90
processMethod · 0.45

Tested by

no test coverage detected