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

Function split

sqlparse/__init__.py:68–80  ·  view source on GitHub ↗

Split *sql* into single statements. :param sql: A string containing one or more SQL statements. :param encoding: The encoding of the statement (optional). :param strip_semicolon: If True, remove trailing semicolons (default: False). :returns: A list of strings.

(
    sql: str, encoding: Optional[str] = None, strip_semicolon: bool = False
)

Source from the content-addressed store, hash-verified

66
67
68def split(
69 sql: str, encoding: Optional[str] = None, strip_semicolon: bool = False
70) -> List[str]:
71 """Split *sql* into single statements.
72
73 :param sql: A string containing one or more SQL statements.
74 :param encoding: The encoding of the statement (optional).
75 :param strip_semicolon: If True, remove trailing semicolons
76 (default: False).
77 :returns: A list of strings.
78 """
79 stack = engine.FilterStack(strip_semicolon=strip_semicolon)
80 return [str(stmt).strip() for stmt in stack.run(sql, encoding)]

Callers

nothing calls this directly

Calls 1

runMethod · 0.95

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…