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
)
| 66 | |
| 67 | |
| 68 | def 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)] |
nothing calls this directly
no test coverage detected
searching dependent graphs…